22 , angleType_(NullIndex)
25 , dihedralType_(NullIndex)
29 for (
int i=0; i < 2; ++i) {
41 for (
int i=0; i < 2; ++i) {
42 if (blockLengths_[i] < 1) {
43 UTIL_THROW(
"Invalid blockLength for diblock.");
46 nAtom_ = blockLengths_[0] + blockLengths_[1];
47 readCArray<int>(in,
"atomTypes",
atomTypes_, 2);
50 read<int>(in,
"bondType", bondType_);
54 readOptional<int>(in,
"hasAngles",
hasAngles_);
57 UTIL_THROW(
"Error: Cannot have angles with nAtom < 3");
60 read<int>(in,
"angleType", angleType_);
71 UTIL_THROW(
"Error: Cannot have dihedrals with nAtom < 4");
74 read<int>(in,
"dihedralType", dihedralType_);
89 for (
int i=0; i < 2; ++i) {
90 if (blockLengths_[i] < 1) {
91 UTIL_THROW(
"Invalid blockLength for diblock.");
94 nAtom_ = blockLengths_[0] + blockLengths_[1];
95 loadCArray<int>(ar,
"atomTypes",
atomTypes_, 2);
98 loadParameter<int>(ar,
"bondType", bondType_);
101 loadParameter<int>(ar,
"hasAngles",
hasAngles_,
false);
104 UTIL_THROW(
"Error: Cannot have angles with nAtom < 3");
107 loadParameter<int>(ar,
"angleType", angleType_);
117 UTIL_THROW(
"Error: Cannot have dihedrals with nAtom < 4");
120 loadParameter<int>(ar,
"dihedralType", dihedralType_);
168 {
return bondType_; }
175 {
return angleType_; }
183 {
return dihedralType_; }
int moleculeCapacity_
Number of molecules associated with the species.
virtual int calculateAtomTypeId(int index) const
Return the atom type for a specific atom.
virtual int calculateDihedralTypeId(int index) const
Return same dihedral type for any dihedral in any chain.
virtual int calculateBondTypeId(int index) const
Return same bond type for any bond in any chain.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
virtual void loadSpeciesParam(Serializable::IArchive &ar)
Load species structure from an Archive.
int hasAngles_
Does this chain have angle potentials (0 = false, 1 = true).
static const int NullIndex
Null (unknown) value for any non-negative index.
int nAtom_
Number of atoms per molecule.
Saving / output archive for binary ostream.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
virtual void readSpeciesParam(std::istream &in)
Read block lengths length and and types.
void pack(const T &data)
Pack one object of type T.
Diblock()
Default constructor.
Utility classes for scientific computation.
int nDihedral_
Number of dihedrals per molecule.
int nAngle_
Number of angles per molecule.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
Saving archive for binary istream.
int hasDihedrals_
Does this chain have dihedral potentials (0 = false, 1 = true).
void buildLinear()
Build the chemical structure for a linear molecule.
void setClassName(const char *className)
Set class name string.
int atomTypes_[2]
Particle type ids for each block.
static void saveOptional(Serializable::OArchive &ar, Type &value, bool isActive)
Save an optional parameter value to an output archive.
int nBond_
Number of bonds per molecule.
A Species of linear polymers (abstract).
virtual int calculateAngleTypeId(int index) const
Return same angle type for any angle in any chain.
int blockLengths_[2]
Number of particles in each block.