8 #include "Homopolymer.h" 18 Homopolymer::Homopolymer()
23 , angleType_(NullIndex)
26 , dihedralType_(NullIndex)
35 read<int>(in,
"nAtom", nAtom_);
36 read<int>(in,
"atomType", atomType_);
38 read<int>(in,
"bondType", bondType_);
42 readOptional<int>(in,
"hasAngles", hasAngles_);
45 UTIL_THROW(
"Error: Cannot have angles with nAtom < 3");
48 read<int>(in,
"angleType", angleType_);
56 readOptional<int>(in,
"hasDihedrals", hasDihedrals_);
59 UTIL_THROW(
"Error: Cannot have dihedrals with nAtom < 4");
61 nDihedral_ = nAtom_ - 3;
62 read<int>(in,
"dihedralType", dihedralType_);
76 loadParameter<int>(ar,
"nAtom", nAtom_);
77 loadParameter<int>(ar,
"atomType", atomType_);
79 loadParameter<int>(ar,
"bondType", bondType_);
82 loadParameter<int>(ar,
"hasAngles", hasAngles_,
false);
86 loadParameter<int>(ar,
"angleType", angleType_);
94 loadParameter<int>(ar,
"hasDihedrals", hasDihedrals_,
false);
97 nDihedral_ = nAtom_ - 3;
101 if (nDihedral_ > 0) {
102 loadParameter<int>(ar,
"dihedralType", dihedralType_);
117 ar << moleculeCapacity_;
123 if (hasAngles_ && nAngle_ > 0) {
129 if (hasDihedrals_ && nDihedral_ > 0) {
139 {
return atomType_; }
145 {
return bondType_; }
152 {
return angleType_; }
160 {
return dihedralType_; }
virtual void loadSpeciesParam(Serializable::IArchive &ar)
Load species structure from an Archive.
virtual int calculateBondTypeId(int index) const
Return same bond type for any bond in any chain.
Classes used by all simpatico molecular simulations.
Saving / output archive for binary ostream.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
virtual int calculateDihedralTypeId(int index) const
Return same dihedral type for any dihedral in any chain.
virtual void readSpeciesParam(std::istream &in)
Read nAtom_ and the chain type.
Utility classes for scientific computation.
virtual int calculateAtomTypeId(int index) const
Return the same type for any particle in any chain.
Saving archive for binary istream.
void setClassName(const char *className)
Set class name string.
virtual int calculateAngleTypeId(int index) const
Return same angle type for any angle in any chain.
static void saveOptional(Serializable::OArchive &ar, Type &value, bool isActive)
Save an optional parameter value to an output archive.