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

#include <MultiValue.h>

Public Member Functions

 MultiValue (const std::size_t &nvals, const std::size_t &nder, const std::size_t &nmat=0, const std::size_t &maxcol=0, const std::size_t &nbook=0)
 
void addDerivative (const std::size_t &, const std::size_t &, const double &)
 Add derivative. More...
 
void addMatrixForce (const unsigned &imat, const unsigned &jind, const double &f)
 Stash the forces on the matrix. More...
 
void addValue (const std::size_t &, const double &)
 Add value numbered. More...
 
void clear (const unsigned &)
 Clear a value. More...
 
void clearActiveMembers (const std::size_t &ival)
 
void clearAll ()
 Clear all values. More...
 
void clearDerivatives (const unsigned &)
 Clear the derivatives. More...
 
void emptyActiveMembers ()
 
double get (const std::size_t &) const
 Return the ith value. More...
 
unsigned getActiveIndex (const std::size_t &, const std::size_t &) const
 
unsigned getActiveIndex (const unsigned &) const
 
std::vector< Vector > & getAtomVector ()
 
const std::vector< std::vector< Vector > > & getConstFirstAtomDerivativeVector () const
 
double getDerivative (const std::size_t &, const std::size_t &) const
 Return a derivative value. More...
 
std::vector< std::vector< Vector > > & getFirstAtomDerivativeVector ()
 
std::vector< Vector > & getFirstAtomVector ()
 Get references to some memory. More...
 
std::vector< Tensor > & getFirstAtomVirialVector ()
 
std::vector< unsigned > & getIndices ()
 
const std::vector< unsigned > & getMatrixBookeeping () const
 Get the matrix bookeeping array. More...
 
std::vector< unsigned > & getMatrixRowDerivativeIndices (const unsigned &nmat)
 
unsigned getNumberActive (const std::size_t &ival) const
 
unsigned getNumberOfDerivatives () const
 Get the number of derivatives in the stash. More...
 
std::size_t getNumberOfIndices () const
 
unsigned getNumberOfMatrixRowDerivatives (const unsigned &nmat) const
 
unsigned getNumberOfValues () const
 Get the number of values in the stash. More...
 
std::size_t getSecondTaskIndex () const
 Get the task index. More...
 
std::size_t getSplitIndex () const
 
double getStashedMatrixElement (const unsigned &nmat, const unsigned &jcol) const
 
double getStashedMatrixForce (const unsigned &imat, const unsigned &jind) const
 
std::size_t getTaskIndex () const
 
std::vector< double > & getTemporyVector (const unsigned &ind)
 
bool inVectorCall () const
 
void putIndexInActiveArray (const unsigned &)
 
void resize (const std::size_t &nvals, const std::size_t &nder, const std::size_t &nmat=0, const std::size_t &maxcol=0, const std::size_t &nbook=0)
 
void resizeTemporyVector (const unsigned &n)
 
void setDerivative (const std::size_t &ival, const std::size_t &jder, const double &der)
 Set the value of the derivative. More...
 
void setNumberOfIndices (const std::size_t &nat)
 
void setNumberOfMatrixRowDerivatives (const unsigned &nmat, const unsigned &nind)
 Get the bookeeping stuff for the derivatives wrt to rows of matrix. More...
 
void setSecondTaskIndex (const std::size_t &tindex)
 
void setSplitIndex (const std::size_t &nat)
 
void setTaskIndex (const std::size_t &tindex)
 Set the task index prior to the loop. More...
 
void setValue (const std::size_t &, const double &)
 Set value numbered. More...
 
void stashMatrixElement (const unsigned &nmat, const unsigned &rowstart, const unsigned &jcol, const double &val)
 
bool updateComplete ()
 Functions for accessing active list. More...
 
void updateIndex (const std::size_t &, const std::size_t &)
 
void updateIndex (const unsigned &)
 

Private Attributes

std::vector< unsigned > active_list
 
