Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
PLMD::vesselbase::StoreDataVessel Class Reference

Objects that inherit from FunctionVessel can be used (in tandem with PLMD::vesselbase::ActionWithVessel) to store values and derivatives for a set of scalars or vectors that are calculated by a PLMD::vesselbase::ActionWithVessel. More...

#include <StoreDataVessel.h>

Inheritance diagram for PLMD::vesselbase::StoreDataVessel:
Inheritance graph
[legend]

Public Member Functions

 StoreDataVessel (const VesselOptions &)
 
unsigned getNumberOfStoredValues () const
 Get the number of values that have been stored. More...
 
void setHardCutoffOnWeight (const double &mytol)
 Set a hard cutoff on the weight of an element. More...
 
bool weightCutoffIsOn () const
 Is the hard weight cutoff on. More...
 
unsigned getNumberOfComponents () const
 Return the number of components in the vector. More...
 
void retrieveValue (const unsigned &myelem, const bool &normed, std::vector< double > &values) const
 Get the values of all the components in the vector. More...
 
void retrieveDerivatives (const unsigned &myelem, const bool &normed, MultiValue &myvals)
 Get the derivatives for one of the components in the vector. More...
 
virtual void resize ()
 Do all resizing of data. More...
 
virtual std::string description ()
 Clear certain data before start of main loop. More...
 
unsigned getNumberOfDerivatives (const unsigned &)
 Get the number of derivatives for the ith value. More...
 
unsigned getSizeOfDerivativeList () const
 Get the size of the derivative list. More...
 
virtual bool calculate (const unsigned &current, MultiValue &myvals, std::vector< double > &buffer, std::vector< unsigned > &der_index) const
 This stores the data when not using lowmem. More...
 
virtual void finish (const std::vector< double > &buffer)
 Build index stores. More...
 
bool storedValueIsActive (const unsigned &iatom)
 Is a particular stored value active at the present time. More...
 
void setActiveValsAndDerivatives (const std::vector< unsigned > &der_index)
 Set the active values. More...
 
virtual void activateIndices (ActionWithVessel *)
 Activate indexes (this is used at end of chain rule) More...
 
virtual bool applyForce (std::vector< double > &)
 Forces on vectors should always be applied elsewhere. More...
 
std::string getName () const
 Return the name. More...
 
std::string getLabel () const
 Return the label. More...
 
void checkRead ()
 Check that readin was fine. More...
 
virtual void setBufferStart (unsigned &start)
 Set the start of the buffer. More...
 
virtual void prepare ()
 Do something before the loop. More...
 
virtual MultiValuetransformDerivatives (const unsigned &current, MultiValue &myvals, MultiValue &bvals)
 This is replaced in bridges so we can transform the derivatives. More...
 

Static Public Member Functions

static void registerKeywords (Keywords &keys)
 
static std::string transformName (const std::string &name)
 Convert the name to the label of the component. More...
 

Public Attributes

Loglog
 Reference to the log on which to output details. More...
 

Protected Member Functions

bool weightHasDerivatives ()
 Is the weight differentiable. More...
 
bool usingLowMem ()
 Are we using low mem option. More...
 
void completeSetup (const unsigned &, const unsigned &)
 Finish the setup of the storage object by setting how much data has to be stored. More...
 
unsigned getNumberOfDerivativeSpacesPerComponent () const
 Return value of nspace. More...
 
void storeValues (const unsigned &, MultiValue &, std::vector< double > &) const
 Retrieve the values from the underlying ActionWithVessel. More...
 
void storeDerivatives (const unsigned &, MultiValue &myvals, std::vector< double > &, std::vector< unsigned > &) const
 This stores the data we get from the calculation. More...
 
double getLocalDerivative (const unsigned &ibuf)
 Get the ibuf'th local derivative value. More...
 
void setLocalDerivative (const unsigned &ibuf, const double &val)
 Set the ibuf'th local derivative value. More...
 
int getNumericalLabel () const
 Return the numerical label. More...
 
void error (const std::string &errmsg)
 Report an error. More...
 
template<class T >
void parse (const std::string &key, T &t)
 Parse something from the input. More...
 
template<class T >
void parseVector (const std::string &key, std::vector< T > &t)
 Parse one keyword as std::vector. More...
 
void parseFlag (const std::string &key, bool &t)
 Parse one keyword as boolean flag. More...
 
std::string getAllInput ()
 This returns the whole input line (it is used for less_than/more_than/between) More...
 
ActionWithVesselgetAction () const
 Return a pointer to the action we are working in. More...
 
double getTolerance () const
 Return the value of the tolerance. More...
 
double getNLTolerance () const
 Return the value of the neighbor list tolerance. More...
 
void resizeBuffer (const unsigned &n)
 Set the size of the data buffer. More...
 

Protected Attributes

bool hard_cut
 Apply a hard cutoff on the weight. More...
 
double wtol
 The value of the cutoff on the weight. More...
 
