27 namespace vesselbase {
47 keys.
reserveFlag(
"MEAN",
false,
"take the mean of these variables.",
true);
48 keys.
addOutputComponent(
"mean",
"MEAN",
"the mean value. The output component can be refererred to elsewhere in the input "
49 "file by using the label.mean");
55 if(
getAction()->isPeriodic() )
error(
"MEAN cannot be used with periodic variables");
59 return "the mean value";
79 std::vector<double> df(2);
bool calculate()
Calculate the part of the vessel that is done in the loop.
double getTolerance() const
Return the value of the tolerance.
double getFinalValue(const unsigned &j)
Get the nth value in the distribution.
bool diffweight
Are the derivatives differentiable.
void chainRuleForElementDerivatives(const unsigned &, const unsigned &, const double &, Vessel *)
Merge the derivatives.
void setOutputValue(const double &val)
Set the final value.
Objects that inherit from FunctionVessel can be used (in tandem with PLMD::ActionWithVessel) to calcu...
static void registerKeywords(Keywords &keys)
void mergeFinalDerivatives(const std::vector< double > &df)
This does a combination of the product and chain rules.
void addOutputComponent(const std::string &name, const std::string &key, const std::string &descr)
Add a potential component which can be output by this particular action.
This class holds the keywords and their documentation.
void addValueIgnoringTolerance(const unsigned &jval, const double &val)
Add some value to the accumulator and ignore the tolerance.
#define PLUMED_REGISTER_VESSEL(classname, keyword)
Mean(const vesselbase::VesselOptions &da)
void error(const std::string &errmsg)
Report an error.
This class is used to pass the input to Vessels.
std::string function_description()
The rest of the description of what we are calculating.
static void registerKeywords(Keywords &keys)
static void reserveKeyword(Keywords &keys)
void reserveFlag(const std::string &k, const bool def, const std::string &d, const bool isvessel=false)
Reserve a flag.
void finish()
Complete the calculation once the loop is finished.
double getElementValue(const unsigned &ival) const
Get the value of this element.
ActionWithVessel * getAction()
Return a pointer to the action we are working in.