23 #include "tools/Matrix.h"
24 #include "core/ActionWithArguments.h"
27 namespace vesselbase {
52 plumed_merror(
"I shouldn't end up here");
88 for(
unsigned i=0;i<nextra;++i){
106 for(
unsigned j=0;j<nvals;++j){
109 for(
unsigned i=0;i<3*natoms;++i){
114 for(
int i=0;i<3;i++)
for(
int k=0;k<3;k++){
118 for(
int i=0;i<3;i++)
for(
int k=0;k<3;k++) (
myOutputValues->
copyOutput(j) )->addDerivative(3*natoms+3*k+i,virial(k,i));
122 plumed_merror(
"not implemented or tested yet");
135 for(
unsigned j=0;j<nvals;++j){
144 bool hasforce=
false; outforces.assign(outforces.size(),0.0);
146 std::vector<double> eforces( nextra, 0.0 );
150 for(
unsigned j=0;j<outforces.size();++j) outforces[j]+=
forces[j];
151 for(
unsigned j=0;j<nextra;++j) eforces[j]+=
forces[ outforces.size()+j ];
std::string description()
Should not be called.
TensorGeneric< m, n > transpose() const
return the transpose matrix
Class implementing fixed size matrices of doubles.
TensorGeneric< n, l > matmul(const TensorGeneric< n, m > &a, const TensorGeneric< m, l > &b)
double getNLTolerance() const
Return the value for the neighbor list tolerance.
virtual bool checkNumericalDerivatives() const
Check if numerical derivatives should be performed.
virtual unsigned getNumberOfDerivatives()=0
Get the number of derivatives for final calculated quantity.
bool calculate()
Actually do the calculation.
virtual void calculate()=0
Calculate an Action.
This is used to create PLMD::Action objects that take the output from some other Action as input...
std::vector< double > thisval
The value of the current element in the sum.
void prepare()
Jobs to do before the task list starts.
Used to create a PLMD::Action that has some scalar or vectorial output that may or may not have some ...
void setOutputAction(ActionWithVessel *myOutputAction)
Setup the action we are outputting to.
void clearAfterTask()
Clear tempory data that is calculated for each task.
void resizeBuffer(const unsigned &n)
Set the size of the data buffer.
Action used to create objects that access the positions of the atoms from the MD code.
void resize()
Resize the quantities in the vessel.
Value * copyOutput(const std::string &name) const
Return a pointer to the value with name (this is used to retrieve values in other PLMD::Actions) You ...
bool applyForce(std::vector< double > &forces)
Apply some force.
VectorGeneric< n > delta(const VectorGeneric< n > &v1, const VectorGeneric< n > &v2)
bool calculateAllVessels()
This loops over all the vessels calculating them and also sets all the element derivatives equal to z...
virtual void performTask(const unsigned &j)=0
Calculate one of the functions in the distribution.
This class is used to pass the input to Vessels.
unsigned getNumberOfVessels() const
Get the number of vessels.
double getOutputQuantity(const unsigned j) const
Get the value of one of the components of the PLMD::Action.
double getTolerance() const
Return the value of the tolerance.
void finish()
Finish the calculation.
virtual void doJobsRequiredBeforeTaskList()
Do any jobs that are required before the task list is undertaken.
int getNumberOfComponents() const
Returns the number of values defined.
ActionWithValue * myOutputValues
void completeNumericalDerivatives()
Calculate numerical derivatives.
const Tensor & getBox() const
Get position of i-th atom.
unsigned getNumberOfAtoms() const
Get number of available atoms.
ActionWithVessel * myOutputAction
virtual void applyBridgeForces(const std::vector< double > &bb)
Apply forces from bridge vessel - this is rarely used - currently only in ActionVolume.
bool contributorsAreUnlocked
The terms in the series are locked.
void resizeFunctions()
Resize all the functions when the number of derivatives change.
std::vector< double > mynumerical_values
std::vector< double > forces
void finishComputations()
Finish running all the calculations.
Vessel * getPntrToVessel(const unsigned &i)
Get a pointer to the ith vessel.
ActionWithVessel * getAction()
Return a pointer to the action we are working in.
This is used to create PLMD::Action objects that are computed by calculating the same function multip...
BridgeVessel(const VesselOptions &)