10 #include <util/mpi/MpiLoader.h> 25 : maxPairCutoff_(0.0),
97 UTIL_THROW(
"Cannot modify epsilon before LJPair is initialized");
130 UTIL_THROW(
"Cannot modify sigma before LJPair is initialized");
162 UTIL_THROW(
"nAtomType must be set before readParam");
166 readCArray2D<double> (in,
"epsilon",
epsilon_[0],
168 readCArray2D<double>(in,
"sigma",
sigma_[0],
170 readCArray2D<double>(in,
"cutoff",
cutoff_[0],
179 eps48_[i][j] = 48.0*epsilon_[i][j];
180 sigmaSq_[i][j] = sigma_[i][j]*sigma_[i][j];
181 cutoffSq_[i][j] = cutoff_[i][j]*cutoff_[i][j];
184 ljShift_[i][j] = -4.0*epsilon_[i][j]*(r6i*r6i - r6i);
199 UTIL_THROW(
"nAtomType must be set before readParam");
203 loadCArray2D<double>(ar,
"epsilon",
epsilon_[0],
205 loadCArray2D<double>(ar,
"sigma",
sigma_[0],
207 loadCArray2D<double>(ar,
"cutoff",
cutoff_[0],
272 if (name ==
"epsilon") {
274 eps48_[i][j] = 48.0*value;
280 if (name ==
"sigma") {
307 if (name ==
"epsilon") {
310 if (name ==
"sigma") {
313 if (name ==
"cutoff") {
double sigmaSq_[MaxAtomType][MaxAtomType]
square of sigma[][].
LJPair()
Default constructor.
double epsilon_[MaxAtomType][MaxAtomType]
LJ interaction energies.
double ljShift_[MaxAtomType][MaxAtomType]
shift in LJ potential.
void setEpsilon(int i, int j, double epsilon)
Set LJ interaction energy for a specific pair of Atom types.
double eps48_[MaxAtomType][MaxAtomType]
48*epsilon
int nAtomType_
Total number of atom types.
Classes used by all simpatico molecular simulations.
double get(std::string name, int i, int j) const
Get a parameter value, identified by a string.
double sigma(int i, int j) const
Get LJ range for a specific pair of Atom types.
void set(std::string name, int i, int j, double value)
Modify a parameter, identified by a string.
Saving / output archive for binary ostream.
double epsilon(int i, int j) const
Get LJ interaction energy for a specific pair of Atom types.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
void pack(const T &data)
Pack one object of type T.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
Utility classes for scientific computation.
double sigma_[MaxAtomType][MaxAtomType]
LJ range parameters.
double cutoff_[MaxAtomType][MaxAtomType]
LJ cutoff distance.
double maxPairCutoff() const
Get maximum of pair cutoff distance, for all atom type pairs.
double cutoffSq_[MaxAtomType][MaxAtomType]
square of cutoff[][].
void setSigma(int i, int j, double sigma)
Get LJ range for a specific pair of Atom types.
Saving archive for binary istream.
bool isInitialized_
Was this object initialized by calling (read|load)Parameters ?
Provides methods for MPI-aware loading of data from input archive.
A cutoff, shifted Lennard-Jones nonbonded pair interaction.
void setClassName(const char *className)
Set class name string.
static const int MaxAtomType
Maximum allowed value for nAtomType (# of atom types)
double maxPairCutoff_
Maximum pair potential cutoff radius, for all monomer type pairs.
LJPair & operator=(const LJPair &other)
Assignment.
void setNAtomType(int nAtomType)
Set nAtomType value.
void readParameters(std::istream &in)
Read epsilon, sigma, and cutoff, and initialize other variables.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.