OpenMD  2.5
Molecular Dynamics in the Open
OpenMD::ShortRangeInteraction Class Referenceabstract

A ShortRangeInteraction holds some bookeeping data for bonded interactions (e.g. Bonds, Bends, Torsions, Inversions). More...

#include <ShortRangeInteraction.hpp>

Inheritance diagram for OpenMD::ShortRangeInteraction:
OpenMD::Bend OpenMD::Bond OpenMD::Inversion OpenMD::Torsion OpenMD::GhostBend OpenMD::SDKBend OpenMD::UreyBradleyBend OpenMD::GhostTorsion

Public Member Functions

virtual ~ShortRangeInteraction ()
 
int getGlobalIndex ()
 
void setGlobalIndex (int index)
 
int getLocalIndex ()
 
void setLocalIndex (int index)
 
void setSnapshotManager (SnapshotManager *sman)
 
virtual std::string getName ()=0
 
virtual void setName (const std::string &name)
 
virtual void accept (BaseVisitor *v)=0
 
virtual RealType getPrevValue ()
 
virtual RealType getValue ()
 
virtual RealType getValue (int snapshotNo)=0
 
virtual std::vector< Atom * > getAtoms ()
 
void addProperty (GenericData *genData)
 
void removeProperty (const std::string &propName)
 
void clearProperties ()
 
std::vector< std::string > getPropertyNames ()
 
std::vector< GenericData * > getProperties ()
 
GenericDatagetPropertyByName (const std::string &propName)
 

Protected Member Functions

 ShortRangeInteraction ()
 
 ShortRangeInteraction (const ShortRangeInteraction &sri)
 
ShortRangeInteractionoperator= (const ShortRangeInteraction &sri)
 

Protected Attributes

SnapshotManagersnapshotMan_
 
std::vector< Atom * > atoms_
 
int globalIndex_
 
int localIndex_
 

Private Attributes

PropertyMap properties_
 

Detailed Description

A ShortRangeInteraction holds some bookeeping data for bonded interactions (e.g. Bonds, Bends, Torsions, Inversions).

Definition at line 63 of file ShortRangeInteraction.hpp.

Constructor & Destructor Documentation

◆ ~ShortRangeInteraction()

OpenMD::ShortRangeInteraction::~ShortRangeInteraction ( )
virtual

Definition at line 51 of file ShortRangeInteraction.cpp.

◆ ShortRangeInteraction() [1/2]

OpenMD::ShortRangeInteraction::ShortRangeInteraction ( )
protected

Definition at line 47 of file ShortRangeInteraction.cpp.

Referenced by getAtoms().

◆ ShortRangeInteraction() [2/2]

OpenMD::ShortRangeInteraction::ShortRangeInteraction ( const ShortRangeInteraction sri)
protected

Member Function Documentation

◆ accept()

virtual void OpenMD::ShortRangeInteraction::accept ( BaseVisitor v)
pure virtual

The purpose of the Visitor Pattern is to encapsulate an operation that you want to perform on the elements of a data structure. In this way, you can change the operation being performed on a structure without the need of changing the classes of the elements that you are operating on. Using a Visitor pattern allows you to decouple the classes for the data structure and the algorithms used upon them

Parameters
vvisitor

Implemented in OpenMD::Torsion, OpenMD::Inversion, OpenMD::Bend, and OpenMD::Bond.

Referenced by setName().

◆ addProperty()

void OpenMD::ShortRangeInteraction::addProperty ( GenericData genData)

Adds property into property map

Parameters
genDataGenericData to be added into PropertyMap

Definition at line 64 of file ShortRangeInteraction.cpp.

References OpenMD::PropertyMap::addProperty(), and properties_.

Referenced by getAtoms().

◆ clearProperties()

void OpenMD::ShortRangeInteraction::clearProperties ( )

clear all of the properties

Definition at line 72 of file ShortRangeInteraction.cpp.

References OpenMD::PropertyMap::clearProperties(), and properties_.

Referenced by getAtoms().

◆ getAtoms()

virtual std::vector<Atom*> OpenMD::ShortRangeInteraction::getAtoms ( )
inlinevirtual

◆ getGlobalIndex()

◆ getLocalIndex()

int OpenMD::ShortRangeInteraction::getLocalIndex ( )
inline

Returns the local index of this ShortRangeInteraction

Returns
the local index of this ShortRangeInteraction

Definition at line 88 of file ShortRangeInteraction.hpp.

References localIndex_.

◆ getName()

virtual std::string OpenMD::ShortRangeInteraction::getName ( )
pure virtual

Returns the name of this ShortRangeInteraction

Implemented in OpenMD::Torsion, OpenMD::Inversion, OpenMD::Bend, and OpenMD::Bond.

Referenced by setSnapshotManager().

