23 #include "core/PlumedMain.h"
24 #include "core/ActionSet.h"
28 namespace multicolvar {
32 keys.
add(
"compulsory",
"ARG",
"the label of the action that calculates the vectors we are interested in");
39 std::string mlab;
parse(
"ARG",mlab);
40 log.
printf(
" using vectors calculated by action %s\n",mlab.c_str() );
42 if(!
mycolv)
error(
"action labeled " + mlab +
" does not exist or is not a multicolvar");
68 ActionWithVessel::unlockContributors();
77 std::vector<unsigned> active_tasks( nactive );
78 for(
unsigned i=0;i<nactive;++i) active_tasks[i]=
mycolv->
taskList[i];
96 ActionWithVessel::lockContributors();
Vector getSeparation(const Vector &vec1, const Vector &vec2) const
We use the distance from mycolv as otherwise numerical derivatives dont work.
Vector calculateCentralAtomPosition()
Calculate the position of the central atom.
Log & log
Reference to the log stream.
Vector getSeparation(const Vector &vec1, const Vector &vec2) const
Get the separation between a pair of vectors.
void mpi_gatherActiveMembers(Communicator &comm, std::vector< DynamicList< U > > &ll)
void prepare()
Prepare for the calculation.
Class implementing fixed size vectors of doubles.
void unlockContributors()
Used to make sure we are calculating everything during neighbor list update step. ...
void error(const std::string &msg) const
Crash calculation and print documentation.
multicolvar::StoreCentralAtomsVessel * catoms
The central atom positions.
void add(const std::string &t, const std::string &k, const std::string &d)
Add a new keyword of type t with name k and description d.
virtual void calculate()=0
Calculate an Action.
void activate(const unsigned ii)
Make something active.
virtual void calculateNumericalDerivatives(ActionWithValue *a=NULL)
N.B.
void updateActiveMembers()
Get the list of active members.
virtual Vector getCentralAtom()=0
Get the position of the central atom.
void runAllTasks()
Calculate the values of all the vessels.
void setupMultiColvarBase()
Finish setting up the multicolvar base.
void addDependency(Action *)
Specify that this Action depends on another one.
Used to create a PLMD::Action that has some scalar or vectorial output that may or may not have some ...
DynamicList< unsigned > atomsWithCatomDer
void parse(const std::string &key, T &t)
Parse one keyword as generic type.
This class holds the keywords and their documentation.
virtual double compute(const unsigned &j)=0
Actually compute the colvar.
std::vector< DynamicList< unsigned > > colvar_atoms
The lists of the atoms involved in each of the individual colvars note these refer to the atoms in al...
static void registerKeywords(Keywords &keys)
This class is used to bring the relevant information to the Action constructor.
StoreCentralAtomsVessel * getCentralAtoms()
Return a pointer to the vessel that stores the positions of all the central atoms.
int printf(const char *fmt,...)
Formatted output with explicit format - a la printf.
Base class for all the input Actions.
void completeSetup()
Finish off the setup of the VectorFunction.
virtual void unlockContributors()
Used to make sure we are calculating everything during neighbor list update step. ...
void resizeDynamicArrays()
Resize the dynamic arrays.
DynamicList< unsigned > taskList
The list of tasks we have to perform.
bool checkNumericalDerivatives() const
Check if numerical derivatives should be used.
multicolvar::MultiColvarBase * mycolv
The multicolvar from which we construct these quantities.
void calculateNumericalDerivatives(ActionWithValue *a=NULL)
Calculate the numerical derivatives for this action.
double doCalculation(const unsigned &j)
Do the calculation.
virtual void clearDerivatives()
Clear the derivatives of values wrt parameters.
void requestAtoms(const std::vector< AtomNumber > &a)
Request an array of atoms.
DynamicList< unsigned > atoms_with_derivatives
A dynamic list containing those atoms with derivatives.
DynamicList< AtomNumber > all_atoms
The list of all the atoms involved in the colvar.
MultiColvarFunction(const ActionOptions &)
static void registerKeywords(Keywords &keys)
void deactivateAll()
Make everything in the list inactive.
bool contributorsAreUnlocked
The terms in the series are locked.
int updateFreq
Everything for controlling the updating of neighbor lists.
unsigned getNumberActive() const
Return the number of elements that are currently active.
void calculate()
Regular calculate.