23 #include "core/ActionWithValue.h"
30 plumed_assert( keys.
size()==0 );
37 plumed_massert(a,
"cannot create passable values as base action does not inherit from ActionWithValue");
71 std::vector<double> tmpforce( forces.size() );
72 forces.assign(forces.size(),0.0);
bool wasforced=
false;
75 for(
unsigned j=0;j<forces.size();++j) forces[j]+=tmpforce[j];
void setNotPeriodic()
Set your default value to have no periodicity.
virtual unsigned getNumberOfTerms()
Return number of terms.
bool applyForce(std::vector< double > &forces)
This applies all the forces.
bool applyForce(std::vector< double > &forces) const
Apply the forces to the derivatives using the chain rule (if there are no forces this routine returns...
void componentIsNotPeriodic(const std::string &name)
Set your value component to have no periodicity.
bool diffweight
Are the derivatives differentiable.
std::string description()
The description for the log.
virtual unsigned getNumberOfDerivatives()=0
Get the number of derivatives for final calculated quantity.
static void registerKeywords(Keywords &keys)
Reserve any keywords for this particular vessel.
double getBufferElement(const unsigned &i) const
Get the value in the ith element of the buffer.
const std::string & getLabel() const
Returns the label.
Value * final_value
This is the pointer to the value we are creating.
void addValueWithDerivatives()
Add a value with the name label that has derivatives.
static void registerKeywords(Keywords &keys)
void mergeFinalDerivatives(const std::vector< double > &df)
This does a combination of the product and chain rules.
FunctionVessel(const VesselOptions &)
std::string getLabel() const
Return the label.
bool weightHasDerivatives
Does the weight have derivatives.
void resize()
This does the resizing of the buffer.
Used to create a PLMD::Action that has some scalar or vectorial output that may or may not have some ...
This class holds the keywords and their documentation.
bool exists(const std::string &name) const
Check if a value with a particular name is present.
void resizeBuffer(const unsigned &n)
Set the size of the data buffer.
int getNumericalLabel() const
Return the numerical label.
Value * copyOutput(const std::string &name) const
Return a pointer to the value with name (this is used to retrieve values in other PLMD::Actions) You ...
virtual std::string function_description()=0
The rest of the description of what we are calculating.
void resizeDerivatives(int n)
Set the number of derivatives.
This class is used to pass the input to Vessels.
unsigned nderivatives
The number of derivatives.
void addComponentWithDerivatives(const std::string &name)
Add a value with a name like label.name that has derivatives.
int getNumberOfComponents() const
Returns the number of values defined.
void addDerivative(unsigned i, double d)
Add some derivative to the ith component of the derivatives array.
unsigned size() const
Return the number of defined keywords.
ActionWithVessel * getAction()
Return a pointer to the action we are working in.