OpenMD  2.5
Molecular Dynamics in the Open
OpenMD::ForceManager Class Reference

#include "brains/ForceManager.hpp"

Inheritance diagram for OpenMD::ForceManager:
OpenMD::LangevinHullForceManager OpenMD::LDForceManager OpenMD::RestraintForceManager OpenMD::ZconstraintForceManager OpenMD::ThermoIntegrationForceManager

Public Member Functions

 ForceManager (SimInfo *info)
 
virtual ~ForceManager ()
 
virtual void calcForces ()
 
void initialize ()
 

Protected Member Functions

virtual void setupCutoffs ()
 
virtual void preCalculation ()
 
virtual void shortRangeInteractions ()
 
virtual void longRangeInteractions ()
 
virtual void postCalculation ()
 

Protected Attributes

bool initialized_
 
bool doParticlePot_
 
bool doElectricField_
 
bool doSitePotential_
 
bool doHeatFlux_
 
bool doLongRangeCorrections_
 
bool usePeriodicBoundaryConditions_
 
SimInfoinfo_
 
ForceFieldforceField_
 
InteractionManagerinteractionMan_
 
ForceDecompositionfDecomp_
 
SwitchingFunctionswitcher_
 
Thermothermo
 
SwitchingFunctionType sft_
 
RealType rCut_
 
RealType rCutSq_
 
RealType rSwitch_
 
CutoffMethod cutoffMethod_
 
set< AtomType * > atomTypes_
 
vector< pair< AtomType *, AtomType * > > interactions_
 
map< Bend *, BendDataSetbendDataSets
 
map< Torsion *, TorsionDataSettorsionDataSets
 
map< Inversion *, InversionDataSetinversionDataSets
 
vector< int > neighborList_
 
vector< int > point_
 
vector< RealType > vdwScale_
 
vector< RealType > electrostaticScale_
 
Mat3x3d stressTensor
 
vector< Perturbation * > perturbations_
 
bool doPotentialSelection_
 
string selectionScript_
 
SelectionManager seleMan_
 
SelectionEvaluator evaluator_
 

Detailed Description

ForceManager is responsible for calculating both the short range (bonded) interactions and long range (non-bonded) interactions.

Note
the reason we delay some of the setup is that initialization must wait until after the force field has been parsed so that the atom types are known.

Definition at line 78 of file ForceManager.hpp.

Constructor & Destructor Documentation

◆ ForceManager()

OpenMD::ForceManager::ForceManager ( SimInfo info)

◆ ~ForceManager()

OpenMD::ForceManager::~ForceManager ( )
virtual

Definition at line 79 of file ForceManager.cpp.

References fDecomp_, interactionMan_, perturbations_, switcher_, and thermo.

Member Function Documentation

◆ calcForces()

◆ initialize()

void OpenMD::ForceManager::initialize ( )

We want to delay the cutoffs until after the interaction manager has set up the atom-atom interactions so that we can query them for suggested cutoff values

Force fields can set options on how to scale van der Waals and electrostatic interactions for atoms connected via bonds, bends and torsions in this case the topological distance between atoms is: 0 = topologically unconnected 1 = bonded together 2 = connected via a bend 3 = connected via a torsion

Definition at line 352 of file ForceManager.cpp.

References OpenMD::ForceDecomposition::distributeInitialData(), doElectricField_, doHeatFlux_, doParticlePot_, doPotentialSelection_, doSitePotential_, electrostaticScale_, OpenMD::SelectionEvaluator::evaluate(), evaluator_, fDecomp_, forceField_, OpenMD::ForceField::getForceFieldOptions(), OpenMD::SimInfo::getSimParams(), info_, OpenMD::InteractionManager::initialize(), initialized_, interactionMan_, OpenMD::SelectionEvaluator::isDynamic(), OpenMD::SimInfo::isTopologyDone(), OpenMD::SelectionEvaluator::loadScriptString(), perturbations_, OpenMD::SimInfo::prepareTopology(), selectionScript_, seleMan_, OpenMD::SelectionManager::setSelectionSet(), OpenMD::InteractionManager::setSimInfo(), setupCutoffs(), OpenMD::SimInfo::update(), usePeriodicBoundaryConditions_, and vdwScale_.

Referenced by calcForces(), OpenMD::VelocityVerletIntegrator::initialize(), and main().

◆ longRangeInteractions()

void OpenMD::ForceManager::longRangeInteractions ( )
protectedvirtual

