OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
OpenMD::ForceField Class Reference

Public Types

using AtomTypeContainer = TypeContainer<AtomType, 1>
 
using BondTypeContainer = TypeContainer<BondType, 2>
 
using BendTypeContainer = TypeContainer<BendType, 3>
 
using TorsionTypeContainer = TypeContainer<TorsionType, 4>
 
using InversionTypeContainer = TypeContainer<InversionType, 4>
 
using NonBondedInteractionTypeContainer
 

Public Member Functions

 ForceField (std::string ffName)
 
std::string getForceFieldFileName ()
 
void setForceFieldFileName (const std::string &filename)
 
virtual void parse (const std::string &filename)
 
AtomTypegetAtomType (const std::string &at)
 getAtomType by string
 
AtomTypegetAtomType (int ident)
 getAtomType by ident
 
BondTypegetBondType (const std::string &at1, const std::string &at2)
 
BendTypegetBendType (const std::string &at1, const std::string &at2, const std::string &at3)
 
TorsionTypegetTorsionType (const std::string &at1, const std::string &at2, const std::string &at3, const std::string &at4)
 
InversionTypegetInversionType (const std::string &at1, const std::string &at2, const std::string &at3, const std::string &at4)
 
NonBondedInteractionTypegetNonBondedInteractionType (const std::string &at1, const std::string &at2)
 
BondTypegetExactBondType (const std::string &at1, const std::string &at2)
 
BendTypegetExactBendType (const std::string &at1, const std::string &at2, const std::string &at3)
 
TorsionTypegetExactTorsionType (const std::string &at1, const std::string &at2, const std::string &at3, const std::string &at4)
 
InversionTypegetExactInversionType (const std::string &at1, const std::string &at2, const std::string &at3, const std::string &at4)
 
NonBondedInteractionTypegetExactNonBondedInteractionType (const std::string &at1, const std::string &at2)
 
virtual RealType getRcutFromAtomType (AtomType *at)
 
std::string getWildCard ()
 
void setWildCard (const std::string &wildCard)
 
size_t getNAtomType ()
 
AtomTypeContainergetAtomTypes ()
 
NonBondedInteractionTypeContainergetNonBondedInteractionTypes ()
 
bool addAtomType (const std::string &at, AtomType *atomType)
 
bool replaceAtomType (const std::string &at, AtomType *atomType)
 
bool addBondType (const std::string &at1, const std::string &at2, BondType *bondType)
 
bool addBendType (const std::string &at1, const std::string &at2, const std::string &at3, BendType *bendType)
 
bool addTorsionType (const std::string &at1, const std::string &at2, const std::string &at3, const std::string &at4, TorsionType *torsionType)
 
bool addInversionType (const std::string &at1, const std::string &at2, const std::string &at3, const std::string &at4, InversionType *inversionType)
 
bool addNonBondedInteractionType (const std::string &at1, const std::string &at2, NonBondedInteractionType *nbiType)
 
ifstrstreamopenForceFieldFile (const std::string &filename)
 
ForceFieldOptionsgetForceFieldOptions ()
 

Protected Attributes

AtomTypeContainer atomTypeCont_
 
BondTypeContainer bondTypeCont_
 
BendTypeContainer bendTypeCont_
 
TorsionTypeContainer torsionTypeCont_
 
InversionTypeContainer inversionTypeCont_
 
NonBondedInteractionTypeContainer nonBondedInteractionTypeCont_
 
ForceFieldOptions forceFieldOptions_
 
std::map< int, std::string > atypeIdentToName
 
SectionParserManager spMan_
 

Detailed Description

Definition at line 74 of file ForceField.hpp.

Member Typedef Documentation

◆ AtomTypeContainer

◆ BendTypeContainer

◆ BondTypeContainer

◆ InversionTypeContainer

◆ NonBondedInteractionTypeContainer

Initial value:
TypeContainer<NonBondedInteractionType, 2>

Definition at line 81 of file ForceField.hpp.

◆ TorsionTypeContainer

Constructor & Destructor Documentation

◆ ForceField()

OpenMD::ForceField::ForceField ( std::string ffName)

The order of adding section parsers is important.

OptionSectionParser must come first to set options for other parsers