unsigned bufstart
 The start of this Vessel's buffer in buffer in the underlying ActionWithVessel. More...
 
Communicatorcomm
 A copy of the communicator. More...
 

Private Attributes

bool hasderiv
 Do the quantities being stored in here need derivatives. More...
 
unsigned max_lowmem_stash
 What is the maximum number of vectors we are going to have to store when using lowmem option. More...
 
unsigned vecsize
 The size of the vector we are computing. More...
 
unsigned nspace
 The amount of data per vector element. More...
 
std::vector< unsigned > active_der
 The currently active values. More...
 
std::vector< double > local_buffer
 The buffer. More...
 

Friends

class Moments
 

Detailed Description

Objects that inherit from FunctionVessel can be used (in tandem with PLMD::vesselbase::ActionWithVessel) to store values and derivatives for a set of scalars or vectors that are calculated by a PLMD::vesselbase::ActionWithVessel.

Functions of these stored quantities can then be calculated in a second step.

Constructor & Destructor Documentation

PLMD::vesselbase::StoreDataVessel::StoreDataVessel ( const VesselOptions da)
explicit

Member Function Documentation

virtual void PLMD::vesselbase::StoreDataVessel::activateIndices ( ActionWithVessel )
inlinevirtual

Activate indexes (this is used at end of chain rule)

virtual bool PLMD::vesselbase::StoreDataVessel::applyForce ( std::vector< double > &  )
inlinevirtual

Forces on vectors should always be applied elsewhere.

Implements PLMD::vesselbase::Vessel.

Reimplemented in PLMD::vesselbase::Moments.

bool PLMD::vesselbase::StoreDataVessel::calculate ( const unsigned &  current,
MultiValue myvals,
std::vector< double > &  buffer,
std::vector< unsigned > &  der_index 
) const
virtual

This stores the data when not using lowmem.

Implements PLMD::vesselbase::Vessel.

Reimplemented in PLMD::multicolvar::AdjacencyMatrixVessel.

void PLMD::vesselbase::Vessel::checkRead ( )
inherited

Check that readin was fine.

void PLMD::vesselbase::StoreDataVessel::completeSetup ( const unsigned &  ,
const unsigned &   
)
protected

Finish the setup of the storage object by setting how much data has to be stored.

virtual std::string PLMD::vesselbase::StoreDataVessel::description ( )
inlinevirtual

Clear certain data before start of main loop.

Implements PLMD::vesselbase::Vessel.

Reimplemented in PLMD::vesselbase::Moments.

void PLMD::vesselbase::Vessel::error ( const std::string &  errmsg)
protectedinherited

Report an error.

void PLMD::vesselbase::StoreDataVessel::finish ( const std::vector< double > &  buffer)
virtual

Build index stores.

Final step in gathering data

Implements PLMD::vesselbase::Vessel.

Reimplemented in PLMD::multicolvar::AdjacencyMatrixVessel, and PLMD::vesselbase::Moments.

ActionWithVessel * PLMD::vesselbase::Vessel::getAction ( ) const
inlineprotectedinherited

Return a pointer to the action we are working in.

std::string PLMD::vesselbase::Vessel::getAllInput ( )
protectedinherited

This returns the whole input line (it is used for less_than/more_than/between)

std::string PLMD::vesselbase::Vessel::getLabel ( ) const
inherited

Return the label.

double PLMD::vesselbase::StoreDataVessel::getLocalDerivative ( const unsigned &  ibuf)
protected

Get the ibuf'th local derivative value.

std::string PLMD::vesselbase::Vessel::getName ( ) const
inherited

Return the name.

double PLMD::vesselbase::Vessel::getNLTolerance ( ) const
inlineprotectedinherited

Return the value of the neighbor list tolerance.

unsigned PLMD::vesselbase::StoreDataVessel::getNumberOfComponents ( ) const
inline

Return the number of components in the vector.

unsigned PLMD::vesselbase::StoreDataVessel::getNumberOfDerivatives ( const unsigned &  )

Get the number of derivatives for the ith value.

unsigned PLMD::vesselbase::StoreDataVessel::getNumberOfDerivativeSpacesPerComponent ( ) const
inlineprotected

Return value of nspace.

unsigned PLMD::vesselbase::StoreDataVessel::getNumberOfStoredValues ( ) const
inline

Get the number of values that have been stored.

int PLMD::vesselbase::Vessel::getNumericalLabel ( ) const
inlineprotectedinherited

Return the numerical label.

unsigned PLMD::vesselbase::StoreDataVessel::getSizeOfDerivativeList ( ) const
inline

Get the size of the derivative list.

double PLMD::vesselbase::Vessel::getTolerance ( ) const
inlineprotectedinherited

Return the value of the tolerance.

template<class T >
void PLMD::vesselbase::Vessel::parse ( const std::string &  key,
T &  t 
)
protectedinherited

Parse something from the input.