◆ getPrevValue()

RealType OpenMD::ShortRangeInteraction::getPrevValue ( )
virtual

Returns the previous value of this ShortRangeInteraction

Returns
the value of this ShortRangeInteraction

Definition at line 59 of file ShortRangeInteraction.cpp.

References OpenMD::Snapshot::getID(), OpenMD::SnapshotManager::getPrevSnapshot(), getValue(), and snapshotMan_.

Referenced by setName().

◆ getProperties()

std::vector< GenericData * > OpenMD::ShortRangeInteraction::getProperties ( )

Returns all of the properties in PropertyMap

Returns
all of the properties in PropertyMap

Definition at line 80 of file ShortRangeInteraction.cpp.

References OpenMD::PropertyMap::getProperties(), and properties_.

Referenced by getAtoms().

◆ getPropertyByName()

GenericData * OpenMD::ShortRangeInteraction::getPropertyByName ( const std::string &  propName)

Returns property

Parameters
propNamename of property
Returns
a pointer point to property with propName. If no property named propName exists, return NULL

Definition at line 84 of file ShortRangeInteraction.cpp.

References OpenMD::PropertyMap::getPropertyByName(), and properties_.

Referenced by getAtoms().

◆ getPropertyNames()

std::vector< std::string > OpenMD::ShortRangeInteraction::getPropertyNames ( )

Returns all names of properties

Returns
all names of properties

Definition at line 76 of file ShortRangeInteraction.cpp.

References OpenMD::PropertyMap::getPropertyNames(), and properties_.

Referenced by getAtoms().

◆ getValue() [1/2]

RealType OpenMD::ShortRangeInteraction::getValue ( )
virtual

Returns the current value of this ShortRangeInteraction

Returns
the current value of this ShortRangeInteraction

Definition at line 54 of file ShortRangeInteraction.cpp.

References OpenMD::SnapshotManager::getCurrentSnapshot(), OpenMD::Snapshot::getID(), and snapshotMan_.

Referenced by getPrevValue(), and setName().

◆ getValue() [2/2]

virtual RealType OpenMD::ShortRangeInteraction::getValue ( int  snapshotNo)
pure virtual

Returns the value of this ShortRangeInteraction in specified snapshot

Returns
the value of this ShortRangeInteraction
Parameters
snapshotNo

Implemented in OpenMD::Bond, OpenMD::Bend, OpenMD::Torsion, and OpenMD::Inversion.

◆ operator=()

ShortRangeInteraction& OpenMD::ShortRangeInteraction::operator= ( const ShortRangeInteraction sri)
protected

Referenced by getAtoms().

◆ removeProperty()

void OpenMD::ShortRangeInteraction::removeProperty ( const std::string &  propName)

Removes property from PropertyMap by name

Parameters
propNamethe name of property to be removed

Definition at line 68 of file ShortRangeInteraction.cpp.

References properties_, and OpenMD::PropertyMap::removeProperty().

Referenced by getAtoms().

◆ setGlobalIndex()

void OpenMD::ShortRangeInteraction::setGlobalIndex ( int  index)
inline

Sets the global index of this ShortRangeInteraction.

Parameters
indexnew global index to be set

Definition at line 80 of file ShortRangeInteraction.hpp.

References globalIndex_.

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

◆ setLocalIndex()

void OpenMD::ShortRangeInteraction::setLocalIndex ( int  index)
inline

◆ setName()

virtual void OpenMD::ShortRangeInteraction::setName ( const std::string &  name)
inlinevirtual

Sets the name of this ShortRangeInteraction

Reimplemented in OpenMD::Torsion, OpenMD::Inversion, OpenMD::Bend, and OpenMD::Bond.

Definition at line 113 of file ShortRangeInteraction.hpp.

References accept(), getPrevValue(), and getValue().

◆ setSnapshotManager()

void OpenMD::ShortRangeInteraction::setSnapshotManager ( SnapshotManager sman)
inline

Sets the Snapshot Manager of this ShortRangeInteraction

Definition at line 104 of file ShortRangeInteraction.hpp.

References getName(), and snapshotMan_.

Referenced by OpenMD::SimInfo::setSnapshotManager().

Member Data Documentation

◆ atoms_

◆ globalIndex_

int OpenMD::ShortRangeInteraction::globalIndex_
protected

Definition at line 196 of file ShortRangeInteraction.hpp.

Referenced by getGlobalIndex(), and setGlobalIndex().

◆ localIndex_

int OpenMD::ShortRangeInteraction::localIndex_
protected

Definition at line 197 of file ShortRangeInteraction.hpp.

Referenced by getLocalIndex(), and setLocalIndex().

◆ properties_

PropertyMap OpenMD::ShortRangeInteraction::properties_
private

◆ snapshotMan_


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