23 #include "core/ActionRegister.h"
26 namespace manyrestraints {
46 PLUMED_REGISTER_ACTION(Sphere,
"SPHERICAL_RESTRAINT")
50 keys.add(
"atoms",
"ATOMS",
"the atoms that are being confined to the sphere");
51 keys.add(
"compulsory",
"RADIUS",
"the radius of the sphere");
52 keys.add(
"compulsory",
"KAPPA",
"the force constant for the wall. The k_i in the expression for a wall.");
53 keys.add(
"compulsory",
"OFFSET",
"0.0",
"the offset for the start of the wall. The o_i in the expression for a wall.");
54 keys.add(
"compulsory",
"EXP",
"2.0",
"the powers for the walls. The e_i in the expression for a wall.");
55 keys.add(
"compulsory",
"EPS",
"1.0",
"the values for s_i in the expression for a wall");
56 keys.addFlag(
"NOPBC",
false,
"turn off periodic boundary conditions");
63 std::vector<AtomNumber>
atoms;
102 double value=distance.
modulo();
105 double invvalue= 1.0 / value ;
106 double power = pow( uscale,
exp );
107 double f = invvalue * (
kappa /
eps ) *
exp * power / uscale;
void calculate()
Calculate an Action.
const Vector & getPosition(int) const
Get position of i-th atom.
void parseFlag(const std::string &key, bool &t)
Parse one keyword as boolean flag.
unsigned current
The numerical index of the task we are curently performing.
double modulo() const
Compute the modulo.
Class implementing fixed size vectors of doubles.
void addAtomsDerivatives(const int &, const Vector &)
Add some derivatives to a particular atom.
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.
Provides the keyword SPHERICAL_RESTRAINT
static void registerKeywords(Keywords &keys)
void runAllTasks()
Calculate the values of all the vessels.
Sphere(const ActionOptions &)
void zero()
set it to zero
void parse(const std::string &key, T &t)
Parse one keyword as generic type.
This class holds the keywords and their documentation.
std::vector< double > com_deriv
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.
Base class for all the input Actions.
VectorGeneric< n > delta(const VectorGeneric< n > &v1, const VectorGeneric< n > &v2)
void performTask(const unsigned &j)
Calculate one of the functions in the distribution.
Vector pbcDistance(const Vector &, const Vector &) const
Compute the pbc distance between two positions.
void requestAtoms(const std::vector< AtomNumber > &a)
Request an array of atoms.
void addBoxDerivatives(const Tensor &)
Add some derivatives to the virial.
unsigned getNumberOfAtoms() const
Get number of available atoms.
void createRestraints(const unsigned &nrestraints)
double getMass(int i) const
Get mass of i-th atom.
static void registerKeywords(Keywords &keys)
bool isPeriodic()
Are the base quantities periodic.