This is a particular kind of MultibodySystem, one intended for use in molecular mechanics (MM). More...
#include <MolecularMechanicsSystem.h>
Public Member Functions | |
MolecularMechanicsSystem () | |
MolecularMechanicsSystem (SimbodyMatterSubsystem &, DuMMForceFieldSubsystem &) | |
int | setMolecularMechanicsForceSubsystem (DuMMForceFieldSubsystem &) |
const DuMMForceFieldSubsystem & | getMolecularMechanicsForceSubsystem () const |
DuMMForceFieldSubsystem & | updMolecularMechanicsForceSubsystem () |
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) |
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.
Determine the instantaneous location of the overall system "rigid body" mass center for the configuration supplied in the given State parameter.
[in] | state | The source for current configuration information. |
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.
[in] | state | The State from which the configuration and velocities are taken. |
const DuMMForceFieldSubsystem& getMolecularMechanicsForceSubsystem | ( | ) | 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.
[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. |
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:
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.
[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. |
Referenced by MassCenterMotionRemover::removeSystemMomentum().
int setMolecularMechanicsForceSubsystem | ( | DuMMForceFieldSubsystem & | ) |
SimTK_PIMPL_DOWNCAST | ( | MolecularMechanicsSystem | , | |
System | ||||
) |
Reimplemented from MultibodySystem.
DuMMForceFieldSubsystem& updMolecularMechanicsForceSubsystem | ( | ) |