1 #ifndef SIMP_DPD_PAIR_H 2 #define SIMP_DPD_PAIR_H 11 #include <util/param/ParamComposite.h> 110 void set(std::string name,
int i,
int j,
double value);
124 double energy(
double rsq,
int i,
int j)
const;
148 double forceOverR(
double rsq,
int i,
int j)
const;
157 double cutoffSq(
int i,
int j)
const;
171 double get(std::string name,
int i,
int j)
const;
184 double epsilon(
int i,
int j)
const;
193 double sigma(
int i,
int j)
const;
200 static const int MaxAtomType = 4;
203 double epsilon_[MaxAtomType][MaxAtomType];
204 double sigma_[MaxAtomType][MaxAtomType];
205 double sigmaSq_[MaxAtomType][MaxAtomType];
206 double ce_[MaxAtomType][MaxAtomType];
207 double cf_[MaxAtomType][MaxAtomType];
214 double maxPairCutoff_;
232 if (rsq < sigmaSq_[i][j]) {
233 dr = sqrt(rsq) - sigma_[i][j];
234 return ce_[i][j]*dr*dr;
245 if (rsq < sigmaSq_[i][j]) {
246 return cf_[i][j]*(sigma_[i][j]/sqrt(rsq) - 1.0);
256 {
return sigmaSq_[i][j]; }
double forceOverR(double rsq, int i, int j) const
Returns ratio of scalar pair interaction force to pair separation.
void setEpsilon(int i, int j, double epsilon)
Set LJ interaction energy for a specific pair of Atom types.
double cutoffSq(int i, int j) const
Get square of cutoff distance for specific type pair.
Soft pair potential used in dissipative particle dynamics (DPD) simulations of Groot, Warren et al.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
Saving / output archive for binary ostream.
double sigma(int i, int j) const
Get range for a specific pair of Atom types.
DpdPair & operator=(const DpdPair &other)
Assignment.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
Utility classes for scientific computation.
void readParameters(std::istream &in)
Read epsilon and sigma, initialize other variables.
double energy(double rsq, int i, int j) const
Returns interaction energy for a single pair of particles.
Saving archive for binary istream.
An object that can read multiple parameters from file.
void setSigma(int i, int j, double sigma)
Get LJ range for a specific pair of Atom types.
double epsilon(int i, int j) const
Get interaction energy for a specific pair of Atom types.
double maxPairCutoff() const
Get maximum of pair cutoff distance, for all atom type pairs.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
void setNAtomType(int nAtomType)
Set nAtomType value.