void PLMD::vesselbase::Vessel::parseFlag ( const std::string &  key,
bool &  t 
)
protectedinherited

Parse one keyword as boolean flag.

template<class T >
void PLMD::vesselbase::Vessel::parseVector ( const std::string &  key,
std::vector< T > &  t 
)
protectedinherited

Parse one keyword as std::vector.

virtual void PLMD::vesselbase::Vessel::prepare ( )
inlinevirtualinherited
void PLMD::vesselbase::StoreDataVessel::registerKeywords ( Keywords keys)
static
void PLMD::vesselbase::StoreDataVessel::resize ( )
virtual

Do all resizing of data.

Implements PLMD::vesselbase::Vessel.

Reimplemented in PLMD::vesselbase::Moments.

void PLMD::vesselbase::Vessel::resizeBuffer ( const unsigned &  n)
inlineprotectedinherited

Set the size of the data buffer.

void PLMD::vesselbase::StoreDataVessel::retrieveDerivatives ( const unsigned &  myelem,
const bool &  normed,
MultiValue myvals 
)

Get the derivatives for one of the components in the vector.

void PLMD::vesselbase::StoreDataVessel::retrieveValue ( const unsigned &  myelem,
const bool &  normed,
std::vector< double > &  values 
) const

Get the values of all the components in the vector.

void PLMD::vesselbase::StoreDataVessel::setActiveValsAndDerivatives ( const std::vector< unsigned > &  der_index)

Set the active values.

void PLMD::vesselbase::Vessel::setBufferStart ( unsigned &  start)
inlinevirtualinherited

Set the start of the buffer.

Reimplemented in PLMD::vesselbase::BridgeVessel, and PLMD::multicolvar::AdjacencyMatrixVessel.

void PLMD::vesselbase::StoreDataVessel::setHardCutoffOnWeight ( const double &  mytol)

Set a hard cutoff on the weight of an element.

void PLMD::vesselbase::StoreDataVessel::setLocalDerivative ( const unsigned &  ibuf,
const double &  val 
)
protected

Set the ibuf'th local derivative value.

void PLMD::vesselbase::StoreDataVessel::storeDerivatives ( const unsigned &  myelem,
MultiValue myvals,
std::vector< double > &  buffer,
std::vector< unsigned > &  der_list 
) const
protected

This stores the data we get from the calculation.

bool PLMD::vesselbase::StoreDataVessel::storedValueIsActive ( const unsigned &  iatom)
inline

Is a particular stored value active at the present time.

void PLMD::vesselbase::StoreDataVessel::storeValues ( const unsigned &  myelem,
MultiValue myvals,
std::vector< double > &  buffer 
) const
protected

Retrieve the values from the underlying ActionWithVessel.

MultiValue & PLMD::vesselbase::Vessel::transformDerivatives ( const unsigned &  current,
MultiValue myvals,
MultiValue bvals 
)
inlinevirtualinherited

This is replaced in bridges so we can transform the derivatives.

Reimplemented in PLMD::vesselbase::BridgeVessel.

std::string PLMD::vesselbase::Vessel::transformName ( const std::string &  name)
staticinherited

Convert the name to the label of the component.

bool PLMD::vesselbase::StoreDataVessel::usingLowMem ( )
inlineprotected

Are we using low mem option.

bool PLMD::vesselbase::StoreDataVessel::weightCutoffIsOn ( ) const

Is the hard weight cutoff on.

bool PLMD::vesselbase::StoreDataVessel::weightHasDerivatives ( )
inlineprotected

Is the weight differentiable.

Friends And Related Function Documentation

friend class Moments
friend

Member Data Documentation

std::vector<unsigned> PLMD::vesselbase::StoreDataVessel::active_der
private

The currently active values.

The active derivative elements

unsigned PLMD::vesselbase::Vessel::bufstart
protectedinherited

The start of this Vessel's buffer in buffer in the underlying ActionWithVessel.

Communicator& PLMD::vesselbase::Vessel::comm
protectedinherited

A copy of the communicator.

bool PLMD::vesselbase::StoreDataVessel::hard_cut
protected

Apply a hard cutoff on the weight.

bool PLMD::vesselbase::StoreDataVessel::hasderiv
private

Do the quantities being stored in here need derivatives.

std::vector<double> PLMD::vesselbase::StoreDataVessel::local_buffer
private

The buffer.

Log& PLMD::vesselbase::Vessel::log
inherited

Reference to the log on which to output details.

unsigned PLMD::vesselbase::StoreDataVessel::max_lowmem_stash
private

What is the maximum number of vectors we are going to have to store when using lowmem option.

unsigned PLMD::vesselbase::StoreDataVessel::nspace
private

The amount of data per vector element.

unsigned PLMD::vesselbase::StoreDataVessel::vecsize
private

The size of the vector we are computing.

double PLMD::vesselbase::StoreDataVessel::wtol
protected

The value of the cutoff on the weight.


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