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 setm (void *m)
 Set a pointer to the mass array in the MD code. More...
 
void setc (void *m)
 Set a pointer to the charge array in the MD code. More...
 
void setBox (void *)
 Set a pointer to the box array (3x3) in the MD code. More...
 
void setp (void *p)
 Set a pointer to the positions array in the MD code. More...
 
void setVirial (void *)
 Set a pointer to the virial array (3x3) in the MD code. More...
 
void setf (void *f)
 Set a pointer to the forces 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 setf (void *f, int i)
 Set a pointer to the force array in the MD code. More...
 
void setUnits (const Units &, const Units &)
 Set internal and MD units. More...
 
void MD2double (const void *m, double &d) const
 Convert a pointer to an MD-real to a double. More...
 
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 getPositions (const vector< int > &index, vector< Vector > &positions) const
 Retrieve selected positions. More...
 
void getPositions (unsigned j, unsigned k, vector< Vector > &positions) const
 Retrieve all atom positions from index i to index j. 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...
 
void getCharges (const vector< int > &index, vector< double > &) const
 Retrieve selected charges. More...
 
void updateVirial (const Tensor &) const
 Increment the virial by an amount v. More...
 
void updateForces (const vector< int > &index, const vector< Vector > &)
 Increment the force on selected atoms. More...
 
void rescaleForces (const vector< int > &index, double factor)
 Rescale all the forces, including the virial. More...
 
unsigned getRealPrecision () const
 Get the size of MD-real. More...
 

Static Public Member Functions

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

Private Attributes

scalep
 
scalef
 
scaleb
 
scalev
 
int stride
 
T * m
 
T * c
 
T * px
 
T * py
 
T * pz
 
T * fx
 
T * fy
 
T * fz
 
T * box
 
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

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

Member Function Documentation

MDAtomsBase * PLMD::MDAtomsBase::create ( unsigned  n)
staticinherited

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

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.

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

Retrieve box as a plumed Tensor.

Implements PLMD::MDAtomsBase.

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.

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

Retrieve local positions.

Implements PLMD::MDAtomsBase.

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.

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.

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.

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

Get the size of MD-real.

Implements PLMD::MDAtomsBase.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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

Set internal and MD units.

Implements PLMD::MDAtomsBase.

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.

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.

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

template<class T >
T* PLMD::MDAtomsTyped< T >::box
private
template<class T >
T* PLMD::MDAtomsTyped< T >::c
private
template<class T >
T* PLMD::MDAtomsTyped< T >::fx
private
template<class T >
T* PLMD::MDAtomsTyped< T >::fy
private
template<class T >
T* PLMD::MDAtomsTyped< T >::fz
private
template<class T >
T* PLMD::MDAtomsTyped< T >::m
private
template<class T >
T* PLMD::MDAtomsTyped< T >::px
private
template<class T >
T* PLMD::MDAtomsTyped< T >::py
private
template<class T >
T* PLMD::MDAtomsTyped< T >::pz
private
template<class T >
T PLMD::MDAtomsTyped< T >::scaleb
private
template<class T >
T PLMD::MDAtomsTyped< T >::scalef
private
template<class T >
T PLMD::MDAtomsTyped< T >::scalep
private
template<class T >
T PLMD::MDAtomsTyped< T >::scalev
private
template<class T >
int PLMD::MDAtomsTyped< T >::stride
private
template<class T >
T* PLMD::MDAtomsTyped< T >::virial
private

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