22 #ifndef __PLUMED_vesselbase_ActionWithVessel_h
23 #define __PLUMED_vesselbase_ActionWithVessel_h
25 #include "core/ActionWithValue.h"
26 #include "core/ActionAtomistic.h"
27 #include "tools/Exception.h"
28 #include "tools/DynamicList.h"
85 void addVessel(
const std::string&
name,
const std::string& input,
const int numlab=0,
const std::string thislab=
"" );
BridgeVessel * addBridgingVessel(ActionWithVessel *tome)
Add a bridging vessel to the list of vessels.
Vessel * getVessel(const std::string &name)
Return a pointer to the field.
unsigned current
The numerical index of the task we are curently performing.
unsigned current_buffer_start
The buffers we use for mpi summing DistributionFunction objects.
std::vector< double > buffer
std::vector< Vessel * > functions
Pointers to the functions we are using on each value.
static void registerKeywords(Keywords &keys)
void chainRuleForElementDerivatives(const unsigned &, const unsigned &, const double &, Vessel *)
Merge the derivatives.
std::vector< bool > thisval_wasset
A boolean that makes sure we don't accumulate very wrong derivatives.
double getNLTolerance() const
Return the value for the neighbor list tolerance.
bool read
This is used to ensure that we have properly read the action.
void setElementDerivative(const unsigned &, const double &)
Set the derivative of the jth element wrt to a numbered element.
virtual unsigned getNumberOfDerivatives()=0
Get the number of derivatives for final calculated quantity.
void addElementDerivative(const unsigned &, const double &)
Add some derivative of the quantity in the sum wrt to a numbered element.
std::vector< double > tmpforces
Tempory storage for forces.
virtual void mergeDerivatives(const unsigned &ider, const double &df)
const std::string & getLabel() const
Returns the label.
Objects that inherit from FunctionVessel can be used (in tandem with PLMD::ActionWithVessel) to calcu...
double getElementDerivative(const unsigned &) const
Retrieve the derivative of the quantity in the sum wrt to a numbered element.
void addVessel(const std::string &name, const std::string &input, const int numlab=0, const std::string thislab="")
Add a vessel to the list of vessels.
double nl_tolerance
Tolerance for quantities being put in neighbor lists.
void runAllTasks()
Calculate the values of all the vessels.
unsigned bridgeVariable
This is used for numerical derivatives of bridge variables.
bool getForcesFromVessels(std::vector< double > &forcesToApply)
Retrieve the forces from all the vessels (used in apply)
void readVesselKeywords()
Complete the setup of this object (this routine must be called after construction of ActionWithValue)...
std::vector< double > thisval
The value of the current element in the sum.
bool weightHasDerivatives
Does the weight have derivatives.
This class holds the keywords and their documentation.
const std::string name
Name of the directive in the plumed.dat file.
This class allows you to calculate the vessel in one ActionWithVessel.
virtual void retrieveDomain(std::string &min, std::string &max)
What are the domains of the base quantities.
void clearAfterTask()
Clear tempory data that is calculated for each task.
This class is used to bring the relevant information to the Action constructor.
void setElementValue(const unsigned &, const double &)
Set the value of the element.
const std::string & getName() const
Returns the name.
Base class for all the input Actions.
virtual void lockContributors()
virtual void unlockContributors()
Used to make sure we are calculating everything during neighbor list update step. ...
void accumulateDerivative(const unsigned &ider, const double &df)
This is used to accumulate the derivatives when we merge using chainRuleForElementDerivatives.
bool calculateAllVessels()
This loops over all the vessels calculating them and also sets all the element derivatives equal to z...
virtual void deactivate_task()
Activate the jth colvar Deactivate the current task in future loops.
virtual void performTask(const unsigned &j)=0
Calculate one of the functions in the distribution.
DynamicList< unsigned > taskList
The list of tasks we have to perform.
unsigned current_buffer_stride
unsigned getNumberOfVessels() const
Get the number of vessels.
double getTolerance() const
Return the value of the tolerance.
virtual bool isPeriodic()=0
Are the base quantities periodic.
virtual void doJobsRequiredBeforeTaskList()
Do any jobs that are required before the task list is undertaken.
bool serial
Do all calculations in serial.
unsigned fullSize() const
Return the total number of elements in the list.
virtual void applyBridgeForces(const std::vector< double > &bb)
Apply forces from bridge vessel - this is rarely used - currently only in ActionVolume.
ActionWithVessel(const ActionOptions &ao)
std::vector< double > derivatives
Vector of derivatives for the object.
virtual void clearDerivativesAfterTask(const unsigned &)
double tolerance
The tolerance on the accumulators.
bool contributorsAreUnlocked
The terms in the series are locked.
void resizeFunctions()
Resize all the functions when the number of derivatives change.
unsigned getNumberActive() const
Return the number of elements that are currently active.
void finishComputations()
Finish running all the calculations.
Vessel * getPntrToVessel(const unsigned &i)
Get a pointer to the ith vessel.
double getElementValue(const unsigned &ival) const
Get the value of this element.
This is used to create PLMD::Action objects that are computed by calculating the same function multip...