ivm
index
ivm.py

The Internal Variable Module
 
  An IVM object manipulates atomic coordinates, using molecular
dynamics and gradient minimization techniques. IVM objects efficiently
perform calculations in general coordinates. Particularly useful are
calculations in torsion angle space, and also rigid-body
manipulations. 
 
A copy of the IVM paper with some corrections is available online.
The proper citation is
 
    C.D. Schwieters and G.M. Clore, Internal coordinates for
    molecular dynamics and minimization in structure determination and
    refinement; J. Magn. Reson. 152, 288-302 (2001).
 
Constructor: 
  IVM(simulation) - the optional simulation argument specifies the 
                    associated simulation.Simulation and defaults to
                    currentSimulation if omitted.
 
Members:
  run() - perform dynamics or minimization. Stop when numSteps have been taken,
          or finalTime has been reached (whichever is first).
 
  reset() - clear the following lists:
        bondExclude, groupList, hingeList, constraintList, baseAtoms
 
  fix(selList)   - add fixed atoms specified by a selection of a 
                   list of indices or atoms. Note that this command modifies 
                   groupList.
  group(selList) - add atoms to groupList. Atoms may specified by a
                   selection of a list of indices or atoms.
  hinge(type,specification) - add a hinge specification. The specification 
                          should be a sequence, the first element of which is a
                          string hinge type and the second a atom selection. 
                          Any optional arguments then follow. 
     Possible hinge types:
         "full"         node translates and rotates freely.
         "rotate"       node rotates freely - no translation.
         "translate"    node translates freely - no rotation.
         "torsion"      allow rotation of child hinge about bond
                          connecting it to its parent.
         "bend"         allow only bending motion. 
                          When using this hinge type, sel should specify
                          only a single atom, and two additonal
                          selection argument are required. The second selection
                          should specify the parent atom, and the third
                          should define the bend angle.
         "bendtorsion"  in addition to torsion motion, allow
                          bending. Specifications for the extra atom selection
                          argument are the same as for bend hinges.
 
  breakBond(a,b) - a sequence of two atom selections. This adds an
                   entry to the bondExclude list.
  breakAllBondsTo(sel) - break all bonds to atoms in the the given selection.
  breakAllBondsIn(sel) - break all bonds between the atoms in the
                         given selection.
  autoTorsion()  - set up hinges for torsion angle dynamics/minimization
 
  velFromCartesian() - set internal variable velocities to be as close
                       as possible to the current Cartesian counterparts.
 
  info(what) - return a string with info on the IVM settings.
               Optional argument what specifies information to return:
                  default      - info common to integration and minimization
                  all          - everything
                  integrate    - integration specific info
                  minimization - minimization specific info
                  topology     - information about the topology settings
        
