Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
PLMD::MDAtomsTyped< T > Class Template Reference

Class containing the pointers to the MD data It is templated so that single and double precision versions coexist IT IS STILL UNDOCUMENTED. More...

Inheritance diagram for PLMD::MDAtomsTyped< T >:
Inheritance graph
[legend]

Public Member Functions

void double2MD (const double &d, const TypesafePtr &m) const override
 Convert a double to a pointer to an MD-real. More...
 
void getBox (Tensor &) const override
 Retrieve box as a plumed Tensor. More...
 
void getCharges (const std::vector< int > &index, std::vector< double > &) const override
 Retrieve selected charges. More...
 
double getExtraCV (const std::string &name) override
 Retrieve the value of an extra CV. More...
 
void getLocalPositions (std::vector< Vector > &p) const override
 Retrieve local positions. More...
 
void getMasses (const std::vector< int > &index, std::vector< double > &) const override
 Retrieve selected masses. More...
 
Vector getMDforces (const unsigned index) const override
 
void getPositions (const std::set< AtomNumber > &index, const std::vector< unsigned > &i, std::vector< Vector > &positions) const override
 Retrieve all atom positions from atom indices and local indices. More...
 
void getPositions (const std::vector< int > &index, std::vector< Vector > &positions) const override
 Retrieve selected positions. More...
 
void getPositions (unsigned j, unsigned k, std::vector< Vector > &positions) const override
 Retrieve all atom positions from index i to index j. More...
 
unsigned getRealPrecision () const override
 Get the size of MD-real. More...
 
void MD2double (const TypesafePtr &m, double &d) const override
 Convert a pointer to an MD-real to a double. More...
 
void rescaleForces (const std::vector< int > &index, double factor) override
 Rescale all the forces, including the virial. More...
 
void setBox (const TypesafePtr &) override
 Set a pointer to the box array (3x3) in the MD code. More...
 
void setc (const TypesafePtr &m) override
 Set a pointer to the charge array in the MD code. More...
 
void setExtraCV (const std::string &name, const TypesafePtr &p) override
 Set a pointer to an extra CV. More...
 
void setExtraCVForce (const std::string &name, const TypesafePtr &p) override
 Set a pointer to an extra CV force. More...
 
void setf (const TypesafePtr &f) override
 Set a pointer to the forces array in the MD code. More...
 
void setf (const TypesafePtr &f, int i) override
 Set a pointer to the force array in the MD code. More...
 
void setm (const TypesafePtr &m) override
 Set a pointer to the mass array in the MD code. More...
 
void setp (const TypesafePtr &p) override
 Set a pointer to the positions array in the MD code. More...
 
void setp (const TypesafePtr &p, int i) override
 Set a pointer to the position array in the MD code. More...
 
void setUnits (const Units &, const Units &) override
 Set internal and MD units. More...
 
void setVirial (const TypesafePtr &) override
 Set a pointer to the virial array (3x3) in the MD code. More...
 
void updateExtraCVForce (const std::string &name, double f) override
 Update the value of an extra CV force. More...
 
void updateForces (const std::set< AtomNumber > &index, const std::vector< unsigned > &i, const std::vector< Vector > &forces) override
 Increment the force on selected atoms. More...
 
void updateForces (const std::vector< int > &index, const std::vector< Vector > &) override
 Increment the force on selected atoms. More...
 
void updateVirial (const Tensor &) const override
 Increment the virial by an amount v. More...
 

Static Public Member Functions

static std::unique_ptr< MDAtomsBasecreate (unsigned n)
 Creates an MDAtomsTyped<T> object such that sizeof(T)==n. More...
 

Private Attributes

TypesafePtr box
 
TypesafePtr c
 
std::map< std::string, TypesafePtrextraCV
 
std::map< std::string, TypesafePtrextraCVForce
 
TypesafePtr f
 
TypesafePtr fx
 
TypesafePtr fy
 
TypesafePtr fz
 
TypesafePtr m
 
TypesafePtr p
 
TypesafePtr px
 
TypesafePtr py
 
TypesafePtr pz
 
scaleb =1.0
 
scalec =1.0
 
scalef =1.0
 
scalem =1.0
 
scalep =1.0
 
scalev =1.0
 
TypesafePtr virial
 

Detailed Description

template<class T>
class PLMD::MDAtomsTyped< T >

Class containing the pointers to the MD data It is templated so that single and double precision versions coexist IT IS STILL UNDOCUMENTED.

IT PROBABLY NEEDS A STRONG CLEANUP

Member Function Documentation

◆ create()

