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

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

T * box
 
T * c
 
std::map< std::string, T * > extraCV
 
std::map< std::string, T * > extraCVForce
 
T * fx
 
T * fy
 
T * fz
 
T * m
 
T * px
 
T * py
 
T * pz
 
scaleb
 
scalec
 
scalef
 
scalem
 
scalep
 
scalev
 
int stride
 
T * 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

Constructor & Destructor Documentation

◆ MDAtomsTyped()

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

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 &  ,
void *   
) const
inlinevirtual

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

Implements PLMD::MDAtomsBase.

◆ getBox()

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

Retrieve box as a plumed Tensor.

Implements PLMD::MDAtomsBase.

◆ getCharges()

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

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)
inlinevirtual

Retrieve the value of an extra CV.

Implements PLMD::MDAtomsBase.

◆ getLocalPositions()

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

Retrieve local positions.

Implements PLMD::MDAtomsBase.

◆ getMasses()

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

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
inlinevirtual

Implements PLMD::MDAtomsBase.

◆ getPositions() [1/3]

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

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() [2/3]

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

Retrieve all atom positions from atom indices and local indices.

Implements PLMD::MDAtomsBase.

◆ getPositions() [3/3]

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

Retrieve all atom positions from index i to index j.

Implements PLMD::MDAtomsBase.

◆ getRealPrecision()

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

Get the size of MD-real.

Implements PLMD::MDAtomsBase.

◆ MD2double()

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

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

Implements PLMD::MDAtomsBase.

◆ rescaleForces()

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

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 ( void *  )
virtual

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

Implements PLMD::MDAtomsBase.

◆ setc()

template<class T >
void PLMD::MDAtomsTyped< T >::setc ( void *  m)
virtual

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,
void *  p 
)
inlinevirtual

Set a pointer to an extra CV.

Implements PLMD::MDAtomsBase.

◆ setExtraCVForce()

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

Set a pointer to an extra CV force.

Implements PLMD::MDAtomsBase.

◆ setf() [1/2]

template<class T >
void PLMD::MDAtomsTyped< T >::setf ( void *  f)
virtual

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 ( void *  f,
int  i 
)
virtual

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

Implements PLMD::MDAtomsBase.

◆ setm()

template<class T >
void PLMD::MDAtomsTyped< T >::setm ( void *  m)
virtual

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 ( void *  p)
virtual

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 ( void *  p,
int  i 
)
virtual

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 
)
virtual

Set internal and MD units.

Implements PLMD::MDAtomsBase.

◆ setVirial()

template<class T >
void PLMD::MDAtomsTyped< T >::setVirial ( void *  )
virtual

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 
)
inlinevirtual

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 vector< int > &  index,
const vector< Vector > &  f 
)
virtual

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.

◆ updateForces() [2/2]

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

Increment the force on selected atoms.

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

Implements PLMD::MDAtomsBase.

◆ updateVirial()

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

Increment the virial by an amount v.

Implements PLMD::MDAtomsBase.

Member Data Documentation

◆ box

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

◆ c

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

◆ extraCV

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

◆ extraCVForce

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

◆ fx

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

◆ fy

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

◆ fz

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

◆ m

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

◆ px

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

◆ py

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

◆ pz

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

◆ scaleb

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

◆ scalec

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

◆ scalef

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

◆ scalem

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

◆ scalep

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

◆ scalev

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

◆ stride

template<class T >
int PLMD::MDAtomsTyped< T >::stride
private

◆ virial

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

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