Accessors: 
  following are functions which return values of the quantities.
  To set the values, use functions of the form setQuantity( value ).
  Note that not all quantities are accessible.
 
 
  stepType()  - integration or minimization method. Possible values:
                        minimization: Powell, MinimizeCG, ConMin, Simplex
                        integration:  PC6, RungeKutta, Gear, Milne, Verlet
 
 
  dof() - return the number of degrees of freedom
  dim() - return the dimension: number of internal coordinates
           (this is usually larger than dof() because there are
            additional constraint relationships).
 
  pos()                  - values of the internal coordinates (NOT atom 
                           positions). Note that setPos() also modifies ic 
                           velocities to be consistent with any constraints.
  vel()                  - values of the internal coordinate velocities. Note 
                           that velocities actually set maybe modified so they
                           areconsistent with any constraints. If stepType is
                           set to a minimization type, velocities are zero'd.
  numSteps()             - number of time steps to take. 0 for disabled
  finalTime()            - end time for integration. 0 for disabled
  stepsize()               - the current step size.
  printInterval()       - how many steps between energy printouts.
  resetCMInterval()       - how many steps between zeroing linear/ang momentum.
  autoTorsion()               - set up groupList and hingeList for 
                           torsion-angle manipulations. Existing groupList and
                           and hingeList specifications are preserved.
  bondExclude()          - list of pairs of inidices:
                           bonds to ignore when considering molecular topology
  constraintList()       - list of pairs of inidices:
                           bonds to constrain (if useLengthConstraints)
  groupList()            - list of list of atom indices- 
                             grouped atoms fixed w/ respect to each other
  hingeList()            - list of atom indices:
                             atom(s) to use as base atoms in the tree topology
  baseAtoms()            - list of atom indices:
                           atom(s) which should be used as base atoms.
  oldBaseAtoms()         - list of atom indices:
                           atom(s) which were base atoms previously
  nodeList()             - return list of nodes, each of type PublicNode, 
                           described below.
  eCount()               - number of energy evaluations since last eReset()
  bathTemp()             - value bath temp is set to
  currentTemp()          - temperature calc'd from current velocities
  Etotal()               - current total energy (pot + kin)
  Epotential()           - current potential energy
  Ekinetic()             - current kinetic energy
  eTolerance()           - energy tolerance - for minimization and integration
  gTolerance()           - gradient tolerance - for minimization
  cTolerance()           - length constraint tolerance
  dEpred()               - delta energy prediction
  responseTime()         - response time for timestep adjustment
  frictionCoeff()        - friction scaling coefficient 
                               (should be zero if velocity scaling is used)
  kBoltzmann()           - Boltzmann's constant
  maxCalls()             - maximum number of energy calls in minimization
  constrainLengths()     - boolean: whether to use length constraints
  adjustStepsize()       - boolean: whether to adjust integration stepsize
                                    to maintain constant energy.
  scaleVel()             - boolean: whether to scale velocities for 
                                    equilibration with a temperature bath.
  maxTSFactor()       - max factor for timestep increase (1.025)
  maxDeltaE()               - maximum energy change before halving timestep
  trajectory()               - the trajectory method. This object must have a
                           method named write(stepNum,stepSize).
  recenterLargeDispl()    - recenter all atoms at the origin if any atom
                            has an espcially large displacement (False).
  verbose()              - return the verbose bitfield: Possible values:
                                       printCoords         
                                       printResetCM         
                                       printVelFromCartCost 
                                       printTemperature     
                                       printEnergy         
                                       printCMVel         
                                       printNodeForce         
                                       printNodePos         
                                       printNodeTheta         
                                       printStepDebug         
                                       printStepInfo         
                                       printNodeDef         
                                       printLoopDebug         
                                       printLoopInfo         
                           an example of using verbose:
                       min.setVerbose( min.printLoopInfo | min.printStepInfo )
 
The following methods are primarily for internal use:
  
  idAtom(index)  - given an atom index, return descriptive string 
         
  init()         - initialize IVM internals
 
  initDynamics(reuseTopology) -
                                resynchronize internal velocities from 
                                Cartesian values. 
                                Also. reinitialize the integrator.
                                If reuseTopology is false, regenerate topology.
               
  
  calcEnergy() - energy and derivatives calc'd and terms placed in energyTerms.
                 The toal energy (pot+kinetic) is returned.
                 Note that this routine calls ivm.init() so that ic tables are 
                 reset if any topology changes have been made. Etotal, 
                 Epotential and Ekinetic are updated using this call.
 
  eCountReset() - reset eCount, incremented during each energy calc
 
  groupTorsion() - group atoms for torsion-angle dynamics. Obeys pre-existing 
                   groupList, hingeList, bondExclude and constraintList.
 
 
  resetCM() -   zero center of mass linear and angular momentum
 
  step(stepsize) - take dynamics or minimization step
                   tuple (finished,stepsize) returned.
                   Finished is true if stop condition is met.
                   stepsize specifies new stepsize, if variable.
 
class PublicNode, a list of which is returned by the nodeList() member of IVM.
 
Methods:
 
  dim()        - return the dimension of the hinge. This includes the number 
                 of degrees of freedom plus the number of constraints. 
  startIndex() - the start index of coordinates for this hinge in the 
                 IVM's pos() and vel() arrays of internal coordinates.
  parentAtom() - index of atom in the parent node to which this hinge/node is 
                 attached.
 
  type()       - type of hinge.
  atoms()      - list of indices of atoms contained in this node.
                 atoms()[0] is the index of the hinge atom.
 

 
Classes
       
publicIVM.PublicIVM(__builtin__.object)
IVM

 
class IVM(publicIVM.PublicIVM)
     Internal Variable Module class
          members:
            reuse: reuse coordinates and topology from previous call to 
                    run(), init(), or autoTorsion()
                   this can be unset explicitly, or whenever a topology
                   element is modified.
 
 
Method resolution order:
IVM
publicIVM.PublicIVM
__builtin__.object