std::unique_ptr< MDAtomsBase > PLMD::MDAtomsBase::create ( unsigned  n)
staticinherited

Creates an MDAtomsTyped<T> object such that sizeof(T)==n.

◆ double2MD()

template<class T >
void PLMD::MDAtomsTyped< T >::double2MD ( const double &  ,
const TypesafePtr  
) const
inlineoverridevirtual

Convert a double to a pointer to an MD-real.

Implements PLMD::MDAtomsBase.

◆ getBox()

template<class T >
void PLMD::MDAtomsTyped< T >::getBox ( Tensor ) const
overridevirtual

Retrieve box as a plumed Tensor.

Implements PLMD::MDAtomsBase.

◆ getCharges()

template<class T >
void PLMD::MDAtomsTyped< T >::getCharges ( const std::vector< int > &  index,
std::vector< double > &  c 
) const
overridevirtual

Retrieve selected charges.

The operation is done in such a way that c[index[i]] is equal to the charge of atom i

Implements PLMD::MDAtomsBase.

◆ getExtraCV()

template<class T >
double PLMD::MDAtomsTyped< T >::getExtraCV ( const std::string &  name)
inlineoverridevirtual

Retrieve the value of an extra CV.

Implements PLMD::MDAtomsBase.

◆ getLocalPositions()

template<class T >
void PLMD::MDAtomsTyped< T >::getLocalPositions ( std::vector< Vector > &  p) const
overridevirtual

Retrieve local positions.

Implements PLMD::MDAtomsBase.

◆ getMasses()

template<class T >
void PLMD::MDAtomsTyped< T >::getMasses ( const std::vector< int > &  index,
std::vector< double > &  m 
) const
overridevirtual

Retrieve selected masses.

The operation is done in such a way that m[index[i]] is equal to the mass of atom i

Implements PLMD::MDAtomsBase.

◆ getMDforces()

template<class T >
Vector PLMD::MDAtomsTyped< T >::getMDforces ( const unsigned  index) const
inlineoverridevirtual

Implements PLMD::MDAtomsBase.

◆ getPositions() [1/3]

template<class T >
void PLMD::MDAtomsTyped< T >::getPositions ( const std::set< AtomNumber > &  index,
const std::vector< unsigned > &  i,
std::vector< Vector > &  p 
) const
overridevirtual

Retrieve all atom positions from atom indices and local indices.

Implements PLMD::MDAtomsBase.

◆ getPositions() [2/3]

template<class T >
void PLMD::MDAtomsTyped< T >::getPositions ( const std::vector< int > &  index,
std::vector< Vector > &  p 
) const
overridevirtual

Retrieve selected positions.

The operation is done in such a way that p[index[i]] is equal to the coordinates of atom i

Implements PLMD::MDAtomsBase.

◆ getPositions() [3/3]

template<class T >
void PLMD::MDAtomsTyped< T >::getPositions ( unsigned  i,
unsigned  j,
std::vector< Vector > &  p 
) const
overridevirtual

Retrieve all atom positions from index i to index j.

Implements PLMD::MDAtomsBase.

◆ getRealPrecision()

template<class T >
unsigned PLMD::MDAtomsTyped< T >::getRealPrecision ( ) const
overridevirtual

Get the size of MD-real.

Implements PLMD::MDAtomsBase.

◆ MD2double()

template<class T >
void PLMD::MDAtomsTyped< T >::MD2double ( const TypesafePtr ,
double &   
) const
inlineoverridevirtual

Convert a pointer to an MD-real to a double.

Implements PLMD::MDAtomsBase.

◆ rescaleForces()

template<class T >
void PLMD::MDAtomsTyped< T >::rescaleForces ( const std::vector< int > &  index,
double  factor 
)
overridevirtual

Rescale all the forces, including the virial.

It is applied to all atoms with local index going from 0 to index.size()-1

Implements PLMD::MDAtomsBase.

◆ setBox()

template<class T >
void PLMD::MDAtomsTyped< T >::setBox ( const TypesafePtr )
overridevirtual

Set a pointer to the box array (3x3) in the MD code.

Implements PLMD::MDAtomsBase.

◆ setc()

template<class T >
void PLMD::MDAtomsTyped< T >::setc ( const TypesafePtr m)
overridevirtual

Set a pointer to the charge array in the MD code.

Implements PLMD::MDAtomsBase.

◆ setExtraCV()

template<class T >
void PLMD::MDAtomsTyped< T >::setExtraCV ( const std::string &  name,
const TypesafePtr p 
)
inlineoverridevirtual

Set a pointer to an extra CV.

Implements PLMD::MDAtomsBase.

◆ setExtraCVForce()