Definition at line 676 of file ForceManager.cpp.

References OpenMD::ForceDecomposition::addForceToAtomColumn(), OpenMD::ForceDecomposition::addForceToAtomRow(), OpenMD::ForceDecomposition::addToHeatFlux(), OpenMD::Snapshot::atomData, OpenMD::Molecule::beginCutoffGroup(), OpenMD::SimInfo::beginMolecule(), OpenMD::ForceDecomposition::buildNeighborList(), OpenMD::Snapshot::cgData, OpenMD::ForceDecomposition::checkNeighborList(), OpenMD::ForceDecomposition::collectData(), OpenMD::ForceDecomposition::collectIntermediateData(), OpenMD::ForceDecomposition::collectSelfData(), cutoffMethod_, OpenMD::InteractionData::d, OpenMD::ForceDecomposition::distributeData(), OpenMD::ForceDecomposition::distributeIntermediateData(), OpenMD::InteractionData::doElectricField, doElectricField_, doHeatFlux_, OpenMD::InteractionManager::doPair(), OpenMD::InteractionData::doParticlePot, OpenMD::SelfData::doParticlePot, doParticlePot_, doPotentialSelection_, OpenMD::InteractionManager::doPreForce(), OpenMD::InteractionManager::doPrePair(), OpenMD::InteractionManager::doReciprocalSpaceSum(), OpenMD::InteractionManager::doSelfCorrection(), OpenMD::InteractionData::doSitePotential, doSitePotential_, OpenMD::dot(), OpenMD::InteractionData::dVdFQ1, OpenMD::InteractionData::dVdFQ2, OpenMD::InteractionData::eField1, OpenMD::InteractionData::eField2, OpenMD::InteractionData::electroMult, electrostaticScale_, OpenMD::EWALD_FULL, OpenMD::InteractionData::excludedPot, OpenMD::SelfData::excludedPot, OpenMD::InteractionData::f1, fDecomp_, OpenMD::ForceDecomposition::fillInteractionData(), OpenMD::ForceDecomposition::fillSelfData(), OpenMD::ForceDecomposition::getAtomsInGroupColumn(), OpenMD::ForceDecomposition::getAtomsInGroupRow(), OpenMD::ForceDecomposition::getAtomToGroupVectorColumn(), OpenMD::ForceDecomposition::getAtomToGroupVectorRow(), OpenMD::ForceDecomposition::getAtomVelocityColumn(), OpenMD::Thermo::getBoundingBox(), OpenMD::SnapshotManager::getCurrentSnapshot(), OpenMD::ForceDecomposition::getExcludedPotential(), OpenMD::ForceDecomposition::getExcludedSelfPotential(), OpenMD::ForceDecomposition::getGlobalID(), OpenMD::ForceDecomposition::getGlobalIDCol(), OpenMD::ForceDecomposition::getGlobalIDRow(), OpenMD::ForceDecomposition::getGroupVelocityColumn(), OpenMD::ForceDecomposition::getInteratomicVector(), OpenMD::ForceDecomposition::getIntergroupVector(), OpenMD::ForceDecomposition::getMassFactorColumn(), OpenMD::ForceDecomposition::getMassFactorRow(), OpenMD::SimInfo::getNAtoms(), OpenMD::SimInfo::getNCutoffGroups(), OpenMD::ForceDecomposition::getPairwisePotential(), OpenMD::ForceDecomposition::getSelectedPotential(), OpenMD::ForceDecomposition::getSelectedSelfPotential(), OpenMD::Snapshot::getSelectionPotentials(), OpenMD::ForceDecomposition::getSelfPotential(), OpenMD::SimInfo::getSnapshotManager(), OpenMD::SwitchingFunction::getSwitch(), OpenMD::ForceDecomposition::getTopologicalDistance(), info_, interactionMan_, OpenMD::SelectionManager::isGlobalIDSelected(), OpenMD::InteractionData::isSelected, OpenMD::SelfData::isSelected, OpenMD::Vector< Real, Dim >::lengthSquare(), neighborList_, OpenMD::Molecule::nextCutoffGroup(), OpenMD::SimInfo::nextMolecule(), OpenMD::outProduct(), PAIR_LOOP, point_, OpenMD::DataStorage::position, OpenMD::InteractionData::pot, PREPAIR_LOOP, OpenMD::InteractionData::r2, OpenMD::InteractionData::rcut, rCut_, rCutSq_, OpenMD::SimInfo::requiresPrepair(), OpenMD::SimInfo::requiresSelfCorrection(), OpenMD::InteractionData::rij, seleMan_, OpenMD::InteractionData::selePot, OpenMD::SelfData::selePot, OpenMD::SelfData::selfPot, OpenMD::Snapshot::setExcludedPotentials(), OpenMD::Snapshot::setLongRangePotential(), OpenMD::Snapshot::setReciprocalPotential(), OpenMD::Snapshot::setSelectionPotentials(), OpenMD::Snapshot::setSurfacePotential(), OpenMD::SHIFTED_FORCE, OpenMD::SHIFTED_POTENTIAL, OpenMD::InteractionData::shiftedForce, OpenMD::InteractionData::shiftedPot, OpenMD::ForceDecomposition::skipAtomPair(), OpenMD::InteractionData::sPot1, OpenMD::InteractionData::sPot2, stressTensor, OpenMD::InteractionData::sw, switcher_, OpenMD::TAYLOR_SHIFTED, thermo, OpenMD::ForceDecomposition::unpackInteractionData(), OpenMD::CutoffGroup::updateCOM(), usePeriodicBoundaryConditions_, OpenMD::SimInfo::usesAtomicVirial(), OpenMD::InteractionData::vdwMult, vdwScale_, OpenMD::DataStorage::velocity, OpenMD::InteractionData::vpair, OpenMD::Snapshot::wrapVector(), OpenMD::Vector< Real, Dim >::zero(), and OpenMD::ForceDecomposition::zeroWorkArrays().

