Skip to content
Snippets Groups Projects
Commit 6881fef8 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Added documentation

parent 9177592a
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,8 @@ namespace PLMD{
class PlumedMain;
/// This class is used to bring the relevant information to the Action constructor.
/// Its content is kept private to other classes, and may change in the future
/// Only Action and ActionRegister class can access to its content, which is
/// kept private to other classes, and may change in the future.
class ActionOptions{
friend class Action;
friend class ActionRegister;
......
......@@ -16,6 +16,7 @@ protected:
int getStride()const;
public:
ActionPilot(const ActionOptions&);
/// Check if the action is active on this step
bool onStep()const;
};
......
......@@ -21,8 +21,11 @@ class ActionWithArguments:
protected:
ActionWithArguments(const ActionOptions&);
virtual ~ActionWithArguments(){};
/// Returns an array of pointers to the arguments
std::vector<Value*> & getArguments();
/// Returns the value of an argument
double getArgument(int)const;
/// Returns the number of arguments
unsigned getNumberOfArguments()const;
public:
};
......
......@@ -11,6 +11,8 @@ namespace PLMD{
/// Action which can take one or more values.
/// This object contains an array of PLMD::Value, one for each component.
/// It also stores all the derivatives of these values wrt the parameters
/// Parameters are other values (from other Action s) or atomic positions.
class ActionWithValue:
public virtual Action
{
......@@ -21,20 +23,44 @@ class ActionWithValue:
public:
ActionWithValue(const ActionOptions&ao);
~ActionWithValue();
/// Add a new value without derivatives.
/// This should be used for values which are only evaluated (e.g. for printing)
/// but for which we do not make derivatives available so that forces cannot
/// be applied
void addValue(const std::string&name);
/// Add a new value with derivatives.
/// This should be used for values for which we make derivatives available
/// so that forces can be applied
void addValueWithDerivatives(const std::string&name);
/// Check if a value with a given name is already used
bool hasNamedValue(const std::string&name)const;
/// Return a pointer to the value by name
Value* getValue(const std::string&name)const;
/// Return a pointer to the value by index
/// This should be an indexes growing for new inserted values.
/// E.g., the default value (no name) is number 0, ...
Value* getValue(int i)const;
/// Returns an array of strings with the names of the values
std::vector<std::string> getValueNames()const;
/// Returns the number of values defined
int getNumberOfValues();
/// Set the number of parameters on which this Action depends.
/// Example: for a Bias, this is the number of arguments, for a Colvar
/// is 3*Natoms+cell variables
void setNumberOfParameters(int n);
/// Returns the number of parameters on which this Action depends.
int getNumberOfParameters()const;
/// Returns the total force applied on i-th value
double getForce(int n);
/// Add a force to the i-th value
void addInputForces(int i,double f);
/// Clear the forces on the values
void clearInputForces();
/// Clear the derivatives of values wrt parameters
void clearDerivatives();
/// Set the value
void setValue(Value*,double);
/// Set the default value (the one without name)
void setValue(double);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment