MolecularMechanicsSystem Class Reference

This is a particular kind of MultibodySystem, one intended for use in molecular mechanics (MM). More...

#include <MolecularMechanicsSystem.h>

Inheritance diagram for MolecularMechanicsSystem:
MultibodySystem System CompoundSystem

List of all members.

Public Member Functions

 MolecularMechanicsSystem ()
 MolecularMechanicsSystem (SimbodyMatterSubsystem &, DuMMForceFieldSubsystem &)
int setMolecularMechanicsForceSubsystem (DuMMForceFieldSubsystem &)
const DuMMForceFieldSubsystemgetMolecularMechanicsForceSubsystem () const
DuMMForceFieldSubsystemupdMolecularMechanicsForceSubsystem ()
SpatialVec calcSystemRigidBodyMomentum (const State &state) const
 Calculate this system's overall "rigid body" momentum about the system's mass center, in the configuration and with the velocities as supplied in the state parameter.
void removeSystemRigidBodyMomentum (State &state, bool linearOnly=false) const
 This solver attempts to remove the system's overall "rigid body" momentum in the given State about the system's mass center, by changing only the velocity of base body mobilizers (that is, mobilizers that connect particular bodies directly to Ground).
Vec3 calcSystemMassCenterLocation (const State &state) const
 Determine the instantaneous location of the overall system "rigid body" mass center for the configuration supplied in the given State parameter.
void moveSystemMassCenter (State &state, const Vec3 &newCOMLocation) const
 This solver attempts to move the system's overall "rigid body" mass center to a given location by changing only the generalized coordinates (positions) of base bodies (that is, mobilized bodies that are connected directly to Ground).
 SimTK_PIMPL_DOWNCAST (MolecularMechanicsSystem, System)

Detailed Description

This is a particular kind of MultibodySystem, one intended for use in molecular mechanics (MM).

The defining feature is that in addition to the mandatory MatterSubsystem common to all MultibodySystems, this one will also have a single MolecularMechanicsForceSubsystem. Unlike the base MultibodySystem, which can employ any consistent set of units, a MolecularMechanicsSystem always uses MD units with length in nm, time in ps, and mass in Da (g/mole).

There are also some solvers with a distinctively molecular flavor.


Constructor & Destructor Documentation


Member Function Documentation

Vec3 calcSystemMassCenterLocation ( const State state  )  const

Determine the instantaneous location of the overall system "rigid body" mass center for the configuration supplied in the given State parameter.

Parameters:
[in] state The source for current configuration information.
Returns:
The location of the system mass center measured from the Ground origin and expressed in the Ground frame.
See also:
moveSystemMassCenter()

Referenced by MassCenterMotionRemover::calcMassCenterError().

SpatialVec calcSystemRigidBodyMomentum ( const State state  )  const

Calculate this system's overall "rigid body" momentum about the system's mass center, in the configuration and with the velocities as supplied in the state parameter.

Parameters:
[in] state The State from which the configuration and velocities are taken.
Returns:
The system central momentum as a SpatialVec P (a 2-vector of Vec3's) such that P[0] is the system angular momentum vector about its mass center and P[1] is the system's linear momentum vector.These vectors are expressed in the Ground frame.
See also:
removeSystemRigidBodyMomentum()
const DuMMForceFieldSubsystem& getMolecularMechanicsForceSubsystem (  )  const
void moveSystemMassCenter ( State state,
const Vec3 newCOMLocation 
) const

This solver attempts to move the system's overall "rigid body" mass center to a given location by changing only the generalized coordinates (positions) of base bodies (that is, mobilized bodies that are connected directly to Ground).

This is commonly used to force the system mass center to stay in one location if it has been drifting due to numerical errors or other non-conservative effects.

This solver will always succeed as long as all the base bodies have unrestricted translational freedom (3 translational degrees of freedom). In that case the relative position of all atoms in the system will be unchanged by this solver; they will move as though attached to a single rigid body. If some of the base bodies are unable to make the required translation, then the system will be distorted and the mass center will not be at the desired location. You can use the method calcSystemMassCenterLocation() to see whether the solver was successful; it will return quietly with a partial result if it fails.

Parameters:
[in,out] state The State from which current configuration information is taken, and to which new base body positions are written so that the system mass center is moved to a desired location.
[in] newCOMLocation The desired location for the system mass center, as a vector from the Ground origin, expressed in the Ground frame.
See also:
calcSystemMassCenterLocation()

Referenced by MassCenterMotionRemover::correctMassCenterLocation().

void removeSystemRigidBodyMomentum ( State state,
bool  linearOnly = false 
) const

This solver attempts to remove the system's overall "rigid body" momentum in the given State about the system's mass center, by changing only the velocity of base body mobilizers (that is, mobilizers that connect particular bodies directly to Ground).

This will always work as long as all base bodies are "free" -- meaning that they are connected to Ground by six-dof mobilizers for full rigid bodies, three for point masses, and five for "linear" bodies like a CO2 molecule.

The method is as follows:

  • calculate the system central momentum.
  • viewing the whole system as a single rigid body, calculate the linear and angular velocity change for that body that would eliminate its momentum.
  • at every point where the "rigid body" is connected to ground by a mobilizer (i.e., at the base bodies) calculate the corresponding rigid body velocity that would be consistent with the needed velocity change, and apply that to the base body mobilizer generalized speeds.

It is possible that some base bodies are unable to change their velocities appropriately, perhaps because the associated mobilizer is not free or because there is a constraint or prescribed motion present that prevents the adjustment. In that case the solver will fail to achieve zero momentum. However, there is no error return. If you want to check, use the calcSystemRigidBodyMomentum() method.

Parameters:
[in,out] state This is the State that supplies the current configuration and velocities. The configuration remains unchanged, but the velocities are modified as described above.
[in] linearOnly Normally both the linear and angular momentum are removed. If you set this parameter to true, only the linear momentum will be removed.
See also:
calcSystemRigidBodyMomentum() to check the results

Referenced by MassCenterMotionRemover::removeSystemMomentum().

int setMolecularMechanicsForceSubsystem ( DuMMForceFieldSubsystem  ) 
SimTK_PIMPL_DOWNCAST ( MolecularMechanicsSystem  ,
System   
)

Reimplemented from MultibodySystem.

DuMMForceFieldSubsystem& updMolecularMechanicsForceSubsystem (  ) 

The documentation for this class was generated from the following file:

Generated on Wed Dec 30 11:05:12 2009 for SimTKcore by  doxygen 1.6.1