22 #include "vesselbase/VesselRegister.h"
23 #include "vesselbase/ActionWithVessel.h"
28 #define CATOMS_MAXATOMS 2
31 namespace multicolvar {
45 unsigned bsize=0;
start.resize( nfunc +1 );
46 for(
unsigned i=0;i<nfunc;++i){
71 "increase CATOMS_MAXATOMS in StoreCentralAtomsVessel");
79 for(
unsigned i=0;i<3;++i){
93 plumed_dbg_assert( ivec<mycolv->colvar_atoms.size() );
95 for(
unsigned i=0;i<3;++i){
99 plumed_dbg_assert( pos==
start[ivec+1] );
104 plumed_dbg_assert( iatom<mycolv->colvar_atoms.size() );
107 for(
unsigned ider=0;ider<
active_atoms[iatom].getNumberActive();++ider){
108 unsigned ibuf=
start[iatom] + 1 + 3*ider; thisder.zero();
109 for(
unsigned jcomp=0;jcomp<3;++jcomp){
121 plumed_dbg_assert( iatom<mycolv->colvar_atoms.size() );
124 for(
unsigned ider=0;ider<
active_atoms[iatom].getNumberActive();++ider){
125 unsigned ibuf=
start[iatom] + 1 + 3*ider; thisder.zero();
126 for(
unsigned jcomp=0;jcomp<3;++jcomp){
138 plumed_dbg_assert( iatom<mycolv->colvar_atoms.size() );
141 for(
unsigned ider=0;ider<
active_atoms[iatom].getNumberActive();++ider){
142 unsigned ibuf=
start[iatom] + 1 + 3*ider; thisder.zero();
143 for(
unsigned jcomp=0;jcomp<3;++jcomp){
144 for(
unsigned kcomp=0;kcomp<3;++kcomp){
std::vector< Tensor > central_derivs
unsigned current
The numerical index of the task we are curently performing.
void addAtomsDerivatives(const int &, const Vector &)
Add some derivatives for an atom.
void addCentralAtomDerivatives(const unsigned &iatom, const Tensor &der)
Add derivative of central atom position wrt to position of iatom'th atom.
void addAtomsDerivativeOfWeight(const unsigned &iatom, const Vector &df, MultiColvarFunction *funcout) const
Add derivatives of the weight wrt to the central atom position.
bool calculate()
This makes sure all vectors are stored.
void resize()
This does the resizing of the buffer.
void mpi_gatherActiveMembers(Communicator &comm, std::vector< DynamicList< U > > &ll)
void addToBufferElement(const unsigned &i, const double &val)
Add something to the ith element in the buffer.
Class implementing fixed size matrices of doubles.
Class implementing fixed size vectors of doubles.
std::vector< DynamicList< unsigned > > active_atoms
void addAtomsDerivatives(const unsigned &iatom, const Vector &df, MultiColvarFunction *funcout) const
Add derivatives to central atom position.
std::vector< unsigned > start
Communicator & comm
A copy of the communicator.
double getBufferElement(const unsigned &i) const
Get the value in the ith element of the buffer.
void addDerivativeOfCentralAtomPos(const unsigned &iatom, const Tensor &df, MultiColvarFunction *funcout) const
Add derivative to the central atom position.
DynamicList< unsigned > atomsWithCatomDer
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...
void resizeBuffer(const unsigned &n)
Set the size of the data buffer.
Vector retrieveCentralAtomPos()
Retrieve the position of the central atom.
This class is used to pass the input to Vessels.
Vector getPosition(const unsigned &) const
Get the orientation of the ith vector.
StoreCentralAtomsVessel(const vesselbase::VesselOptions &)
Constructor.
This is the abstract base class to use for creating distributions of colvars and functions thereof...
void finish()
This should mpi gather the active atoms.
unsigned getNumberOfAtoms() const
Get number of available atoms.
unsigned getNumberActive() const
Return the number of elements that are currently active.
void addAtomsDerivativeOfWeight(const unsigned &i, const Vector &wder)
Set the derivative of the weight (used in MEAN and HISTOGRAM)
ActionWithVessel * getAction()
Return a pointer to the action we are working in.