DirectionalAtomTypesSectionParser should be added before AtomTypesSectionParser, and these two section parsers will actually create "real" AtomTypes (AtomTypesSectionParser will create AtomType and DirectionalAtomTypesSectionParser will create DirectionalAtomType, which is a subclass of AtomType and should come first).

Other AtomTypes Section Parsers will not create the "real" AtomType, they only add and set some attributes of the AtomType (via the Adapters). Thus ordering of these is not important. AtomTypesSectionParser should be added before other atom type

The order of BondTypesSectionParser, BendTypesSectionParser and TorsionTypesSectionParser, etc. are not important.

Definition at line 87 of file ForceField.cpp.

Member Function Documentation

◆ addAtomType()

bool OpenMD::ForceField::addAtomType ( const std::string & at,
AtomType * atomType )

Definition at line 667 of file ForceField.cpp.

◆ addBendType()

bool OpenMD::ForceField::addBendType ( const std::string & at1,
const std::string & at2,
const std::string & at3,
BendType * bendType )

Definition at line 689 of file ForceField.cpp.

◆ addBondType()

bool OpenMD::ForceField::addBondType ( const std::string & at1,
const std::string & at2,
BondType * bondType )

Definition at line 681 of file ForceField.cpp.

◆ addInversionType()

bool OpenMD::ForceField::addInversionType ( const std::string & at1,
const std::string & at2,
const std::string & at3,
const std::string & at4,
InversionType * inversionType )

Definition at line 711 of file ForceField.cpp.

◆ addNonBondedInteractionType()

bool OpenMD::ForceField::addNonBondedInteractionType ( const std::string & at1,
const std::string & at2,
NonBondedInteractionType * nbiType )

Definition at line 724 of file ForceField.cpp.

◆ addTorsionType()

bool OpenMD::ForceField::addTorsionType ( const std::string & at1,
const std::string & at2,
const std::string & at3,
const std::string & at4,
TorsionType * torsionType )

Definition at line 698 of file ForceField.cpp.

◆ getAtomType() [1/2]

AtomType * OpenMD::ForceField::getAtomType ( const std::string & at)

getAtomType by string

finds the requested atom type in this force field using the string name of the atom type.

Definition at line 183 of file ForceField.cpp.

References OpenMD::TypeContainer< ElemType, SIZE >::find().

Referenced by OpenMD::ForceMatrixDecomposition::distributeInitialData(), getAtomType(), OpenMD::SelectionManager::getSelectedAtomTypes(), and OpenMD::SimInfo::getSimulatedAtomTypes().

◆ getAtomType() [2/2]

AtomType * OpenMD::ForceField::getAtomType ( int ident)

getAtomType by ident

finds the requested atom type in this force field using the integer ident instead of the string name of the atom type.

Definition at line 195 of file ForceField.cpp.

References getAtomType().

◆ getAtomTypes()

AtomTypeContainer * OpenMD::ForceField::getAtomTypes ( )
inline

Definition at line 137 of file ForceField.hpp.

◆ getBendType()

BendType * OpenMD::ForceField::getBendType ( const std::string & at1,
const std::string & at2,
const std::string & at3 )

Definition at line 268 of file ForceField.cpp.

◆ getBondType()

BondType * OpenMD::ForceField::getBondType ( const std::string & at1,
const std::string & at2 )

Definition at line 200 of file ForceField.cpp.

◆ getExactBendType()

BendType * OpenMD::ForceField::getExactBendType ( const std::string & at1,
const std::string & at2,
const std::string & at3 )

Definition at line 625 of file ForceField.cpp.

◆ getExactBondType()

BondType * OpenMD::ForceField::getExactBondType ( const std::string & at1,
const std::string & at2 )

Definition at line 617 of file ForceField.cpp.

◆ getExactInversionType()

InversionType * OpenMD::ForceField::getExactInversionType ( const std::string & at1,
const std::string & at2,
const std::string & at3,
const std::string & at4 )

Definition at line 647 of file ForceField.cpp.

◆ getExactNonBondedInteractionType()

NonBondedInteractionType * OpenMD::ForceField::getExactNonBondedInteractionType ( const std::string & at1,
const std::string & at2 )

Definition at line 659 of file ForceField.cpp.

◆ getExactTorsionType()

