Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
PLMD::Atoms Class Reference

Class containing atom related quantities from the MD code. More...

#include <Atoms.h>

Classes

class  DomainDecomposition
 

Public Member Functions

 Atoms (PlumedMain &plumed)
 
 ~Atoms ()
 
void add (ActionAtomistic *)
 
AtomNumber addVirtualAtom (ActionWithVirtualAtom *)
 
bool boxWasSet () const
 
bool chargesWereSet () const
 
void clearFullList ()
 
void createFullList (int *)
 
void double2MD (const double &d, void *m) const
 
const long int & getDdStep () const
 
double getEnergy () const
 
double getExtraCV (const std::string &name)
 
void getFullList (int **)
 
const std::vector< int > & getGatindex () const
 
double getKBoltzmann () const
 
double getKbT () const
 
void getLocalForces (std::vector< Vector > &)
 
void getLocalMasses (std::vector< double > &)
 
void getLocalMDForces (std::vector< Vector > &)
 
void getLocalPositions (std::vector< Vector > &)
 
double getMDKBoltzmann () const
 
const UnitsgetMDUnits ()
 
int getNatoms () const
 
int getNVirtualAtoms () const
 
const PbcgetPbc () const
 
int getRealPrecision () const
 
double getTimeStep () const
 
const UnitsgetUnits ()
 
const TensorgetVirial () const
 
ActionWithVirtualAtomgetVirtualAtomsAction (AtomNumber) const
 
void init ()
 
void insertGroup (const std::string &name, const std::vector< AtomNumber > &a)
 
bool isEnergyNeeded () const
 
bool isVirtualAtom (AtomNumber) const
 
void MD2double (const void *m, double &d) const
 
void readBinary (std::istream &)
 
void remove (ActionAtomistic *)
 
void removeGroup (const std::string &name)
 
void removeVirtualAtom (ActionWithVirtualAtom *)
 
void setAtomsContiguous (int)
 
void setAtomsGatindex (int *, bool)
 
void setAtomsNlocal (int)
 
void setBox (void *)
 
void setCharges (void *)
 
void setCollectEnergy (bool b)
 
void setDomainDecomposition (Communicator &)
 
void setEnergy (void *)
 
void setExtraCV (const std::string &name, void *p)
 
void setExtraCVForce (const std::string &name, void *p)
 
void setForces (void *)
 
void setForces (void *, int)
 
void setKbT (void *)
 
void setMasses (void *)
 
void setMDChargeUnits (double d)
 
void setMDEnergyUnits (double d)
 
void setMDLengthUnits (double d)
 
void setMDMassUnits (double d)
 
void setMDNaturalUnits (bool n)
 
void setMDTimeUnits (double d)
 
void setNatoms (int)
 
void setNaturalUnits (bool n)
 
void setPositions (void *)
 
void setPositions (void *, int)
 
void setRealPrecision (int)
 
void setTimeStep (void *)
 
void setUnits (const Units &u)
 
void setVirial (void *)
 
void share ()
 
void shareAll ()
 
void startStep ()
 
void updateExtraCVForce (const std::string &name, double f)
 
void updateForces ()
 
void updateUnits ()
 
bool usingNaturalUnits () const
 
void wait ()
 
void writeBinary (std::ostream &) const
 

Private Member Functions

void resizeVectors (unsigned)
 
void share (const std::set< AtomNumber > &)
 

Private Attributes

std::vector< ActionAtomistic * > actions
 
bool asyncSent
 
bool atomsNeeded
 
Tensor box
 
bool boxHasBeenSet
 
std::vector< double > charges
 
bool chargesHaveBeenSet
 
bool collectEnergy
 
bool dataCanBeSet
 
DomainDecomposition dd
 
long int ddStep
 
double energy
 
bool energyHasBeenSet
 
double forceOnEnergy
 
std::vector< Vectorforces
 
unsigned forcesHaveBeenSet
 
std::vector< int > fullList
 
std::vector< int > g2l
 Map global indexes to local indexes E.g. More...
 
std::vector< int > gatindex
 
std::map< std::string, std::vector< AtomNumber > > groups
 
double kbT
 
bool massAndChargeOK
 
std::vector< double > masses
 
bool massesHaveBeenSet
 
double md_energy
 
std::unique_ptr< MDAtomsBasemdatoms
 
bool MDnaturalUnits
 
Units MDUnits
 
int natoms
 
bool naturalUnits
 
Pbcpbc =*pbc_fwd
 
ForwardDecl< Pbcpbc_fwd
 
PlumedMainplumed
 
std::vector< Vectorpositions
 
unsigned positionsHaveBeenSet
 
unsigned shuffledAtoms
 
double timestep
 
std::vector< unsigned > uniq_index
 
std::set< AtomNumberunique
 
Units units
 
Tensor virial
 
bool virialHasBeenSet
 
std::vector< ActionWithVirtualAtom * > virtualAtomsActions
 
bool zeroallforces
 if set to true, all the forces in the global array are zeroes at every step. More...
 

Friends

class ActionAtomistic
 
class ActionWithVirtualAtom
 

Detailed Description

Class containing atom related quantities from the MD code.

IT IS STILL UNDOCUMENTED. IT PROBABLY NEEDS A STRONG CLEANUP

Constructor & Destructor Documentation

◆ Atoms()

PLMD::Atoms::Atoms ( PlumedMain plumed)
explicit

◆ ~Atoms()

PLMD::Atoms::~Atoms ( )

Member Function Documentation

◆ add()

void PLMD::Atoms::add ( ActionAtomistic a)

◆ addVirtualAtom()

AtomNumber PLMD::Atoms::addVirtualAtom ( ActionWithVirtualAtom a)

◆ boxWasSet()

bool PLMD::Atoms::boxWasSet ( ) const
inline

◆ chargesWereSet()

bool PLMD::Atoms::chargesWereSet ( ) const
inline

◆ clearFullList()

void PLMD::Atoms::clearFullList ( )

◆ createFullList()

void PLMD::Atoms::createFullList ( int *  n)

◆ double2MD()

void PLMD::Atoms::double2MD ( const double &  d,
void *  m 
) const

◆ getDdStep()

const long int & PLMD::Atoms::getDdStep ( ) const
inline

◆ getEnergy()

double PLMD::Atoms::getEnergy ( ) const
inline

◆ getExtraCV()

double PLMD::Atoms::getExtraCV ( const std::string &  name)

◆ getFullList()

void PLMD::Atoms::getFullList ( int **  x)

◆ getGatindex()

const std::vector< int > & PLMD::Atoms::getGatindex ( ) const
inline

◆ getKBoltzmann()

double PLMD::Atoms::getKBoltzmann ( ) const

◆ getKbT()

double PLMD::Atoms::getKbT ( ) const

◆ getLocalForces()

void PLMD::Atoms::getLocalForces ( std::vector< Vector > &  localForces)

◆ getLocalMasses()

void PLMD::Atoms::getLocalMasses ( std::vector< double > &  localMasses)

◆ getLocalMDForces()

void PLMD::Atoms::getLocalMDForces ( std::vector< Vector > &  localForces)

◆ getLocalPositions()

void PLMD::Atoms::getLocalPositions ( std::vector< Vector > &  localPositions)

◆ getMDKBoltzmann()

double PLMD::Atoms::getMDKBoltzmann ( ) const

◆ getMDUnits()

const Units& PLMD::Atoms::getMDUnits ( )
inline

◆ getNatoms()

int PLMD::Atoms::getNatoms ( ) const
inline

◆ getNVirtualAtoms()

int PLMD::Atoms::getNVirtualAtoms ( ) const
inline

◆ getPbc()

const Pbc & PLMD::Atoms::getPbc ( ) const
inline

◆ getRealPrecision()

int PLMD::Atoms::getRealPrecision ( ) const

◆ getTimeStep()

double PLMD::Atoms::getTimeStep ( ) const

◆ getUnits()

const Units& PLMD::Atoms::getUnits ( )
inline

◆ getVirial()

const Tensor & PLMD::Atoms::getVirial ( ) const
inline

◆ getVirtualAtomsAction()

ActionWithVirtualAtom * PLMD::Atoms::getVirtualAtomsAction ( AtomNumber  i) const
inline

◆ init()

void PLMD::Atoms::init ( )

◆ insertGroup()

void PLMD::Atoms::insertGroup ( const std::string &  name,
const std::vector< AtomNumber > &  a 
)

◆ isEnergyNeeded()

bool PLMD::Atoms::isEnergyNeeded ( ) const
inline

◆ isVirtualAtom()

bool PLMD::Atoms::isVirtualAtom ( AtomNumber  i) const
inline

◆ MD2double()

void PLMD::Atoms::MD2double ( const void *  m,
double &  d 
) const

◆ readBinary()

void PLMD::Atoms::readBinary ( std::istream &  i)

◆ remove()

void PLMD::Atoms::remove ( ActionAtomistic a)

◆ removeGroup()

void PLMD::Atoms::removeGroup ( const std::string &  name)

◆ removeVirtualAtom()

void PLMD::Atoms::removeVirtualAtom ( ActionWithVirtualAtom a)

◆ resizeVectors()

void PLMD::Atoms::resizeVectors ( unsigned  n)
private

◆ setAtomsContiguous()

void PLMD::Atoms::setAtomsContiguous ( int  start)

◆ setAtomsGatindex()

void PLMD::Atoms::setAtomsGatindex ( int *  g,
bool  fortran 
)

◆ setAtomsNlocal()

void PLMD::Atoms::setAtomsNlocal ( int  n)

◆ setBox()

void PLMD::Atoms::setBox ( void *  p)

◆ setCharges()

void PLMD::Atoms::setCharges ( void *  p)

◆ setCollectEnergy()

void PLMD::Atoms::setCollectEnergy ( bool  b)
inline

◆ setDomainDecomposition()

void PLMD::Atoms::setDomainDecomposition ( Communicator comm)

◆ setEnergy()

void PLMD::Atoms::setEnergy ( void *  p)

◆ setExtraCV()

void PLMD::Atoms::setExtraCV ( const std::string &  name,
void *  p 
)

◆ setExtraCVForce()

void PLMD::Atoms::setExtraCVForce ( const std::string &  name,
void *  p 
)

◆ setForces() [1/2]

void PLMD::Atoms::setForces ( void *  p)

◆ setForces() [2/2]

void PLMD::Atoms::setForces ( void *  p,
int  i 
)

◆ setKbT()

void PLMD::Atoms::setKbT ( void *  p)

◆ setMasses()

void PLMD::Atoms::setMasses ( void *  p)

◆ setMDChargeUnits()

void PLMD::Atoms::setMDChargeUnits ( double  d)
inline

◆ setMDEnergyUnits()

void PLMD::Atoms::setMDEnergyUnits ( double  d)
inline

◆ setMDLengthUnits()

void PLMD::Atoms::setMDLengthUnits ( double  d)
inline

◆ setMDMassUnits()

void PLMD::Atoms::setMDMassUnits ( double  d)
inline

◆ setMDNaturalUnits()

void PLMD::Atoms::setMDNaturalUnits ( bool  n)
inline

◆ setMDTimeUnits()

void PLMD::Atoms::setMDTimeUnits ( double  d)
inline

◆ setNatoms()

void PLMD::Atoms::setNatoms ( int  n)

◆ setNaturalUnits()

void PLMD::Atoms::setNaturalUnits ( bool  n)
inline

◆ setPositions() [1/2]

void PLMD::Atoms::setPositions ( void *  p)

◆ setPositions() [2/2]

void PLMD::Atoms::setPositions ( void *  p,
int  i 
)

◆ setRealPrecision()

void PLMD::Atoms::setRealPrecision ( int  p)

◆ setTimeStep()

void PLMD::Atoms::setTimeStep ( void *  p)

◆ setUnits()

void PLMD::Atoms::setUnits ( const Units u)
inline

◆ setVirial()

void PLMD::Atoms::setVirial ( void *  p)

◆ share() [1/2]

void PLMD::Atoms::share ( const std::set< AtomNumber > &  unique)
private

◆ share() [2/2]

void PLMD::Atoms::share ( )

◆ shareAll()

void PLMD::Atoms::shareAll ( )

◆ startStep()

void PLMD::Atoms::startStep ( )

◆ updateExtraCVForce()

void PLMD::Atoms::updateExtraCVForce ( const std::string &  name,
double  f 
)

◆ updateForces()

void PLMD::Atoms::updateForces ( )

◆ updateUnits()

void PLMD::Atoms::updateUnits ( )

◆ usingNaturalUnits()

bool PLMD::Atoms::usingNaturalUnits ( ) const
inline

◆ wait()

void PLMD::Atoms::wait ( )

◆ writeBinary()

void PLMD::Atoms::writeBinary ( std::ostream &  o) const