template<class T >
void PLMD::MDAtomsTyped< T >::setExtraCVForce ( const std::string &  name,
const TypesafePtr p 
)
inlineoverridevirtual

Set a pointer to an extra CV force.

Implements PLMD::MDAtomsBase.

◆ setf() [1/2]

template<class T >
void PLMD::MDAtomsTyped< T >::setf ( const TypesafePtr f)
overridevirtual

Set a pointer to the forces array in the MD code.

Implements PLMD::MDAtomsBase.

◆ setf() [2/2]

template<class T >
void PLMD::MDAtomsTyped< T >::setf ( const TypesafePtr f,
int  i 
)
overridevirtual

Set a pointer to the force array in the MD code.

Implements PLMD::MDAtomsBase.

◆ setm()

template<class T >
void PLMD::MDAtomsTyped< T >::setm ( const TypesafePtr m)
overridevirtual

Set a pointer to the mass array in the MD code.

Implements PLMD::MDAtomsBase.

◆ setp() [1/2]

template<class T >
void PLMD::MDAtomsTyped< T >::setp ( const TypesafePtr p)
overridevirtual

Set a pointer to the positions array in the MD code.

Implements PLMD::MDAtomsBase.

◆ setp() [2/2]

template<class T >
void PLMD::MDAtomsTyped< T >::setp ( const TypesafePtr p,
int  i 
)
overridevirtual

Set a pointer to the position array in the MD code.

Implements PLMD::MDAtomsBase.

◆ setUnits()

template<class T >
void PLMD::MDAtomsTyped< T >::setUnits ( const Units units,
const Units MDUnits 
)
overridevirtual

Set internal and MD units.

Implements PLMD::MDAtomsBase.

◆ setVirial()

template<class T >
void PLMD::MDAtomsTyped< T >::setVirial ( const TypesafePtr )
overridevirtual

Set a pointer to the virial array (3x3) in the MD code.

Implements PLMD::MDAtomsBase.

◆ updateExtraCVForce()

template<class T >
void PLMD::MDAtomsTyped< T >::updateExtraCVForce ( const std::string &  name,
double  f 
)
inlineoverridevirtual

Update the value of an extra CV force.

Todo:
check if this should also be scaled when acting on total energy

Implements PLMD::MDAtomsBase.

◆ updateForces() [1/2]

template<class T >
void PLMD::MDAtomsTyped< T >::updateForces ( const std::set< AtomNumber > &  index,
const std::vector< unsigned > &  i,
const std::vector< Vector > &  forces 
)
overridevirtual

Increment the force on selected atoms.

The operation is done only for local atoms used in an action

Implements PLMD::MDAtomsBase.

◆ updateForces() [2/2]

template<class T >
void PLMD::MDAtomsTyped< T >::updateForces ( const std::vector< int > &  index,
const std::vector< Vector > &  f 
)
overridevirtual

Increment the force on selected atoms.

The operation is done in such a way that f[index[i]] is added to the force on atom i

Implements PLMD::MDAtomsBase.

◆ updateVirial()

template<class T >
void PLMD::MDAtomsTyped< T >::updateVirial ( const Tensor v) const
overridevirtual

Increment the virial by an amount v.

Implements PLMD::MDAtomsBase.

Member Data Documentation

◆ box

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::box
private

◆ c

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::c
private

◆ extraCV

template<class T >
std::map<std::string,TypesafePtr> PLMD::MDAtomsTyped< T >::extraCV
private

◆ extraCVForce

template<class T >
std::map<std::string,TypesafePtr> PLMD::MDAtomsTyped< T >::extraCVForce
private

◆ f

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::f
private

◆ fx

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::fx
private

◆ fy

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::fy
private

◆ fz

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::fz
private

◆ m

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::m
private

◆ p

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::p
private

◆ px

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::px
private

◆ py

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::py
private

◆ pz

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::pz
private

◆ scaleb

template<class T >
T PLMD::MDAtomsTyped< T >::scaleb =1.0
private

◆ scalec

template<class T >
T PLMD::MDAtomsTyped< T >::scalec =1.0
private

◆ scalef

template<class T >
T PLMD::MDAtomsTyped< T >::scalef =1.0
private

◆ scalem

template<class T >
T PLMD::MDAtomsTyped< T >::scalem =1.0
private

◆ scalep

template<class T >
T PLMD::MDAtomsTyped< T >::scalep =1.0
private

◆ scalev

template<class T >
T PLMD::MDAtomsTyped< T >::scalev =1.0
private

◆ virial

template<class T >
TypesafePtr PLMD::MDAtomsTyped< T >::virial
private

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