22 #include "vesselbase/ActionWithVessel.h"
26 #define MAXDERIVATIVES 300
29 namespace multicolvar{
32 Vessel::registerKeywords( keys );
33 plumed_assert( keys.
size()==0 );
49 for(
unsigned i=0;i<nfunc;++i){
64 "Error increase MAXDERIVATIVES in StoreColvarVessel");
71 unsigned ider=3*iatom;
77 for(
unsigned j=0;j<9;++j){
91 for(
unsigned j=0;j<9;++j){
104 for(
unsigned i=0;i<
active_atoms[ival].getNumberActive();++i){
105 unsigned jbuf=
start[ival] + 1 + 3*i;
112 for(
unsigned i=0;i<9;++i){
121 for(
unsigned i=0;i<
active_atoms[ival].getNumberActive();++i){
128 for(
unsigned i=0;i<9;++i){
virtual void performCalculationUsingAllValues()=0
Do the calculation.
unsigned current
The numerical index of the task we are curently performing.
void mpi_gatherActiveMembers(Communicator &comm, std::vector< DynamicList< U > > &ll)
A class for holding the value of a function together with its derivatives.
Communicator & comm
A copy of the communicator.
double getBufferElement(const unsigned &i) const
Get the value in the ith element of the buffer.
double getElementDerivative(const unsigned &) const
Retrieve the derivative of the quantity in the sum wrt to a numbered element.
bool calculate()
This makes sure all values are stored.
virtual void local_resizing()=0
This makes sure things further down the chain are resized.
void resize()
This does the resizing of the buffer.
std::vector< DynamicList< unsigned > > active_atoms
void addDerivatives(const unsigned &ival, double &pref, Value *value_out)
Add the derivatives from the value.
bool weightHasDerivatives
Does the weight have derivatives.
This class holds the keywords and their documentation.
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)
void resizeBuffer(const unsigned &n)
Set the size of the data buffer.
void setBufferElement(const unsigned &i, const double &val)
Set the value of the ith element in the buffer.
void addWeightDerivatives(const unsigned &ival, double &pref, Value *value_out)
Add the derivatives from the weight of the value.
StoreColvarVessel(const vesselbase::VesselOptions &)
Constructor.
This class is used to pass the input to Vessels.
DynamicList< unsigned > atoms_with_derivatives
A dynamic list containing those atoms with derivatives.
unsigned getNumberOfDerivatives()
Get the number of derivatives for this action.
void finish()
Makes sure the dynamic lists are gathered.
unsigned getNumberOfAtoms() const
Get number of available atoms.
bool diffweight
Are the weights differentiable.
void addDerivative(unsigned i, double d)
Add some derivative to the ith component of the derivatives array.
unsigned getNumberActive() const
Return the number of elements that are currently active.
unsigned size() const
Return the number of defined keywords.
double getElementValue(const unsigned &ival) const
Get the value of this element.
ActionWithVessel * getAction()
Return a pointer to the action we are working in.
std::vector< unsigned > start