#include <VanDerWaalsForce.h>
Classes | |
struct | ForceAndEnergy |
class | VdwAtom |
struct | WallSphere |
Public Types | |
typedef AtomSubsystem::AtomIndex | AtomIndex |
typedef Real | length_t |
typedef Real | area_t |
typedef Real | energy_t |
typedef Real | inverse_area_t |
typedef Vec3 | location_t |
typedef Vec3 | force_t |
Public Member Functions | |
VanDerWaalsForce (const AtomSubsystem &atomSubsystem, length_t cutoff=0.0 *nanometers) | |
bool | dependsOnlyOnPositions () const |
Get whether this force depends only on the position variables (q), not on the velocies (u) or auxiliary variables (z). | |
void | addAtom (AtomSubsystem::AtomIndex atomIndex, length_t rMin, energy_t wellDepth) |
void | addBoundarySphere (const location_t ¢er, length_t radius, length_t vdwRadius, energy_t wellDepth) |
void | decorateAtoms (DecorationSubsystem &decorations, Real scale=1.0) const |
void | decorateBoundingSpheres (DecorationSubsystem &decorations) const |
void | calcForce (const State &state, Vector_< SpatialVec > &bodyForces, Vector_< Vec3 > &particleForces, Vector &mobilityForces) const |
Calculate the force for a given state. | |
Real | calcPotentialEnergy (const State &state) const |
Calculate this force's contribution to the potential energy of the System. | |
Protected Member Functions | |
ForceAndEnergy | calcForceAndEnergy (const location_t &r, Real dij, Real eij) const |
void | calcForce (const VdwAtom &vdwAtom1, const VdwAtom &vdwAtom2, const State &state, Vector_< SpatialVec > &bodyForces) const |
energy_t | calcPotentialEnergy (const VdwAtom &vdwAtom1, const VdwAtom &vdwAtom2, const State &state) const |
void | calcForce (const WallSphere &sphere, const VdwAtom &vdwAtom2, const State &state, Vector_< SpatialVec > &bodyForces) const |
energy_t | calcPotentialEnergy (const WallSphere &sphere, const VdwAtom &vdwAtom2, const State &state) const |
Protected Attributes | |
const AtomSubsystem & | atomSubsystem |
std::vector< VdwAtom > | vdwAtoms |
length_t | cutoff |
area_t | cutoffSquared |
std::vector< WallSphere > | wallSpheres |
typedef Real area_t |
typedef AtomSubsystem::AtomIndex AtomIndex |
typedef Real energy_t |
typedef Real inverse_area_t |
typedef Real length_t |
typedef Vec3 location_t |
VanDerWaalsForce | ( | const AtomSubsystem & | atomSubsystem, | |
length_t | cutoff = 0.0 * nanometers | |||
) | [inline] |
References VanDerWaalsForce::vdwAtoms.
void addBoundarySphere | ( | const location_t & | center, | |
length_t | radius, | |||
length_t | vdwRadius, | |||
energy_t | wellDepth | |||
) | [inline] |
void calcForce | ( | const WallSphere & | sphere, | |
const VdwAtom & | vdwAtom2, | |||
const State & | state, | |||
Vector_< SpatialVec > & | bodyForces | |||
) | const [inline, protected] |
References VdwAtom::atomIndex, VanDerWaalsForce::atomSubsystem, VanDerWaalsForce::calcForceAndEnergy(), WallSphere::center, ForceAndEnergy::force, AtomSubsystem::getAtom(), AtomSubsystem::getAtomBodyStationInGround(), AtomSubsystem::getAtomLocationInGround(), Atom::getMobilizedBodyIndex(), Vec< M, ELT, STRIDE >::norm(), WallSphere::radius, VdwAtom::rMin, WallSphere::vdwRadius, VdwAtom::wellDepth, and WallSphere::wellDepth.
void calcForce | ( | const VdwAtom & | vdwAtom1, | |
const VdwAtom & | vdwAtom2, | |||
const State & | state, | |||
Vector_< SpatialVec > & | bodyForces | |||
) | const [inline, protected] |
References VdwAtom::atomIndex, VanDerWaalsForce::atomSubsystem, VanDerWaalsForce::calcForceAndEnergy(), ForceAndEnergy::force, AtomSubsystem::getAtom(), AtomSubsystem::getAtomBodyStationInGround(), AtomSubsystem::getAtomLocationInGround(), Atom::getMobilizedBodyIndex(), VdwAtom::rMin, and VdwAtom::wellDepth.
void calcForce | ( | const State & | state, | |
Vector_< SpatialVec > & | bodyForces, | |||
Vector_< Vec3 > & | particleForces, | |||
Vector & | mobilityForces | |||
) | const [inline, virtual] |
Calculate the force for a given state.
state | the State for which to calculate the force | |
bodyForces | spatial forces on MobilizedBodies are accumulated in this. To apply a force to a body, add it to the appropriate element of this vector. | |
particleForces | forces on particles are accumulated in this. Since particles are not yet implemented, this is ignored. | |
mobilityForces | forces on individual mobilities (elements of the state's u vector) are accumulated in this. To apply a force to a mobility, add it to the appropriate element of this vector. |
Implements Implementation.
References VdwAtom::atomIndex, VanDerWaalsForce::atomSubsystem, VanDerWaalsForce::cutoff, AtomSubsystem::pairBegin(), AtomSubsystem::pairEnd(), VanDerWaalsForce::vdwAtoms, and VanDerWaalsForce::wallSpheres.
ForceAndEnergy calcForceAndEnergy | ( | const location_t & | r, | |
Real | dij, | |||
Real | eij | |||
) | const [inline, protected] |
References VanDerWaalsForce::cutoff, VanDerWaalsForce::cutoffSquared, ForceAndEnergy::energy, and ForceAndEnergy::force.
Referenced by VanDerWaalsForce::calcForce(), and VanDerWaalsForce::calcPotentialEnergy().
energy_t calcPotentialEnergy | ( | const WallSphere & | sphere, | |
const VdwAtom & | vdwAtom2, | |||
const State & | state | |||
) | const [inline, protected] |
References VdwAtom::atomIndex, VanDerWaalsForce::atomSubsystem, VanDerWaalsForce::calcForceAndEnergy(), WallSphere::center, ForceAndEnergy::energy, AtomSubsystem::getAtom(), AtomSubsystem::getAtomLocationInGround(), Vec< M, ELT, STRIDE >::norm(), WallSphere::radius, VdwAtom::rMin, WallSphere::vdwRadius, VdwAtom::wellDepth, and WallSphere::wellDepth.
Real calcPotentialEnergy | ( | const State & | state | ) | const [inline, virtual] |
Calculate this force's contribution to the potential energy of the System.
state | the State for which to calculate the potential energy |
Implements Implementation.
References VdwAtom::atomIndex, VanDerWaalsForce::atomSubsystem, VanDerWaalsForce::cutoff, SimTK::md::kilojoules_per_mole, AtomSubsystem::pairBegin(), AtomSubsystem::pairEnd(), VanDerWaalsForce::vdwAtoms, and VanDerWaalsForce::wallSpheres.
void decorateAtoms | ( | DecorationSubsystem & | decorations, | |
Real | scale = 1.0 | |||
) | const [inline] |
void decorateBoundingSpheres | ( | DecorationSubsystem & | decorations | ) | const [inline] |
References DecorationSubsystem::addBodyFixedDecoration(), VanDerWaalsForce::atomSubsystem, WallSphere::center, SimbodyMatterSubsystem::getGround(), MultibodySystem::getMatterSubsystem(), MobilizedBody::getMobilizedBodyIndex(), AtomSubsystem::getMultibodySystem(), WallSphere::radius, and VanDerWaalsForce::wallSpheres.
bool dependsOnlyOnPositions | ( | ) | const [inline, virtual] |
Get whether this force depends only on the position variables (q), not on the velocies (u) or auxiliary variables (z).
The default implementation returns false. If the force depends only on positions, you should override this to return true. This allows force calculations to be optimized in some cases.
Reimplemented from Implementation.
const AtomSubsystem& atomSubsystem [protected] |
area_t cutoffSquared [protected] |
Referenced by VanDerWaalsForce::calcForceAndEnergy().
std::vector<WallSphere> wallSpheres [protected] |