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

#include <ForceField.hpp>

Public Types

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

Public Member Functions

 ForceField (std::string ffName)
 
virtual ~ForceField ()
 
std::string getForceFieldFileName ()
 
void setForceFieldFileName (const std::string &filename)
 
virtual void parse (const std::string &filename)
 
AtomTypegetAtomType (const std::string &at)
 
AtomTypegetAtomType (int 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)
 
unsigned int 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_
 

Private Attributes

std::string ffPath_
 
std::string wildCardAtomTypeName_
 
std::string forceFieldFileName_
 

Detailed Description

Definition at line 72 of file ForceField.hpp.

Member Typedef Documentation

◆ AtomTypeContainer

◆ BendTypeContainer

◆ BondTypeContainer

◆ InversionTypeContainer

◆ NonBondedInteractionTypeContainer

◆ 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 83 of file ForceField.cpp.

References ffPath_, forceFieldOptions_, OpenMD::SectionParserManager::push_back(), setForceFieldFileName(), and spMan_.

◆ ~ForceField()

virtual OpenMD::ForceField::~ForceField ( )
inlinevirtual

Definition at line 84 of file ForceField.hpp.

Member Function Documentation

◆ addAtomType()

◆ addBendType()

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

◆ addBondType()

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

◆ addInversionType()

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

◆ addNonBondedInteractionType()

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

◆ addTorsionType()

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

◆ 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 179 of file ForceField.cpp.

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

Referenced by OpenMD::LJ::addType(), OpenMD::GB::addType(), OpenMD::Sticky::addType(), OpenMD::SC::addType(), OpenMD::EAM::addType(), OpenMD::MoleculeCreator::createAtom(), OpenMD::ForceMatrixDecomposition::distributeInitialData(), OpenMD::MoLocator::getAtomMass(), getAtomType(), OpenMD::SimInfo::getSimulatedAtomTypes(), OpenMD::LJ::initialize(), OpenMD::RepulsivePower::initialize(), OpenMD::Morse::initialize(), OpenMD::Mie::initialize(), OpenMD::MAW::initialize(), OpenMD::Buckingham::initialize(), OpenMD::EAM::initialize(), OpenMD::DirectionalAtomTypesSectionParser::parseLine(), OpenMD::LennardJonesAtomTypesSectionParser::parseLine(), OpenMD::GayBerneAtomTypesSectionParser::parseLine(), OpenMD::ChargeAtomTypesSectionParser::parseLine(), OpenMD::StickyAtomTypesSectionParser::parseLine(), OpenMD::BaseAtomTypesSectionParser::parseLine(), OpenMD::AtomTypesSectionParser::parseLine(), OpenMD::MultipoleAtomTypesSectionParser::parseLine(), OpenMD::PolarizableAtomTypesSectionParser::parseLine(), OpenMD::StickyPowerAtomTypesSectionParser::parseLine(), OpenMD::EAMAtomTypesSectionParser::parseLine(), OpenMD::ShapeAtomTypesSectionParser::parseLine(), OpenMD::SCAtomTypesSectionParser::parseLine(), OpenMD::FluctuatingChargeAtomTypesSectionParser::parseLine(), setForceFieldFileName(), and OpenMD::AtomNameVisitor::visitAtom().

◆ 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 191 of file ForceField.cpp.

References atypeIdentToName, and getAtomType().

◆ getAtomTypes()

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

Definition at line 139 of file ForceField.hpp.

References atomTypeCont_.

Referenced by OpenMD::InteractionManager::initialize().

◆ getBendType()

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

◆ getBondType()

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

◆ getExactBendType()

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

◆ getExactBondType()

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

◆ getExactInversionType()

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

◆ getExactNonBondedInteractionType()

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

◆ getExactTorsionType()

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

◆ getForceFieldFileName()

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

Definition at line 86 of file ForceField.hpp.

References forceFieldFileName_.

Referenced by OpenMD::SimCreator::createSim().

◆ getForceFieldOptions()

◆ getInversionType()

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

◆ getNAtomType()

◆ getNonBondedInteractionType()

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

◆ getNonBondedInteractionTypes()

◆ getRcutFromAtomType()

◆ getTorsionType()

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

◆ getWildCard()

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

Definition at line 127 of file ForceField.hpp.

References wildCardAtomTypeName_.

◆ openForceFieldFile()

◆ parse()

◆ replaceAtomType()

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

◆ setForceFieldFileName()

◆ setWildCard()

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

Definition at line 131 of file ForceField.hpp.

References wildCardAtomTypeName_.

Member Data Documentation

◆ atomTypeCont_

◆ atypeIdentToName

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

Definition at line 182 of file ForceField.hpp.

Referenced by addAtomType(), getAtomType(), and replaceAtomType().

◆ bendTypeCont_

BendTypeContainer OpenMD::ForceField::bendTypeCont_
protected

Definition at line 177 of file ForceField.hpp.

Referenced by addBendType(), getBendType(), and getExactBendType().

◆ bondTypeCont_

BondTypeContainer OpenMD::ForceField::bondTypeCont_
protected

Definition at line 176 of file ForceField.hpp.

Referenced by addBondType(), getBondType(), and getExactBondType().

◆ ffPath_

std::string OpenMD::ForceField::ffPath_
private

Definition at line 187 of file ForceField.hpp.

Referenced by ForceField(), and openForceFieldFile().

◆ forceFieldFileName_

std::string OpenMD::ForceField::forceFieldFileName_
private

Definition at line 189 of file ForceField.hpp.

Referenced by getForceFieldFileName(), and setForceFieldFileName().

◆ forceFieldOptions_

ForceFieldOptions OpenMD::ForceField::forceFieldOptions_
protected

Definition at line 181 of file ForceField.hpp.

Referenced by ForceField(), and getForceFieldOptions().

◆ inversionTypeCont_

InversionTypeContainer OpenMD::ForceField::inversionTypeCont_
protected

Definition at line 179 of file ForceField.hpp.

Referenced by addInversionType(), getExactInversionType(), and getInversionType().

◆ nonBondedInteractionTypeCont_

NonBondedInteractionTypeContainer OpenMD::ForceField::nonBondedInteractionTypeCont_
protected

◆ spMan_

SectionParserManager OpenMD::ForceField::spMan_
protected

Definition at line 183 of file ForceField.hpp.

Referenced by ForceField(), and parse().

◆ torsionTypeCont_

TorsionTypeContainer OpenMD::ForceField::torsionTypeCont_
protected

Definition at line 178 of file ForceField.hpp.

Referenced by addTorsionType(), getExactTorsionType(), and getTorsionType().

◆ wildCardAtomTypeName_

std::string OpenMD::ForceField::wildCardAtomTypeName_
private

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