Friends And Related Function Documentation

◆ ActionAtomistic

friend class ActionAtomistic
friend

◆ ActionWithVirtualAtom

friend class ActionWithVirtualAtom
friend

Member Data Documentation

◆ actions

std::vector<ActionAtomistic*> PLMD::Atoms::actions
private

◆ asyncSent

bool PLMD::Atoms::asyncSent
private

◆ atomsNeeded

bool PLMD::Atoms::atomsNeeded
private

◆ box

Tensor PLMD::Atoms::box
private

◆ boxHasBeenSet

bool PLMD::Atoms::boxHasBeenSet
private

◆ charges

std::vector<double> PLMD::Atoms::charges
private

◆ chargesHaveBeenSet

bool PLMD::Atoms::chargesHaveBeenSet
private

◆ collectEnergy

bool PLMD::Atoms::collectEnergy
private

◆ dataCanBeSet

bool PLMD::Atoms::dataCanBeSet
private

◆ dd

DomainDecomposition PLMD::Atoms::dd
private

◆ ddStep

long int PLMD::Atoms::ddStep
private

◆ energy

double PLMD::Atoms::energy
private

◆ energyHasBeenSet

bool PLMD::Atoms::energyHasBeenSet
private

◆ forceOnEnergy

double PLMD::Atoms::forceOnEnergy
private

◆ forces

std::vector<Vector> PLMD::Atoms::forces
private

◆ forcesHaveBeenSet

unsigned PLMD::Atoms::forcesHaveBeenSet
private

◆ fullList

std::vector<int> PLMD::Atoms::fullList
private

◆ g2l

std::vector<int> PLMD::Atoms::g2l
private

Map global indexes to local indexes E.g.

g2l[i] is the position of atom i in the array passed from the MD engine. Called "global to local" since originally it was used to map global indexes to local ones used in domain decomposition. However, it is now also used for the NAMD-like interface, where only a small number of atoms is passed to plumed.

◆ gatindex

std::vector<int> PLMD::Atoms::gatindex
private

◆ groups

std::map<std::string,std::vector<AtomNumber> > PLMD::Atoms::groups
private

◆ kbT

double PLMD::Atoms::kbT
private

◆ massAndChargeOK

bool PLMD::Atoms::massAndChargeOK
private

◆ masses

std::vector<double> PLMD::Atoms::masses
private

◆ massesHaveBeenSet

bool PLMD::Atoms::massesHaveBeenSet
private

◆ md_energy

double PLMD::Atoms::md_energy
private

◆ mdatoms

std::unique_ptr<MDAtomsBase> PLMD::Atoms::mdatoms
private

◆ MDnaturalUnits

bool PLMD::Atoms::MDnaturalUnits
private

◆ MDUnits

Units PLMD::Atoms::MDUnits
private

◆ natoms

int PLMD::Atoms::natoms
private

◆ naturalUnits

bool PLMD::Atoms::naturalUnits
private

◆ pbc

Pbc& PLMD::Atoms::pbc =*pbc_fwd
private

◆ pbc_fwd

ForwardDecl<Pbc> PLMD::Atoms::pbc_fwd
private

◆ plumed

PlumedMain& PLMD::Atoms::plumed
private

◆ positions

std::vector<Vector> PLMD::Atoms::positions
private

◆ positionsHaveBeenSet

unsigned PLMD::Atoms::positionsHaveBeenSet
private

◆ shuffledAtoms

unsigned PLMD::Atoms::shuffledAtoms
private

◆ timestep

double PLMD::Atoms::timestep
private

◆ uniq_index

std::vector<unsigned> PLMD::Atoms::uniq_index
private

◆ unique

std::set<AtomNumber> PLMD::Atoms::unique
private

◆ units

Units PLMD::Atoms::units
private

◆ virial

Tensor PLMD::Atoms::virial
private

◆ virialHasBeenSet

bool PLMD::Atoms::virialHasBeenSet
private

◆ virtualAtomsActions

std::vector<ActionWithVirtualAtom*> PLMD::Atoms::virtualAtomsActions
private

◆ zeroallforces

bool PLMD::Atoms::zeroallforces
private

if set to true, all the forces in the global array are zeroes at every step.

It should not be necessary in general, but it is for actions accessing to modifyGlobalForce() (e.g. FIT_TO_TEMPLATE).


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