OpenMD 3.1
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
OpenMD::ForceManager Class Reference

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

#include "brains/ForceManager.hpp"

+ Inheritance diagram for OpenMD::ForceManager:

Public Member Functions

 ForceManager (SimInfo *info)
 
virtual void calcForces ()
 
virtual void calcSelectedForces (Molecule *mol1, Molecule *mol2)
 
void setDoElectricField (bool def)
 
void initialize ()
 

Protected Member Functions

virtual void setupCutoffs ()
 setupCutoffs
 
virtual void preCalculation ()
 
virtual void shortRangeInteractions ()
 
virtual void longRangeInteractions ()
 
virtual void postCalculation ()
 
virtual void selectedPreCalculation (Molecule *mol1, Molecule *mol2)
 
virtual void selectedShortRangeInteractions (Molecule *mol1, Molecule *mol2)
 
virtual void selectedLongRangeInteractions (Molecule *mol1, Molecule *mol2)
 
virtual void selectedPostCalculation (Molecule *mol1, Molecule *mol2)
 

Protected Attributes

bool initialized_ {false}
 
bool doParticlePot_ {false}
 
bool doElectricField_ {false}
 
bool doSitePotential_ {false}
 
bool doHeatFlux_ {false}
 
bool doLongRangeCorrections_ {false}
 
bool usePeriodicBoundaryConditions_ {false}
 
bool useSurfaceTerm_ {false}
 
bool useSlabGeometry_ {false}
 
int axis_ {false}
 
SimInfoinfo_ {nullptr}
 
ForceFieldforceField_ {nullptr}
 
InteractionManagerinteractionMan_ {nullptr}
 
ForceDecompositionfDecomp_ {nullptr}
 
SwitchingFunctionswitcher_ {nullptr}
 
Thermothermo {nullptr}
 
SwitchingFunctionType sft_
 Type of switching function in use.
 
RealType rCut_
 cutoff radius for non-bonded interactions
 
RealType rCutSq_
 
RealType rSwitch_
 inner radius of switching function
 
CutoffMethod cutoffMethod_
 Cutoff Method for most non-bonded interactions.
 
AtomTypeSet atomTypes_
 
std::vector< pair< AtomType *, AtomType * > > interactions_
 
std::map< Bend *, BendDataSetbendDataSets
 
std::map< Torsion *, TorsionDataSettorsionDataSets
 
std::map< Inversion *, InversionDataSetinversionDataSets
 
std::vector< int > neighborList_
 
std::vector< int > point_
 
std::vector< Vector3dsavedPositions_
 
std::vector< RealType > vdwScale_
 
std::vector< RealType > electrostaticScale_
 
Mat3x3d virialTensor
 
std::vector< ForceModifier * > forceModifiers_
 
bool doPotentialSelection_ {false}
 
std::string selectionScript_
 
SelectionManager seleMan_
 
SelectionEvaluator evaluator_
 
InteractionData idat
 
SelfData sdat
 

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 80 of file ForceManager.hpp.

Constructor & Destructor Documentation

◆ ForceManager()

OpenMD::ForceManager::ForceManager ( SimInfo * info)

Definition at line 83 of file ForceManager.cpp.

◆ ~ForceManager()

OpenMD::ForceManager::~ForceManager ( )
virtual

Definition at line 92 of file ForceManager.cpp.

Member Function Documentation

◆ calcForces()

void OpenMD::ForceManager::calcForces ( )
virtual

Definition at line 527 of file ForceManager.cpp.

◆ calcSelectedForces()

void OpenMD::ForceManager::calcSelectedForces ( Molecule * mol1,
Molecule * mol2 )
virtual

Definition at line 1143 of file ForceManager.cpp.

◆ 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 378 of file ForceManager.cpp.

References OpenMD::SelectionEvaluator::isDynamic(), OpenMD::SimInfo::prepareTopology(), OpenMD::SimInfo::setNZconstraint(), setupCutoffs(), and OpenMD::SimInfo::update().