bool atLeastOneSet
 Logical to check if any derivatives were set. More...
 
std::vector< double > derivatives
 Derivatives. More...
 
std::vector< bool > hasderiv
 Matrix asserting which values have derivatives. More...
 
std::vector< unsigned > indices
 This is a fudge to save on vector resizing in MultiColvar. More...
 
std::vector< unsigned > matrix_bookeeping
 
std::vector< double > matrix_force_stash
 
std::vector< std::vector< unsigned > > matrix_row_derivative_indices
 
std::vector< unsigned > matrix_row_nderivatives
 These are used to store the indices that have derivatives wrt to at least one of the elements in a matrix. More...
 
std::vector< double > matrix_row_stash
 
std::vector< unsigned > nactive
 Lists of active variables. More...
 
unsigned nderivatives
 Number of derivatives per value. More...
 
unsigned nindices
 
unsigned nmatrix_cols
 This allows us to store matrix elements. More...
 
unsigned nsplit
 
std::size_t task2_index
 
std::size_t task_index
 The index of the task we are currently performing. More...
 
std::vector< std::vector< Vector > > tmp_atom_der
 
std::vector< Tensortmp_atom_virial
 
std::vector< Vectortmp_atoms
 
std::vector< std::vector< double > > tmp_vectors
 
std::vector< double > tmpder
 Tempory vector of derivatives (used for calculating quotients. More...
 
double tmpval
 Tempory value. More...
 
std::vector< double > values
 Values of quantities. More...
 
bool vector_call
 Are we in this for a call on vectors. More...
 

Friends

class ActionWithVector
 

Constructor & Destructor Documentation

◆ MultiValue()

PLMD::MultiValue::MultiValue ( const std::size_t &  nvals,
const std::size_t &  nder,
const std::size_t &  nmat = 0,
const std::size_t &  maxcol = 0,
const std::size_t &  nbook = 0 
)

Member Function Documentation

◆ addDerivative()

void PLMD::MultiValue::addDerivative ( const std::size_t &  ival,
const std::size_t &  jder,
const double &  der 
)
inline

Add derivative.

◆ addMatrixForce()

void PLMD::MultiValue::addMatrixForce ( const unsigned &  imat,
const unsigned &  jind,
const double &  f 
)
inline

Stash the forces on the matrix.

◆ addValue()

void PLMD::MultiValue::addValue ( const std::size_t &  ival,
const double &  val 
)
inline

Add value numbered.

◆ clear()

void PLMD::MultiValue::clear ( const unsigned &  )

Clear a value.

◆ clearActiveMembers()

void PLMD::MultiValue::clearActiveMembers ( const std::size_t &  ival)
inline

◆ clearAll()

void PLMD::MultiValue::clearAll ( )

Clear all values.

◆ clearDerivatives()

void PLMD::MultiValue::clearDerivatives ( const unsigned &  ival)

Clear the derivatives.

◆ emptyActiveMembers()

void PLMD::MultiValue::emptyActiveMembers ( )

◆ get()

double PLMD::MultiValue::get ( const std::size_t &  ival) const
inline

Return the ith value.

◆ getActiveIndex() [1/2]

unsigned PLMD::MultiValue::getActiveIndex ( const std::size_t &  ival,
const std::size_t &  ind 
) const
inline

◆ getActiveIndex() [2/2]

unsigned PLMD::MultiValue::getActiveIndex ( const unsigned &  ) const

◆ getAtomVector()

std::vector< Vector > & PLMD::MultiValue::getAtomVector ( )
inline

◆ getConstFirstAtomDerivativeVector()

const std::vector< std::vector< Vector > > & PLMD::MultiValue::getConstFirstAtomDerivativeVector ( ) const
inline

◆ getDerivative()

double PLMD::MultiValue::getDerivative ( const std::size_t &  ival,
const std::size_t &  jder 
) const
inline

Return a derivative value.

◆ getFirstAtomDerivativeVector()

std::vector< std::vector< Vector > > & PLMD::MultiValue::getFirstAtomDerivativeVector ( )
inline

◆ getFirstAtomVector()

std::vector< Vector > & PLMD::MultiValue::getFirstAtomVector ( )
inline

Get references to some memory.

These vectors allow us to avoid doing lots of resizing of vectors in MultiColvarTemplate

◆ getFirstAtomVirialVector()

std::vector< Tensor > & PLMD::MultiValue::getFirstAtomVirialVector ( )
inline

◆ getIndices()

std::vector< unsigned > & PLMD::MultiValue::getIndices ( )
inline

◆ getMatrixBookeeping()

const std::vector< unsigned > & PLMD::MultiValue::getMatrixBookeeping ( ) const
inline

Get the matrix bookeeping array.

◆ getMatrixRowDerivativeIndices()

std::vector< unsigned > & PLMD::MultiValue::getMatrixRowDerivativeIndices ( const unsigned &  nmat)
inline

◆ getNumberActive()

unsigned PLMD::MultiValue::getNumberActive ( const std::size_t &  ival) const
inline

◆ getNumberOfDerivatives()

unsigned PLMD::MultiValue::getNumberOfDerivatives ( ) const
inline

Get the number of derivatives in the stash.

◆ getNumberOfIndices()

std::size_t PLMD::MultiValue::getNumberOfIndices ( ) const
inline

◆ getNumberOfMatrixRowDerivatives()

unsigned PLMD::MultiValue::getNumberOfMatrixRowDerivatives ( const unsigned &  nmat) const
inline

◆ getNumberOfValues()

unsigned PLMD::MultiValue::getNumberOfValues ( ) const
inline

Get the number of values in the stash.

◆ getSecondTaskIndex()

std::size_t PLMD::MultiValue::getSecondTaskIndex ( ) const
inline

Get the task index.

◆ getSplitIndex()

std::size_t PLMD::MultiValue::getSplitIndex ( ) const
inline

◆ getStashedMatrixElement()

double PLMD::MultiValue::getStashedMatrixElement ( const unsigned &  nmat,
const unsigned &  jcol 
) const
inline

◆ getStashedMatrixForce()

double PLMD::MultiValue::getStashedMatrixForce ( const unsigned &  imat,
const unsigned &  jind 
) const
inline

◆ getTaskIndex()

std::size_t PLMD::MultiValue::getTaskIndex ( ) const
inline

◆ getTemporyVector()

std::vector< double > & PLMD::MultiValue::getTemporyVector ( const unsigned &  ind)
inline

◆ inVectorCall()

bool PLMD::MultiValue::inVectorCall ( ) const
inline

◆ putIndexInActiveArray()

void PLMD::MultiValue::putIndexInActiveArray ( const unsigned &  )

◆ resize()

void PLMD::MultiValue::resize ( const std::size_t &  nvals,
const std::size_t &  nder,
const std::size_t &  nmat = 0,
const std::size_t &  maxcol = 0,
const std::size_t &  nbook = 0 
)

◆ resizeTemporyVector()

void PLMD::MultiValue::resizeTemporyVector ( const unsigned &  n)
inline

◆ setDerivative()

void PLMD::MultiValue::setDerivative ( const std::size_t &  ival,
const std::size_t &  jder,
const double &  der 
)
inline

Set the value of the derivative.

◆ setNumberOfIndices()

void PLMD::MultiValue::setNumberOfIndices ( const std::size_t &  nat)
inline

◆ setNumberOfMatrixRowDerivatives()

void PLMD::MultiValue::setNumberOfMatrixRowDerivatives ( const unsigned &  nmat,
const unsigned &  nind 
)
inline

Get the bookeeping stuff for the derivatives wrt to rows of matrix.

◆ setSecondTaskIndex()

void PLMD::MultiValue::setSecondTaskIndex ( const std::size_t &  tindex)
inline

◆ setSplitIndex()

void PLMD::MultiValue::setSplitIndex ( const std::size_t &  nat)
inline

◆ setTaskIndex()

void PLMD::MultiValue::setTaskIndex ( const std::size_t &  tindex)
inline

Set the task index prior to the loop.

◆ setValue()

void PLMD::MultiValue::setValue ( const std::size_t &  ival,
const double &  val 
)
inline

Set value numbered.

◆ stashMatrixElement()

void PLMD::MultiValue::stashMatrixElement ( const unsigned &  nmat,
const unsigned &  rowstart,
const unsigned &  jcol,
const double &  val 
)
inline

◆ updateComplete()

bool PLMD::MultiValue::updateComplete ( )

Functions for accessing active list.

◆ updateIndex() [1/2]

void PLMD::MultiValue::updateIndex ( const std::size_t &  ival,
const std::size_t &  jder 
)
inline

◆ updateIndex() [2/2]

void PLMD::MultiValue::updateIndex ( const unsigned &  )

Friends And Related Function Documentation

◆ ActionWithVector

friend class ActionWithVector
friend

Member Data Documentation

◆ active_list

std::vector<unsigned> PLMD::MultiValue::active_list
private

◆ atLeastOneSet

bool PLMD::MultiValue::atLeastOneSet
private

Logical to check if any derivatives were set.

◆ derivatives

std::vector<double> PLMD::MultiValue::derivatives
private

Derivatives.

◆ hasderiv

std::vector<bool> PLMD::MultiValue::hasderiv
private

Matrix asserting which values have derivatives.

◆ indices

std::vector<unsigned> PLMD::MultiValue::indices
private

This is a fudge to save on vector resizing in MultiColvar.

◆ matrix_bookeeping

std::vector<unsigned> PLMD::MultiValue::matrix_bookeeping
private

◆ matrix_force_stash

std::vector<double> PLMD::MultiValue::matrix_force_stash
private

◆ matrix_row_derivative_indices

std::vector<std::vector<unsigned> > PLMD::MultiValue::matrix_row_derivative_indices
private

◆ matrix_row_nderivatives

std::vector<unsigned> PLMD::MultiValue::matrix_row_nderivatives
private

These are used to store the indices that have derivatives wrt to at least one of the elements in a matrix.

◆ matrix_row_stash

std::vector<double> PLMD::MultiValue::matrix_row_stash
private

◆ nactive

std::vector<unsigned> PLMD::MultiValue::nactive
private

Lists of active variables.

◆ nderivatives

unsigned PLMD::MultiValue::nderivatives
private

Number of derivatives per value.

◆ nindices

unsigned PLMD::MultiValue::nindices
private

◆ nmatrix_cols

unsigned PLMD::MultiValue::nmatrix_cols
private

This allows us to store matrix elements.

◆ nsplit

unsigned PLMD::MultiValue::nsplit
private

◆ task2_index

std::size_t PLMD::MultiValue::task2_index
private

◆ task_index

std::size_t PLMD::MultiValue::task_index
private

The index of the task we are currently performing.

◆ tmp_atom_der

std::vector<std::vector<Vector> > PLMD::MultiValue::tmp_atom_der
private

◆ tmp_atom_virial

std::vector<Tensor> PLMD::MultiValue::tmp_atom_virial
private

◆ tmp_atoms

std::vector<Vector> PLMD::MultiValue::tmp_atoms
private

◆ tmp_vectors

std::vector<std::vector<double> > PLMD::MultiValue::tmp_vectors
private

◆ tmpder

std::vector<double> PLMD::MultiValue::tmpder
private

Tempory vector of derivatives (used for calculating quotients.

◆ tmpval

double PLMD::MultiValue::tmpval
private

Tempory value.

◆ values

std::vector<double> PLMD::MultiValue::values
private

Values of quantities.

◆ vector_call

bool PLMD::MultiValue::vector_call
private

Are we in this for a call on vectors.


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