Referenced by calcForces().

◆ postCalculation()

◆ preCalculation()

◆ setupCutoffs()

void OpenMD::ForceManager::setupCutoffs ( )
protectedvirtual

setupCutoffs

Sets the values of cutoffRadius, switchingRadius, and cutoffMethod

cutoffRadius : realType If the cutoffRadius was explicitly set, use that value. If the cutoffRadius was not explicitly set: Are there electrostatic atoms? Use 12.0 Angstroms. No electrostatic atoms? Poll the atom types present in the simulation for suggested cutoff values (e.g. 2.5 * sigma). Use the maximum suggested value that was found.

cutoffMethod : (one of HARD, SWITCHED, SHIFTED_FORCE, TAYLOR_SHIFTED, SHIFTED_POTENTIAL, or EWALD_FULL) If cutoffMethod was explicitly set, use that choice. If cutoffMethod was not explicitly set, use SHIFTED_FORCE

switchingRadius : realType If the cutoffMethod was set to SWITCHED: If the switchingRadius was explicitly set, use that value (but do a sanity check first). If the switchingRadius was not explicitly set: use 0.85 * cutoffRadius_ If the cutoffMethod was not set to SWITCHED: Set switchingRadius equal to cutoffRadius for safety.

Definition at line 115 of file ForceManager.cpp.

References atomTypes_, OpenMD::cubic, cutoffMethod_, errorStruct::errMsg, OpenMD::EWALD_FULL, fDecomp_, OpenMD::fifth_order_poly, OpenMD::SimInfo::getSimParams(), OpenMD::SimInfo::getSimulatedAtomTypes(), OpenMD::InteractionManager::getSuggestedCutoffRadius(), OpenMD::HARD, info_, interactionMan_, errorStruct::isFatal, OPENMD_ERROR, OPENMD_INFO, OPENMD_WARNING, painCave, rCut_, rCutSq_, rSwitch_, OpenMD::InteractionManager::setCutoffRadius(), OpenMD::ForceDecomposition::setCutoffRadius(), OpenMD::SwitchingFunction::setSwitch(), OpenMD::SwitchingFunction::setSwitchType(), errorStruct::severity, sft_, OpenMD::SHIFTED_FORCE, OpenMD::SHIFTED_POTENTIAL, simError(), OpenMD::SWITCHED, switcher_, OpenMD::TAYLOR_SHIFTED, OpenMD::toUpper(), OpenMD::toUpperCopy(), and OpenMD::SimInfo::usesElectrostaticAtoms().

Referenced by initialize().

◆ shortRangeInteractions()

void OpenMD::ForceManager::shortRangeInteractions ( )
protectedvirtual

Definition at line 506 of file ForceManager.cpp.

