31 std::vector<double>
df;
46 keys.add(
"compulsory",
"BETA",
"the value of beta for the equation in the manual");
50 keys.
reserve(
"optional",
"MIN",
"calculate the minimum value. "
51 "To make this quantity continuous the minimum is calculated using "
52 "\\f$ \\textrm{min} = \\frac{\\beta}{ \\log \\sum_i \\exp\\left( \\frac{\\beta}{s_i} \\right) } \\f$ "
53 "The value of \\f$\\beta\\f$ in this function is specified using (BETA=\\f$\\beta\\f$)",
true);
54 keys.
addOutputComponent(
"min",
"MIN",
"the minimum value. This is calculated using the formula described in the description of the "
55 "keyword so as to make it continuous.");
62 if(
getAction()->isPeriodic() )
error(
"min is not a meaningful option for periodic variables");
65 if(
diffweight )
error(
"can't calculate min if weight is differentiable");
70 return "the minimum value. Beta is equal to " + str_beta;
75 double dval, f = exp(
beta/val); dval=f/(val*val);
double getFinalValue(const unsigned &j)
Get the nth value in the distribution.
static void reserveKeyword(Keywords &keys)
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.
bool calculate()
Calculate the part of the vessel that is done in the loop.
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)
Min(const VesselOptions &da)
void reserve(const std::string &t, const std::string &k, const std::string &d, const bool isvessel=false)
Reserve a keyword.
void error(const std::string &errmsg)
Report an error.
This class is used to pass the input to Vessels.
void parse(const std::string &key, T &t)
Parse something from the input.
void finish()
Complete the calculation once the loop is finished.
static void registerKeywords(Keywords &keys)
std::string function_description()
The rest of the description of what we are calculating.
double getElementValue(const unsigned &ival) const
Get the value of this element.
ActionWithVessel * getAction()
Return a pointer to the action we are working in.