Simpatico  v1.10
HomoRing.cpp
1 /*
2 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
3 *
4 * Copyright 2010 - 2017, The Regents of the University of Minnesota
5 * Distributed under the terms of the GNU General Public License.
6 */
7 
8 #include "HomoRing.h"
9 
10 namespace Simp
11 {
12 
13  using namespace Util;
14 
15  /*
16  * Default constructor.
17  */
19  : Ring(),
20  type_(NullIndex)
21  { setClassName("HomoRing"); }
22 
23  /*
24  * Read nAtom and type.
25  */
26  void HomoRing::readSpeciesParam(std::istream &in)
27  {
28  read<int>(in,"nAtom", nAtom_);
29  read<int>(in,"type", type_);
30  nBond_ = nAtom_;
31  #ifdef SIMP_ANGLE
32  nAngle_ = nAtom_;
33  #endif
34  #ifdef SIMP_DIHEDRAL
36  #endif
37  buildRing();
38  }
39 
40  /*
41  * Read nAtom and type.
42  */
44  {
45  loadParameter<int>(ar, "nAtom", nAtom_);
46  loadParameter<int>(ar, "type", type_);
47  nBond_ = nAtom_;
48  #ifdef SIMP_ANGLE
49  nAngle_ = nAtom_;
50  #endif
51  #ifdef SIMP_DIHEDRAL
53  #endif
54  buildRing();
55  }
56 
57  /*
58  * Save internal state to an archive.
59  */
61  {
62  ar << id_;
63  ar << moleculeCapacity_;
64  ar << nAtom_;
65  ar << type_;
66  }
67 
68  /*
69  * Return type_ for every atom.
70  */
71  int HomoRing::calculateAtomTypeId(int index) const
72  { return type_; }
73 
74  /*
75  * Return 0 for every bond.
76  */
77  int HomoRing::calculateBondTypeId(int index) const
78  { return 0; }
79 
80  #ifdef SIMP_ANGLE
81  /*
82  * Return 0 for every angle.
83  */
84  int HomoRing::calculateAngleTypeId(int index) const
85  { return 0; }
86  #endif
87 
88  #ifdef SIMP_DIHEDRAL
89  /*
90  * Return 0 for every dihedral.
91  */
92  int HomoRing::calculateDihedralTypeId(int index) const
93  { return 0; }
94  #endif
95 
96 }
int moleculeCapacity_
Number of molecules associated with the species.
void buildRing()
Build the chemical structure for a ring molecule.
Definition: Ring.cpp:31
Classes used by all simpatico molecular simulations.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
Definition: HomoRing.cpp:60
A Species of ring polymers (abstract).
Definition: Ring.h:33
int nAtom_
Number of atoms per molecule.
Saving / output archive for binary ostream.
virtual int calculateBondTypeId(int index) const
Return same bond type for any bond in any loop.
Definition: HomoRing.cpp:77
virtual int calculateDihedralTypeId(int index) const
Return same dihedral type for any homogeneous ring.
Definition: HomoRing.cpp:92
Utility classes for scientific computation.
Definition: accumulators.mod:1
int nDihedral_
Number of dihedrals per molecule.
virtual int calculateAngleTypeId(int index) const
Return same angle type for any homogeneous ring.
Definition: HomoRing.cpp:84
int nAngle_
Number of angles per molecule.
int type_
Particle type id for every particle of every molecule of this species.
Definition: HomoRing.h:53
int id_
Integer index for this Species.
virtual void readSpeciesParam(std::istream &in)
Read nAtom_ and the loop type.
Definition: HomoRing.cpp:26
Saving archive for binary istream.
HomoRing()
Default constructor.
Definition: HomoRing.cpp:18
virtual void loadSpeciesParam(Serializable::IArchive &ar)
Load species structure from an Archive.
Definition: HomoRing.cpp:43
void setClassName(const char *className)
Set class name string.
int nBond_
Number of bonds per molecule.
virtual int calculateAtomTypeId(int index) const
Return the same type for any particle in any loop.
Definition: HomoRing.cpp:71