◆ longRangeInteractions()

void OpenMD::ForceManager::longRangeInteractions ( )
protectedvirtual

Definition at line 774 of file ForceManager.cpp.

◆ postCalculation()

void OpenMD::ForceManager::postCalculation ( )
protectedvirtual

Definition at line 1079 of file ForceManager.cpp.

◆ preCalculation()

void OpenMD::ForceManager::preCalculation ( )
protectedvirtual

Definition at line 536 of file ForceManager.cpp.

◆ selectedLongRangeInteractions()

void OpenMD::ForceManager::selectedLongRangeInteractions ( Molecule * mol1,
Molecule * mol2 )
protectedvirtual

Definition at line 1497 of file ForceManager.cpp.

◆ selectedPostCalculation()

void OpenMD::ForceManager::selectedPostCalculation ( Molecule * mol1,
Molecule * mol2 )
protectedvirtual

Definition at line 1803 of file ForceManager.cpp.

◆ selectedPreCalculation()

void OpenMD::ForceManager::selectedPreCalculation ( Molecule * mol1,
Molecule * mol2 )
protectedvirtual

Definition at line 1152 of file ForceManager.cpp.

◆ selectedShortRangeInteractions()

void OpenMD::ForceManager::selectedShortRangeInteractions ( Molecule * mol1,
Molecule * mol2 )
protectedvirtual

Definition at line 1219 of file ForceManager.cpp.

◆ setDoElectricField()

void OpenMD::ForceManager::setDoElectricField ( bool def)
inline

Definition at line 86 of file ForceManager.hpp.

◆ 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 128 of file ForceManager.cpp.

References cutoffMethod_, OpenMD::SimInfo::getSimulatedAtomTypes(), rCut_, rSwitch_, and sft_.

Referenced by initialize().

◆ shortRangeInteractions()

void OpenMD::ForceManager::shortRangeInteractions ( )
protectedvirtual

Definition at line 601 of file ForceManager.cpp.

Member Data Documentation

◆ atomTypes_

AtomTypeSet OpenMD::ForceManager::atomTypes_
protected

Definition at line 126 of file ForceManager.hpp.

◆ axis_

int OpenMD::ForceManager::axis_ {false}
protected

Definition at line 99 of file ForceManager.hpp.

◆ bendDataSets

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

Definition at line 128 of file ForceManager.hpp.

◆ cutoffMethod_

CutoffMethod OpenMD::ForceManager::cutoffMethod_
protected

Cutoff Method for most non-bonded interactions.

Definition at line 124 of file ForceManager.hpp.

Referenced by setupCutoffs().

◆ doElectricField_

bool OpenMD::ForceManager::doElectricField_ {false}
protected

Definition at line 92 of file ForceManager.hpp.

◆ doHeatFlux_

bool OpenMD::ForceManager::doHeatFlux_ {false}
protected

Definition at line 94 of file ForceManager.hpp.

◆ doLongRangeCorrections_

bool OpenMD::ForceManager::doLongRangeCorrections_ {false}
protected

Definition at line 95 of file ForceManager.hpp.

◆ doParticlePot_

bool OpenMD::ForceManager::doParticlePot_ {false}
protected

Definition at line 91 of file ForceManager.hpp.

◆ doPotentialSelection_

bool OpenMD::ForceManager::doPotentialSelection_ {false}
protected

Definition at line 142 of file ForceManager.hpp.

◆ doSitePotential_

bool OpenMD::ForceManager::doSitePotential_ {false}
protected

Definition at line 93 of file ForceManager.hpp.

◆ electrostaticScale_

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

Definition at line 136 of file ForceManager.hpp.

◆ evaluator_

SelectionEvaluator OpenMD::ForceManager::evaluator_
protected

Definition at line 145 of file ForceManager.hpp.