Methods defined here:
__init__(s, sim=0)
autoTorsion(s)
set up hinges for torsion angle dynamics/minimization
baseAtoms(s)
breakAllBondsIn(s, sel)
break all bonds between atoms in selection
breakAllBondsTo(s, sel)
break all bonds to bonded atoms in selection
breakBond(s, el)
calcEnergy(s)
calculate energy in internal coordinates, and return the total
        energy. This is a safe wrapper around the underlying calcEnergy
finalTime(s)
fix(s, sel)
group(s, sel)
help(s)
hinge(s, hingeType, sel=None, *sels)
add a hinge definition of type hingeType for atoms specified by
        sel, an atomSel.AtomSel, string or list of indices. Some
        hinge types require additional selections specified as addtional
        arguments.        
        
idAtom(s, i)
info(s, what='default')
return a string with info on the IVM settings.
        An optional argument specifies information to return:
           default
           integrate    - integration specific info
           minimization - minimization specific info
           topology     - information about the topology settings
init(s)
numSteps(s)
outputStepInfo(s, step, stepsize, type, totTime)
printInterval(s)
reset(s)
resetCMInterval(s)
resetReuse(s)
reuse(s)
run(s)
selToIndices(s, sel)
convert AtomSel to list of indices
setBaseAtoms(s, l)
setBondExclude(s, v)
setConstraintList(s, v)
setFinalTime(s, v)
setGroupList(s, v)
setHingeList(s, v)
setNumSteps(s, v)
setPrintInterval(s, v)
setResetCMInterval(s, v)
setStepType(s, v)
setStepsize(s, v)
setTrajectory(s, v)
stepsize(s)
trajectory(s)

Methods inherited from publicIVM.PublicIVM:
Ekinetic(*args)
Epotential(*args)
Etotal(*args)
__del__(self, destroy=<built-in function delete_PublicIVM>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
adjustStepsize(*args)
bathTemp(*args)
bondExclude(*args)
cTolerance(*args)
calcTemperature(*args)
constrainLengths(*args)
constraintList(*args)
currentTemp(*args)
dEpred(*args)
dim(*args)
dof(*args)
eCount(*args)
eCountReset(*args)
eTolerance(*args)
frictionCoeff(*args)
gTolerance(*args)
gradMagnitude(*args)
groupList(*args)
groupTorsion(*args)
hingeList(*args)
initDynamics(*args)
kBoltzmann(*args)
maxCalls(*args)
maxDeltaE(*args)
maxTSFactor(*args)
minStepSize(*args)
minimization(*args)
nodeList(*args)
oldBaseAtoms(*args)
pos(*args)
potList(*args)
printStepDetails(*args)
recenterLargeDispl(*args)
resetCM(*args)
responseTime(*args)
scaleVel(*args)
setAdjustStepsize(*args)
setBathTemp(*args)
setCTolerance(*args)
setConstrainLengths(*args)
setDEpred(*args)
setETolerance(*args)
setFrictionCoeff(*args)
setGTolerance(*args)
setMaxCalls(*args)
setMaxDeltaE(*args)
setMaxTSFactor(*args)
setMinStepSize(*args)
setOldBaseAtoms(*args)
setPos(*args)
setPotList(*args)
setRVecProd(*args)
setRVecSize(*args)
setRecenterLargeDispl(*args)
setResponseTime(*args)
setScaleVel(*args)
setVecVec3Prod(*args)
setVecVec3Size(*args)
setVel(*args)
setVerbose(*args)
simulation(*args)
step(*args)
stepType(*args)
vel(*args)
velFromCartesian(*args)
verbose(*args)

Data and other attributes inherited from publicIVM.PublicIVM:
__dict__ = <dictproxy object at 0x1593c90>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'PublicIVM' objects>
list of weak references to the object (if defined)
printCMVel = 32
printCoords = 1
printEnergy = 16
printLoopDebug = 4096
printLoopInfo = 8192
printNodeDef = 2048
printNodeForce = 64
printNodeKE = 16384
printNodePos = 128
printNodeTheta = 256
printResetCM = 2
printStepDebug = 512
printStepInfo = 1024
printTemperature = 8
printVelFromCartCost = 4

 
Functions
       
help()
minimizeEscape(ivm)

 
Data
        env = {'LESS': '-X', 'TOPPAR_C22': '/home/schwitrs/xpl...ttp://www.hec.utah.edu/~schwitrs/bookmarks.html'}
minimizeEscapeCnt = 0