1 #ifndef SIMP_SPHERICAL_TABULATED_EXTERNAL_H 2 #define SIMP_SPHERICAL_TABULATED_EXTERNAL_H 11 #include <simp/boundary/Boundary.h> 12 #include <util/space/Dimension.h> 13 #include <util/param/ParamComposite.h> 94 void set(std::string name,
double value);
99 double get(std::string name)
const;
133 static const int MaxAtomType = 6;
136 std::string filename_;
172 Vector origin = boundaryPtr_->lengths();
174 double rSq = boundaryPtr_->distanceSq(position, origin);
176 double r = sqrt(rSq);
177 int k = (int) (r/dr_);
178 double fp = r - k*dr_;
183 double fm = 1.0 - fp;
184 return fm*potentials_[type][k] + fp*potentials_[type][k+1];
198 Vector origin = boundaryPtr_->lengths();
200 double rSq = boundaryPtr_->distanceSq(position, origin, force);
202 double r = sqrt(rSq);
203 int k = (int) (r/dr_);
206 double fs = potentials_[type][k] - potentials_[type][k+1];
const int Dimension
Dimensionality of space.
A Vector is a Cartesian vector.
SphericalTabulatedExternal & operator=(const SphericalTabulatedExternal &other)
Assignment.
An orthorhombic periodic unit cell.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
std::string className() const
Return name string for this interaction class.
Saving / output archive for binary ostream.
double energy(const Vector &position, int i) const
Returns external potential energy of a single particle.
Utility classes for scientific computation.
SphericalTabulatedExternal()
Default constructor.
void readParameters(std::istream &in)
Read potential parameters, and initialize other variables.
Dynamically allocatable contiguous array template.
Saving archive for binary istream.
The potential is independent on the type of atoms.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
void setBoundary(Boundary &boundary)
Set pointer to Boundary.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
void setNAtomType(int nAtomType)
Set nAtomType value.
An object that can read multiple parameters from file.
void getForce(const Vector &position, int type, Vector &force) const
Returns force caused by the external potential.