◆ fDecomp_

ForceDecomposition* OpenMD::ForceManager::fDecomp_ {nullptr}
protected

Definition at line 115 of file ForceManager.hpp.

◆ forceField_

ForceField* OpenMD::ForceManager::forceField_ {nullptr}
protected

Definition at line 113 of file ForceManager.hpp.

◆ forceModifiers_

std::vector<ForceModifier*> OpenMD::ForceManager::forceModifiers_
protected

Definition at line 140 of file ForceManager.hpp.

◆ idat

InteractionData OpenMD::ForceManager::idat
protected

Definition at line 148 of file ForceManager.hpp.

◆ info_

SimInfo* OpenMD::ForceManager::info_ {nullptr}
protected

Definition at line 112 of file ForceManager.hpp.

◆ initialized_

bool OpenMD::ForceManager::initialized_ {false}
protected

Definition at line 90 of file ForceManager.hpp.

◆ interactionMan_

InteractionManager* OpenMD::ForceManager::interactionMan_ {nullptr}
protected

Definition at line 114 of file ForceManager.hpp.

◆ interactions_

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

Definition at line 127 of file ForceManager.hpp.

◆ inversionDataSets

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

Definition at line 130 of file ForceManager.hpp.

◆ neighborList_

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

Definition at line 131 of file ForceManager.hpp.

◆ point_

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

Definition at line 132 of file ForceManager.hpp.

◆ rCut_

RealType OpenMD::ForceManager::rCut_
protected

cutoff radius for non-bonded interactions

Definition at line 120 of file ForceManager.hpp.

Referenced by setupCutoffs().

◆ rCutSq_

RealType OpenMD::ForceManager::rCutSq_
protected

Definition at line 121 of file ForceManager.hpp.

◆ rSwitch_

RealType OpenMD::ForceManager::rSwitch_
protected

inner radius of switching function

Definition at line 122 of file ForceManager.hpp.

Referenced by setupCutoffs().

◆ savedPositions_

std::vector<Vector3d> OpenMD::ForceManager::savedPositions_
protected

Definition at line 133 of file ForceManager.hpp.

◆ sdat

SelfData OpenMD::ForceManager::sdat
protected

Definition at line 149 of file ForceManager.hpp.

◆ selectionScript_

std::string OpenMD::ForceManager::selectionScript_
protected

Definition at line 143 of file ForceManager.hpp.

◆ seleMan_

SelectionManager OpenMD::ForceManager::seleMan_
protected

Definition at line 144 of file ForceManager.hpp.

◆ sft_

SwitchingFunctionType OpenMD::ForceManager::sft_
protected

Type of switching function in use.

Definition at line 119 of file ForceManager.hpp.

Referenced by setupCutoffs().

◆ switcher_

SwitchingFunction* OpenMD::ForceManager::switcher_ {nullptr}
protected

Definition at line 116 of file ForceManager.hpp.

◆ thermo

Thermo* OpenMD::ForceManager::thermo {nullptr}
protected

Definition at line 117 of file ForceManager.hpp.

◆ torsionDataSets

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

Definition at line 129 of file ForceManager.hpp.

◆ usePeriodicBoundaryConditions_

bool OpenMD::ForceManager::usePeriodicBoundaryConditions_ {false}
protected

Definition at line 96 of file ForceManager.hpp.

◆ useSlabGeometry_

bool OpenMD::ForceManager::useSlabGeometry_ {false}
protected

Definition at line 98 of file ForceManager.hpp.

◆ useSurfaceTerm_

bool OpenMD::ForceManager::useSurfaceTerm_ {false}
protected

Definition at line 97 of file ForceManager.hpp.

◆ vdwScale_

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

Definition at line 135 of file ForceManager.hpp.

◆ virialTensor

Mat3x3d OpenMD::ForceManager::virialTensor
protected

Definition at line 138 of file ForceManager.hpp.


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