23 #include "tools/SwitchingFunction.h"
24 #include "core/ActionRegister.h"
32 namespace multicolvar{
67 static void registerKeywords(
Keywords& keys );
70 virtual double compute(
const unsigned& j );
72 void calculateWeight();
77 PLUMED_REGISTER_ACTION(Bridge,
"BRIDGE")
80 MultiColvar::registerKeywords( keys );
82 keys.add(
"atoms-2",
"BRIDGING_ATOMS",
"The list of atoms that can form the bridge between the two interesting parts "
84 keys.add(
"atoms-2",
"GROUPA",
"The list of atoms that are in the first interesting part of the structure");
85 keys.add(
"atoms-2",
"GROUPB",
"The list of atoms that are in the second interesting part of the structure");
86 keys.add(
"optional",
"SWITCH",
"The parameters of the two \\ref switchingfunction in the above formula");
87 keys.add(
"optional",
"SWITCHA",
"The \\ref switchingfunction on the distance between bridging atoms and the atoms in "
89 keys.add(
"optional",
"SWITCHB",
"The \\ref switchingfunction on the distance between the bridging atoms and the atoms in "
100 std::string sfinput,errors;
parse(
"SWITCH",sfinput);
101 if( sfinput.length()>0 ){
103 if( errors.length()!=0 )
error(
"problem reading SWITCH keyword : " + errors );
105 if( errors.length()!=0 )
error(
"problem reading SWITCH keyword : " + errors );
107 parse(
"SWITCHA",sfinput);
108 if(sfinput.length()>0){
111 if( errors.length()!=0 )
error(
"problem reading SWITCHA keyword : " + errors );
112 sfinput.clear();
parse(
"SWITCHB",sfinput);
113 if(sfinput.length()==0)
error(
"found SWITCHA keyword without SWITCHB");
115 if( errors.length()!=0 )
error(
"problem reading SWITCHB keyword : " + errors );
117 error(
"missing definition of switching functions");
120 log.
printf(
" distance between bridging atoms and atoms in GROUPA must be less than %s\n",
sf1.
description().c_str());
121 log.
printf(
" distance between bridging atoms and atoms in GROUPB must be less than %s\n",
sf2.
description().c_str());
126 std::string fake_input;
void addAtomsDerivativeOfWeight(const unsigned &i, const Vector &wder)
Set the derivative of the weight (used in MEAN and HISTOGRAM)
double calculate(double x, double &df) const
Log & log
Reference to the log stream.
void calculateWeight()
Returns the number of coordinates of the field.
virtual double compute(const unsigned &j)
Actually compute the colvar.
void readAtoms(int &natoms)
Read in all the keywords that can be used to define atoms.
Vector getSeparation(const Vector &vec1, const Vector &vec2) const
Get the separation between a pair of vectors.
double modulo() const
Compute the modulo.
Class implementing fixed size vectors of doubles.
Vector getCentralAtom()
Get the position of the central atom.
void set(int nn, int mm, double r_0, double d_0)
void error(const std::string &msg) const
Crash calculation and print documentation.
void checkRead()
Check if Action was properly read.
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.
Provides the keyword BRIDGE
Small class to compure switching functions in the form In the future we might extend it so as to be s...
void readVesselKeywords()
Complete the setup of this object (this routine must be called after construction of ActionWithValue)...
void addCentralAtomDerivatives(const unsigned &iatom, const Tensor &der)
Add derivatives to the central atom position.
bool weightHasDerivatives
Does the weight have derivatives.
static TensorGeneric< n, n > identity()
return an identity tensor
void parse(const std::string &key, T &t)
Parse one keyword as generic type.
This class holds the keywords and their documentation.
#define PLUMED_MULTICOLVAR_INIT(ao)
void addBoxDerivatives(const Tensor &)
Add some derivatives to the virial.
This class is used to bring the relevant information to the Action constructor.
int printf(const char *fmt,...)
Formatted output with explicit format - a la printf.
void setWeight(const double &weight)
Set a weight for this colvar (used in MEAN and HISTOGRAM)
bool isPeriodic()
Are the base quantities periodic.
void addAtomsDerivatives(const int &, const Vector &)
Add some derivatives for an atom.
unsigned getNumberOfVessels() const
Get the number of vessels.
const Vector & getPosition(unsigned) const
Get the position of atom iatom.
double getTolerance() const
Return the value of the tolerance.
This is the abstract base class to use for creating distributions of colvars and functions thereof...
void readThreeGroups(const std::string &key1, const std::string &key2, const std::string &key3, const bool &allow2)
Read three groups.
std::string description() const
void addBoxDerivativesOfWeight(const Tensor &vir)