References OpenMD::InversionData::angle, OpenMD::TorsionData::angle, OpenMD::BendData::angle, OpenMD::Molecule::beginBend(), OpenMD::Molecule::beginBond(), OpenMD::Molecule::beginInversion(), OpenMD::SimInfo::beginMolecule(), OpenMD::Molecule::beginRigidBody(), OpenMD::Molecule::beginTorsion(), bendDataSets, OpenMD::BONDED_FAMILY, OpenMD::Bond::calcForce(), OpenMD::Inversion::calcForce(), OpenMD::Torsion::calcForce(), OpenMD::Bend::calcForce(), OpenMD::InversionDataSet::curr, OpenMD::TorsionDataSet::curr, OpenMD::BendDataSet::curr, OpenMD::InversionDataSet::deltaV, OpenMD::TorsionDataSet::deltaV, OpenMD::BendDataSet::deltaV, doParticlePot_, doPotentialSelection_, OpenMD::Bond::getAtomA(), OpenMD::Bend::getAtomA(), OpenMD::Inversion::getAtomA(), OpenMD::Torsion::getAtomA(), OpenMD::Bond::getAtomB(), OpenMD::Bend::getAtomB(), OpenMD::Inversion::getAtomB(), OpenMD::Torsion::getAtomB(), OpenMD::Bend::getAtomC(), OpenMD::Inversion::getAtomC(), OpenMD::Torsion::getAtomC(), OpenMD::Inversion::getAtomD(), OpenMD::Torsion::getAtomD(), OpenMD::SnapshotManager::getCurrentSnapshot(), OpenMD::Bond::getPotential(), OpenMD::Bend::getPotential(), OpenMD::Inversion::getPotential(), OpenMD::Torsion::getPotential(), OpenMD::SimInfo::getSnapshotManager(), info_, inversionDataSets, OpenMD::SelectionManager::isSelected(), OpenMD::Molecule::nextBend(), OpenMD::Molecule::nextBond(), OpenMD::Molecule::nextInversion(), OpenMD::SimInfo::nextMolecule(), OpenMD::Molecule::nextRigidBody(), OpenMD::Molecule::nextTorsion(), OpenMD::InversionData::potential, OpenMD::TorsionData::potential, OpenMD::BendData::potential, OpenMD::InversionDataSet::prev, OpenMD::BendDataSet::prev, OpenMD::TorsionDataSet::prev, seleMan_, OpenMD::Snapshot::setBendPotential(), OpenMD::Snapshot::setBondPotential(), OpenMD::Snapshot::setInversionPotential(), OpenMD::Snapshot::setSelectionPotentials(), OpenMD::Snapshot::setTorsionPotential(), torsionDataSets, and OpenMD::RigidBody::updateAtoms().

Referenced by calcForces().

Member Data Documentation

◆ atomTypes_

set<AtomType*> OpenMD::ForceManager::atomTypes_
protected

Definition at line 114 of file ForceManager.hpp.

Referenced by setupCutoffs().

◆ bendDataSets

map<Bend*, BendDataSet> OpenMD::ForceManager::bendDataSets
protected

Definition at line 116 of file ForceManager.hpp.

Referenced by shortRangeInteractions().

◆ cutoffMethod_

CutoffMethod OpenMD::ForceManager::cutoffMethod_
protected

Cutoff Method for most non-bonded interactions

Definition at line 112 of file ForceManager.hpp.

Referenced by longRangeInteractions(), and setupCutoffs().

◆ doElectricField_

bool OpenMD::ForceManager::doElectricField_
protected

Definition at line 89 of file ForceManager.hpp.

Referenced by initialize(), and longRangeInteractions().

◆ doHeatFlux_

bool OpenMD::ForceManager::doHeatFlux_
protected

Definition at line 91 of file ForceManager.hpp.

Referenced by initialize(), and longRangeInteractions().

◆ doLongRangeCorrections_

bool OpenMD::ForceManager::doLongRangeCorrections_
protected

Definition at line 92 of file ForceManager.hpp.

◆ doParticlePot_

bool OpenMD::ForceManager::doParticlePot_
protected

Definition at line 88 of file ForceManager.hpp.

Referenced by initialize(), longRangeInteractions(), and shortRangeInteractions().

◆ doPotentialSelection_

bool OpenMD::ForceManager::doPotentialSelection_
protected

◆ doSitePotential_

bool OpenMD::ForceManager::doSitePotential_
protected

Definition at line 90 of file ForceManager.hpp.

