8 #include "CosineDihedral.h" 22 for (
int i = 0; i < MaxNDihedralType; ++i) {
31 : nDihedralType_(other.nDihedralType_)
32 {
for (
int i = 0; i < nDihedralType_; ++i) kappa_[i] = other.kappa_[i]; }
39 nDihedralType_ = other.nDihedralType_;
40 for (
int i = 0; i < nDihedralType_; ++i) kappa_[i] = other.kappa_[i];
49 if (nDihedralType > MaxNDihedralType) {
50 UTIL_THROW(
"nDihedralType > CosineDihedral::MaxNDihedralType");
52 nDihedralType_ = nDihedralType;
60 if (nDihedralType_ <= 0) {
61 UTIL_THROW(
"nDihedralType must be set before readParam");
63 readCArray<double>(in,
"kappa", kappa_, nDihedralType_);
72 if (nDihedralType_ <= 0) {
75 loadCArray<double> (ar,
"kappa", kappa_, nDihedralType_);
84 ar.
pack(kappa_, nDihedralType_);
92 if (name ==
"kappa") {
105 if (name ==
"kappa") {
106 value = kappa_[type];
117 {
return std::string(
"CosineDihedral"); }
std::string className() const
Return name string "CosineDihedral" for this evaluator class.
void setNDihedralType(int nDihedralType)
Set the number of dihedral types.
void set(std::string name, int type, double value)
Modify a parameter, identified by a string.
Classes used by all simpatico molecular simulations.
CosineDihedral()
Default constructor.
Saving / output archive for binary ostream.
#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.
CosineDihedral & operator=(const CosineDihedral &other)
Assignment.
Utility classes for scientific computation.
double get(std::string name, int type) const
Get a parameter value, identified by a string.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
Saving archive for binary istream.
void setClassName(const char *className)
Set class name string.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
A dihedral potential proportional to cos(phi).
void readParameters(std::istream &in)
Read dihedral interaction parameters from input stream.