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>
Public Member Functions | |
StoreDataVessel (const VesselOptions &) | |
virtual void | activateIndices (ActionWithVessel *) |
Activate indexes (this is used at end of chain rule) More... | |
void | addActionThatUses (ActionWithVessel *actionThatUses) |
Add an action that uses this data. More... | |
bool | applyForce (std::vector< double > &) override |
Forces on vectors should always be applied elsewhere. More... | |
void | calculate (const unsigned ¤t, MultiValue &myvals, std::vector< double > &buffer, std::vector< unsigned > &der_index) const override |
This stores the data when not using lowmem. More... | |
void | checkRead () |
Check that readin was fine. More... | |
std::string | description () override |
Return a description of the vessel contents. More... | |
void | finish (const std::vector< double > &buffer) override |
Final step in gathering data. More... | |
ActionWithVessel * | getDataUser (const unsigned &) |
Get one of the ith data user. More... | |
std::string | getLabel () const |
Return the label. More... | |
std::string | getName () const |
Return the name. More... | |
unsigned | getNumberOfComponents () const |
Return the number of components in the vector. More... | |
unsigned | getNumberOfDataUsers () const |
Get the number of data users. More... | |
unsigned | getNumberOfDerivatives (const unsigned &) |
Get the number of derivatives for the ith value. More... | |
virtual unsigned | getNumberOfStoredValues () const |
Get the number of values that have been stored. More... | |
unsigned | getSizeOfDerivativeList () const |
Get the size of the derivative list. More... | |
unsigned | getStoreIndex (const unsigned &) const |
Get the index to store a particular index inside. More... | |
MultiValue & | getTemporyMultiValue (const unsigned &ind) |
Return a tempory multi value - we do this so as to avoid vector resizing. More... | |
unsigned | getTrueIndex (const unsigned &) const |
Get the true index of a quantity from the index it is stored in. More... | |
virtual void | prepare () |
Do something before the loop. More... | |
void | recalculateStoredQuantity (const unsigned &myelm, MultiValue &myvals) |
Recalculate one of the base quantities. More... | |
void | resize () override |
Do all resizing of data. More... | |
void | resizeTemporyMultiValues (const unsigned &nvals) |
Set the number of tempory multivalues we need. More... | |
void | retrieveDerivatives (const unsigned &myelem, const bool &normed, MultiValue &myvals) |
Get the derivatives for one of the components in the vector. More... | |
void | retrieveSequentialValue (const unsigned &myelem, const bool &normed, std::vector< double > &values) const |
Get the values of all the components in the vector. More... | |
void | retrieveValueWithIndex (const unsigned &myelem, const bool &normed, std::vector< double > &values) const |
double | retrieveWeightWithIndex (const unsigned &myelem) const |
void | setActiveValsAndDerivatives (const std::vector< unsigned > &der_index) |
Set the active values. More... | |
virtual void | setBufferStart (unsigned &start) |
Set the start of the buffer. More... | |
void | setHardCutoffOnWeight (const double &mytol) |
Set a hard cutoff on the weight of an element. More... | |
bool | storedValueIsActive (const unsigned &iatom) const |
Is a particular stored value active at the present time. More... | |
virtual MultiValue & | transformDerivatives (const unsigned ¤t, 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... | |
Protected Member Functions | |
void | completeSetup (const unsigned &, const unsigned &) |
Finish the setup of the storage object by setting how much data has to be stored. More... | |
void | error (const std::string &errmsg) |
Report an error. More... | |
ActionWithVessel * | getAction () const |
Return a pointer to the action we are working in. More... | |
std::string | getAllInput () |
This returns the whole input line (it is used for less_than/more_than/between) More... | |
double | getLocalDerivative (const unsigned &ibuf) |
Get the ibuf'th local derivative value. More... | |
double | getNLTolerance () const |
Return the value of the neighbor list tolerance. More... | |
unsigned | getNumberOfDerivativeSpacesPerComponent () const |
Return value of nspace. More... | |
int | getNumericalLabel () const |
Return the numerical label. More... | |
unsigned | getSizeOfBuffer () const |
Return the size of the buffer. More... | |
double | getTolerance () const |
Return the value of the tolerance. More... | |
template<class T > | |
void | parse (const std::string &key, T &t) |
Parse something from the input. More... | |
void | parseFlag (const std::string &key, bool &t) |
Parse one keyword as boolean flag. More... | |
template<class T > | |
void | parseVector (const std::string &key, std::vector< T > &t) |
Parse one keyword as std::vector. More... | |
void | resizeBuffer (const unsigned &n) |
Set the size of the data buffer. More... | |
void | setLocalDerivative (const unsigned &ibuf, const double &val) |
Set the ibuf'th local derivative value. More... | |
void | storeDerivatives (const unsigned &, MultiValue &myvals, std::vector< double > &, std::vector< unsigned > &) const |
This stores the data we get from the calculation. More... | |
void | storeValues (const unsigned &, MultiValue &, std::vector< double > &) const |
Retrieve the values from the underlying ActionWithVessel. More... | |
bool | usingLowMem () |
Are we using low mem option. More... | |
bool | weightHasDerivatives () |
Is the weight differentiable. More... | |
Protected Attributes | |
unsigned | bufstart |
The start of this Vessel's buffer in buffer in the underlying ActionWithVessel. More... | |
Private Attributes | |
std::vector< unsigned > | active_der |
The currently active values. More... | |
bool | hasderiv |
Do the quantities being stored in here need derivatives. More... | |
std::vector< double > | local_buffer |
The buffer. More... | |
unsigned | max_lowmem_stash |
What is the maximum number of vectors we are going to have to store when using lowmem option. More... | |
std::vector< MultiValue > | my_tmp_vals |
unsigned | nspace |
The amount of data per vector element. More... | |
unsigned | tmp_index |
We create a vector of tempory MultiValues here so as to avoid lots of vector resizing. More... | |
std::vector< ActionWithVessel * > | userActions |
The actions that are going to use the stored data. More... | |
unsigned | vecsize |
The size of the vector we are computing. More... | |
Friends | |
class | Moments |
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.
|
explicit |
|
inlinevirtual |
Activate indexes (this is used at end of chain rule)
void PLMD::vesselbase::StoreDataVessel::addActionThatUses | ( | ActionWithVessel * | actionThatUses | ) |
Add an action that uses this data.
|
inlineoverridevirtual |
Forces on vectors should always be applied elsewhere.
Implements PLMD::vesselbase::Vessel.
|
overridevirtual |
This stores the data when not using lowmem.
Implements PLMD::vesselbase::Vessel.
|
inherited |
Check that readin was fine.
|
protected |
Finish the setup of the storage object by setting how much data has to be stored.
|
inlineoverridevirtual |
Return a description of the vessel contents.
Implements PLMD::vesselbase::Vessel.
|
protectedinherited |
Report an error.
|
overridevirtual |
Final step in gathering data.
Implements PLMD::vesselbase::Vessel.
|
inlineprotectedinherited |
Return a pointer to the action we are working in.
|
protectedinherited |
This returns the whole input line (it is used for less_than/more_than/between)
|
inline |
Get one of the ith data user.
|
inherited |
Return the label.
|
protected |
Get the ibuf'th local derivative value.
|
inherited |
Return the name.
|
inlineprotectedinherited |
Return the value of the neighbor list tolerance.
|
inline |
Return the number of components in the vector.
|
inline |
Get the number of data users.
unsigned PLMD::vesselbase::StoreDataVessel::getNumberOfDerivatives | ( | const unsigned & | ) |
Get the number of derivatives for the ith value.
|
inlineprotected |
Return value of nspace.
|
inlinevirtual |
Get the number of values that have been stored.
|
inlineprotectedinherited |
Return the numerical label.
|
inlineprotectedinherited |
Return the size of the buffer.
|
inline |
Get the size of the derivative list.
|
inline |
Get the index to store a particular index inside.
MultiValue & PLMD::vesselbase::StoreDataVessel::getTemporyMultiValue | ( | const unsigned & | ind | ) |
Return a tempory multi value - we do this so as to avoid vector resizing.
|
inlineprotectedinherited |
Return the value of the tolerance.
|
inline |
Get the true index of a quantity from the index it is stored in.
|
protectedinherited |
Parse something from the input.
|
protectedinherited |
Parse one keyword as boolean flag.
|
protectedinherited |
Parse one keyword as std::vector.
|
inlinevirtualinherited |
Do something before the loop.
Reimplemented in PLMD::vesselbase::BridgeVessel, and PLMD::mapping::SpathVessel.
|
inline |
Recalculate one of the base quantities.
|
static |
|
overridevirtual |
Do all resizing of data.
Implements PLMD::vesselbase::Vessel.
|
inlineprotectedinherited |
Set the size of the data buffer.
void PLMD::vesselbase::StoreDataVessel::resizeTemporyMultiValues | ( | const unsigned & | nvals | ) |
Set the number of tempory multivalues we need.
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::retrieveSequentialValue | ( | 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::retrieveValueWithIndex | ( | const unsigned & | myelem, |
const bool & | normed, | ||
std::vector< double > & | values | ||
) | const |
double PLMD::vesselbase::StoreDataVessel::retrieveWeightWithIndex | ( | const unsigned & | myelem | ) | const |
void PLMD::vesselbase::StoreDataVessel::setActiveValsAndDerivatives | ( | const std::vector< unsigned > & | der_index | ) |
Set the active values.
|
inlinevirtualinherited |
Set the start of the buffer.
Reimplemented in PLMD::vesselbase::BridgeVessel.
void PLMD::vesselbase::StoreDataVessel::setHardCutoffOnWeight | ( | const double & | mytol | ) |
Set a hard cutoff on the weight of an element.
|
protected |
Set the ibuf'th local derivative value.
|
protected |
This stores the data we get from the calculation.
|
inline |
Is a particular stored value active at the present time.
|
protected |
Retrieve the values from the underlying ActionWithVessel.
|
inlinevirtualinherited |
This is replaced in bridges so we can transform the derivatives.
Reimplemented in PLMD::vesselbase::BridgeVessel.
|
staticinherited |
Convert the name to the label of the component.
|
inlineprotected |
Are we using low mem option.
|
inlineprotected |
Is the weight differentiable.
|
friend |
|
private |
The currently active values.
The active derivative elements
|
protectedinherited |
The start of this Vessel's buffer in buffer in the underlying ActionWithVessel.
|
private |
Do the quantities being stored in here need derivatives.
|
private |
The buffer.
|
private |
What is the maximum number of vectors we are going to have to store when using lowmem option.
|
private |
|
private |
The amount of data per vector element.
|
private |
We create a vector of tempory MultiValues here so as to avoid lots of vector resizing.
|
private |
The actions that are going to use the stored data.
|
private |
The size of the vector we are computing.
Hosted by GitHub
![]() |
![]() |