22 #include "core/ActionRegister.h"
23 #include "tools/Pbc.h"
68 namespace multicolvar {
88 keys.add(
"atoms",
"ATOM",
"the atom whose vicinity we are interested in examining");
89 keys.add(
"compulsory",
"XLOWER",
"0.0",
"the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box).");
90 keys.add(
"compulsory",
"XUPPER",
"0.0",
"the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box).");
91 keys.add(
"compulsory",
"YLOWER",
"0.0",
"the lower boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box).");
92 keys.add(
"compulsory",
"YUPPER",
"0.0",
"the upper boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box).");
93 keys.add(
"compulsory",
"ZLOWER",
"0.0",
"the lower boundary in z relative to the z coordinate of the atom (0 indicates use full extent of box).");
94 keys.add(
"compulsory",
"ZUPPER",
"0.0",
"the upper boundary in z relative to the z coordinate of the atom (0 indicates use full extent of box).");
101 std::vector<AtomNumber> atom;
103 if( atom.size()!=1 )
error(
"should only be one atom specified");
104 log.
printf(
" boundaries for region are calculated based on positions of atom : %d\n",atom[0].
serial() );
112 if( !
dox && !
doy && !
doz )
error(
"no subregion defined use XLOWER, XUPPER, YLOWER, YUPPER, ZLOWER, ZUPPER");
123 double xcontr, ycontr, zcontr, xder, yder, zder;
142 derivatives[0]=xder*ycontr*zcontr;
143 derivatives[1]=xcontr*yder*zcontr;
144 derivatives[2]=xcontr*ycontr*zder;
149 return xcontr*ycontr*zcontr;
Log & log
Reference to the log stream.
void addBoxDerivatives(const Tensor &vir)
Add derivatives wrt to the virial.
static void registerKeywords(Keywords &keys)
Class implementing fixed size vectors of doubles.
void error(const std::string &msg) const
Crash calculation and print documentation.
void checkRead()
Check if Action was properly read.
void parseAtomList(const std::string &key, std::vector< AtomNumber > &t)
Parse a list of atoms without a numbered keyword.
void parse(const std::string &key, T &t)
Parse one keyword as generic type.
This class holds the keywords and their documentation.
A class for calculating whether or not values are within a given range using : .
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.
Base class for all the input Actions.
This is the abstract base class to use for implementing a new way of definining a particular region o...
void set(const std::string ¶ms, const std::string &dd, std::string &errormsg)
Provides the keyword AROUND
HistogramBead bead
The bead for the histogram.
double calculateNumberInside(const Vector &cpos, HistogramBead &bead, Vector &derivatives)
void addReferenceAtomDerivatives(const unsigned &iatom, const Vector &der)
Add derivatinve to one of the reference atoms here.
Vector pbcDistance(const Vector &v1, const Vector &v2) const
Calculate distance between two points.
bool serial
Do all calculations in serial.
static void registerKeywords(Keywords &keys)
std::vector< double > derivatives
Vector of derivatives for the object.
double calculate(double x, double &df) const
VolumeAround(const ActionOptions &ao)
const Vector & getPosition(int iatom)
Get position of atom.
void requestAtoms(const std::vector< AtomNumber > &atoms)
Request the atoms.