TorsionType * OpenMD::ForceField::getExactTorsionType ( const std::string & at1,
const std::string & at2,
const std::string & at3,
const std::string & at4 )

Definition at line 635 of file ForceField.cpp.

◆ getForceFieldFileName()

std::string OpenMD::ForceField::getForceFieldFileName ( )
inline

Definition at line 88 of file ForceField.hpp.

◆ getForceFieldOptions()

ForceFieldOptions & OpenMD::ForceField::getForceFieldOptions ( )
inline

Definition at line 167 of file ForceField.hpp.

◆ getInversionType()

InversionType * OpenMD::ForceField::getInversionType ( const std::string & at1,
const std::string & at2,
const std::string & at3,
const std::string & at4 )

Definition at line 446 of file ForceField.cpp.

◆ getNAtomType()

size_t OpenMD::ForceField::getNAtomType ( )
inline

Definition at line 135 of file ForceField.hpp.

◆ getNonBondedInteractionType()

NonBondedInteractionType * OpenMD::ForceField::getNonBondedInteractionType ( const std::string & at1,
const std::string & at2 )

Definition at line 548 of file ForceField.cpp.

◆ getNonBondedInteractionTypes()

NonBondedInteractionTypeContainer * OpenMD::ForceField::getNonBondedInteractionTypes ( )
inline

Definition at line 139 of file ForceField.hpp.

◆ getRcutFromAtomType()

RealType OpenMD::ForceField::getRcutFromAtomType ( AtomType * at)
virtual

Definition at line 733 of file ForceField.cpp.

◆ getTorsionType()

TorsionType * OpenMD::ForceField::getTorsionType ( const std::string & at1,
const std::string & at2,
const std::string & at3,
const std::string & at4 )

Definition at line 348 of file ForceField.cpp.

◆ getWildCard()

std::string OpenMD::ForceField::getWildCard ( )
inline

Definition at line 129 of file ForceField.hpp.

◆ openForceFieldFile()

ifstrstream * OpenMD::ForceField::openForceFieldFile ( const std::string & filename)

Definition at line 764 of file ForceField.cpp.

◆ parse()

void OpenMD::ForceField::parse ( const std::string & filename)
virtual

Definition at line 151 of file ForceField.cpp.

◆ replaceAtomType()

bool OpenMD::ForceField::replaceAtomType ( const std::string & at,
AtomType * atomType )

Definition at line 674 of file ForceField.cpp.

◆ setForceFieldFileName()

void OpenMD::ForceField::setForceFieldFileName ( const std::string & filename)
inline

Definition at line 90 of file ForceField.hpp.

◆ setWildCard()

void OpenMD::ForceField::setWildCard ( const std::string & wildCard)
inline

Definition at line 131 of file ForceField.hpp.

Member Data Documentation

◆ atomTypeCont_

AtomTypeContainer OpenMD::ForceField::atomTypeCont_
protected

Definition at line 170 of file ForceField.hpp.

◆ atypeIdentToName

std::map<int, std::string> OpenMD::ForceField::atypeIdentToName
protected

Definition at line 177 of file ForceField.hpp.

◆ bendTypeCont_

BendTypeContainer OpenMD::ForceField::bendTypeCont_
protected

Definition at line 172 of file ForceField.hpp.

◆ bondTypeCont_

BondTypeContainer OpenMD::ForceField::bondTypeCont_
protected

Definition at line 171 of file ForceField.hpp.

◆ forceFieldOptions_

ForceFieldOptions OpenMD::ForceField::forceFieldOptions_
protected

Definition at line 176 of file ForceField.hpp.

◆ inversionTypeCont_

InversionTypeContainer OpenMD::ForceField::inversionTypeCont_
protected

Definition at line 174 of file ForceField.hpp.

◆ nonBondedInteractionTypeCont_

NonBondedInteractionTypeContainer OpenMD::ForceField::nonBondedInteractionTypeCont_
protected

Definition at line 175 of file ForceField.hpp.

◆ spMan_

SectionParserManager OpenMD::ForceField::spMan_
protected

Definition at line 178 of file ForceField.hpp.

◆ torsionTypeCont_

TorsionTypeContainer OpenMD::ForceField::torsionTypeCont_
protected

Definition at line 173 of file ForceField.hpp.


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