Referenced by initialize(), and longRangeInteractions().

◆ electrostaticScale_

vector<RealType> OpenMD::ForceManager::electrostaticScale_
protected

Definition at line 124 of file ForceManager.hpp.

Referenced by initialize(), and longRangeInteractions().

◆ evaluator_

SelectionEvaluator OpenMD::ForceManager::evaluator_
protected

Definition at line 133 of file ForceManager.hpp.

Referenced by initialize(), and preCalculation().

◆ fDecomp_

ForceDecomposition* OpenMD::ForceManager::fDecomp_
protected

◆ forceField_

ForceField* OpenMD::ForceManager::forceField_
protected

Definition at line 102 of file ForceManager.hpp.

Referenced by ForceManager(), and initialize().

◆ info_

◆ initialized_

bool OpenMD::ForceManager::initialized_
protected

Definition at line 87 of file ForceManager.hpp.

Referenced by calcForces(), and initialize().

◆ interactionMan_

InteractionManager* OpenMD::ForceManager::interactionMan_
protected

◆ interactions_

vector<pair<AtomType*, AtomType*> > OpenMD::ForceManager::interactions_
protected

Definition at line 115 of file ForceManager.hpp.

◆ inversionDataSets

map<Inversion*, InversionDataSet> OpenMD::ForceManager::inversionDataSets
protected

Definition at line 118 of file ForceManager.hpp.

Referenced by shortRangeInteractions().

◆ neighborList_

vector<int> OpenMD::ForceManager::neighborList_
protected

Definition at line 120 of file ForceManager.hpp.

Referenced by longRangeInteractions().

◆ perturbations_

vector<Perturbation*> OpenMD::ForceManager::perturbations_
protected

Definition at line 128 of file ForceManager.hpp.

Referenced by initialize(), postCalculation(), and ~ForceManager().

◆ point_

vector<int> OpenMD::ForceManager::point_
protected

Definition at line 121 of file ForceManager.hpp.

Referenced by longRangeInteractions().

◆ rCut_

RealType OpenMD::ForceManager::rCut_
protected

cutoff radius for non-bonded interactions

Definition at line 109 of file ForceManager.hpp.

Referenced by longRangeInteractions(), and setupCutoffs().

◆ rCutSq_

RealType OpenMD::ForceManager::rCutSq_
protected

Definition at line 110 of file ForceManager.hpp.

Referenced by longRangeInteractions(), and setupCutoffs().

◆ rSwitch_

RealType OpenMD::ForceManager::rSwitch_
protected

inner radius of switching function

Definition at line 111 of file ForceManager.hpp.

Referenced by setupCutoffs().

◆ selectionScript_

string OpenMD::ForceManager::selectionScript_
protected

Definition at line 131 of file ForceManager.hpp.

Referenced by initialize().

◆ seleMan_

SelectionManager OpenMD::ForceManager::seleMan_
protected

◆ sft_

SwitchingFunctionType OpenMD::ForceManager::sft_
protected

Type of switching function in use

Definition at line 108 of file ForceManager.hpp.

Referenced by setupCutoffs().

◆ stressTensor

Mat3x3d OpenMD::ForceManager::stressTensor
protected

Definition at line 126 of file ForceManager.hpp.

Referenced by longRangeInteractions(), postCalculation(), and preCalculation().

◆ switcher_

SwitchingFunction* OpenMD::ForceManager::switcher_
protected

Definition at line 105 of file ForceManager.hpp.

Referenced by longRangeInteractions(), setupCutoffs(), and ~ForceManager().

◆ thermo

Thermo* OpenMD::ForceManager::thermo
protected

Definition at line 106 of file ForceManager.hpp.

Referenced by ForceManager(), longRangeInteractions(), and ~ForceManager().

◆ torsionDataSets

map<Torsion*, TorsionDataSet> OpenMD::ForceManager::torsionDataSets
protected

Definition at line 117 of file ForceManager.hpp.

Referenced by shortRangeInteractions().

◆ usePeriodicBoundaryConditions_

bool OpenMD::ForceManager::usePeriodicBoundaryConditions_
protected

Definition at line 93 of file ForceManager.hpp.

Referenced by initialize(), and longRangeInteractions().

◆ vdwScale_

vector<RealType> OpenMD::ForceManager::vdwScale_
protected

Definition at line 123 of file ForceManager.hpp.

Referenced by initialize(), and longRangeInteractions().


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