All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 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

double scalep
 
double scalef
 
double scaleb
 
double 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

Definition at line 36 of file MDAtoms.cpp.

Constructor & Destructor Documentation

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

Definition at line 206 of file MDAtoms.cpp.

Member Function Documentation

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

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

Definition at line 224 of file MDAtoms.cpp.

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.

Definition at line 62 of file MDAtoms.cpp.

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

Retrieve box as a plumed Tensor.

Implements PLMD::MDAtomsBase.

Definition at line 88 of file MDAtoms.cpp.

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.

Definition at line 109 of file MDAtoms.cpp.

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.

Definition at line 103 of file MDAtoms.cpp.

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.

Definition at line 94 of file MDAtoms.cpp.

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

Get the size of MD-real.

Implements PLMD::MDAtomsBase.

Definition at line 139 of file MDAtoms.cpp.

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.

Definition at line 59 of file MDAtoms.cpp.

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

Attention
the virial is not scaled indeed... is it a bug??

Implements PLMD::MDAtomsBase.

Definition at line 129 of file MDAtoms.cpp.

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.

Definition at line 154 of file MDAtoms.cpp.

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.

Definition at line 201 of file MDAtoms.cpp.

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.

Definition at line 160 of file MDAtoms.cpp.

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.

Definition at line 186 of file MDAtoms.cpp.

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.

Definition at line 196 of file MDAtoms.cpp.

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.

Definition at line 144 of file MDAtoms.cpp.

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.

Definition at line 170 of file MDAtoms.cpp.

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

Set internal and MD units.

Implements PLMD::MDAtomsBase.

Definition at line 76 of file MDAtoms.cpp.

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.

Definition at line 180 of file MDAtoms.cpp.

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.

Definition at line 120 of file MDAtoms.cpp.

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

Increment the virial by an amount v.

Implements PLMD::MDAtomsBase.

Definition at line 115 of file MDAtoms.cpp.

Member Data Documentation

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

Definition at line 46 of file MDAtoms.cpp.

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

Definition at line 43 of file MDAtoms.cpp.

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

Definition at line 45 of file MDAtoms.cpp.

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

Definition at line 45 of file MDAtoms.cpp.

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

Definition at line 45 of file MDAtoms.cpp.

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

Definition at line 42 of file MDAtoms.cpp.

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

Definition at line 44 of file MDAtoms.cpp.

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

Definition at line 44 of file MDAtoms.cpp.

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

Definition at line 44 of file MDAtoms.cpp.

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

Definition at line 40 of file MDAtoms.cpp.

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

Definition at line 39 of file MDAtoms.cpp.

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

Definition at line 39 of file MDAtoms.cpp.

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

Definition at line 40 of file MDAtoms.cpp.

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

Definition at line 41 of file MDAtoms.cpp.

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

Definition at line 47 of file MDAtoms.cpp.


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