8 #include "HomopolymerSG.h" 10 #include <mcMd/simulation/McMd_mpi.h> 27 , angleType_(NullIndex)
30 , dihedralType_(NullIndex)
56 read<int>(in,
"nAtom",
nAtom_);
57 read<int>(in,
"bondType", bondType_);
63 readOptional<int>(in,
"hasAngles",
hasAngles_);
66 UTIL_THROW(
"Error: Cannot have angles with nAtom < 3");
69 read<int>(in,
"angleType", angleType_);
79 UTIL_THROW(
"Error: Cannot have angles with nAtom < 4");
82 read<int>(in,
"angleType", angleType_);
88 read<Pair <int> >(in,
"typeIds", typeIds_);
89 read<double>(in,
"weightRatio", weightRatio_);
94 double sum = weightRatio_ + 1.0;
104 loadParameter<int>(ar,
"nAtom",
nAtom_);
106 loadParameter<int>(ar,
"bondType", bondType_);
110 loadParameter<int>(ar,
"hasAngles",
hasAngles_,
false);
114 loadParameter<int>(ar,
"angleType", angleType_);
131 loadParameter<int>(ar,
"dihedralType", dihedralType_);
142 loadParameter<Pair <int> >(ar,
"typeIds", typeIds_);
143 loadParameter<double>(ar,
"weightRatio", weightRatio_);
146 double sum = weightRatio_ + 1.0;
189 {
return bondType_; }
198 {
return angleType_; }
208 {
return dihedralType_; }
217 for (
int i = 0; i <
nAtom; ++i) {
virtual void loadSpeciesParam(Serializable::IArchive &ar)
Load species structure from an Archive.
virtual int calculateDihedralTypeId(int index) const
Return same dihedral type for any dihedral in any chain.
int nAtom() const
Get number of atoms per molecule for this Species.
int moleculeCapacity_
Number of molecules associated with the species.
void setMutatorPtr(McMd::SpeciesMutator *mutatorPtr)
Set pointer to associated McMd::SpeciesMutator for a mutable species.
void allocateSpeciesMutator(int nMolecule, int nState)
Allocate arrays of molecule state ids and statistical weights.
void setMoleculeStateId(const Molecule &molecule, int stateId)
Set the state id of a specific molecule.
virtual void setMoleculeState(Molecule &molecule, int stateId)
Set the type of all atoms in the molecule.
void setWeight(int stateId, double weight)
Set the statistical weight associated with a specific state.
HomopolymerSG()
Constructor.
Classes used by all simpatico molecular simulations.
virtual int calculateAtomTypeId(int index) const
Return the same type for any particle in any chain.
Mix-in class for mutable subclasses of Species.
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 int calculateAngleTypeId(int index) const
Return same angle type for any angle in any chain.
Utility classes for scientific computation.
int nDihedral_
Number of dihedrals per molecule.
virtual void readParameters(std::istream &in)
Read parameters and initialize.
int nAngle_
Number of angles per molecule.
virtual int calculateBondTypeId(int index) const
Return same bond type for any bond in any chain.
virtual void readParameters(std::istream &in)
Read parameters and initialize structure for this species.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
void setTypeId(int typeId)
Set the atomic type index.
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
int hasDihedrals_
Does this chain have dihedral potentials (0 = false, 1 = true).
virtual void readSpeciesParam(std::istream &in)
Read nAtom, a pair of atom type ids and weightRatio.
void buildLinear()
Build the chemical structure for a linear molecule.
void setClassName(const char *className)
Set class name string.
virtual ~HomopolymerSG()
Destructor.
const Atom & atom(int localId) const
Get a specific Atom in this Molecule.
int capacity() const
Maximum allowed number of molecules for this Species.
A physical molecule (a set of covalently bonded Atoms).
McMd::SpeciesMutator & mutator()
Return the species mutator object by reference.
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).
int nAtom() const
Get the number of Atoms in this Molecule.