Simpatico  v1.10
LinearSG.h
1 #ifndef MCMD_LINEAR_SG_H
2 #define MCMD_LINEAR_SG_H
3 
4 /*
5 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
6 *
7 * Copyright 2010 - 2014, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include "SpeciesMutator.h" // base class
12 #include <simp/species/Linear.h> // base class
13 #include <util/containers/DArray.h> // member template
14 #include <util/containers/Pair.h> // member
15 
16 namespace McMd
17 {
18 
19  using namespace Util;
20  using namespace Simp;
21 
32  {
33 
34  public:
35 
39  LinearSG();
40 
44  virtual ~LinearSG();
45 
49  virtual void readParameters(std::istream& in);
50 
57  virtual void setMoleculeState(Molecule& molecule, int stateId);
58 
64  virtual void save(Serializable::OArchive &ar);
65 
66 
67  protected:
68 
74  virtual void readSpeciesParam(std::istream &in);
75 
81  virtual void loadSpeciesParam(Serializable::IArchive &ar);
82 
89  virtual int calculateAtomTypeId(int index) const;
90 
97  virtual int calculateBondTypeId(int index) const;
98 
99  #ifdef SIMP_ANGLE
100 
106  virtual int calculateAngleTypeId(int index) const;
107  #endif
108 
109  #ifdef SIMP_DIHEDRAL
110 
116  virtual int calculateDihedralTypeId(int index) const;
117  #endif
118 
119 
120  private:
121 
122  //Type index for all bonds
123  int bondType_;
124 
125  #ifdef SIMP_ANGLE
126  //Type index for all angles (if any)
127  int angleType_;
128  #endif
129 
130  #ifdef SIMP_DIHEDRAL
131  //Type index for all dihedrals (if any)
132  int dihedralType_;
133  #endif
134 
135  // A Pair of atom type indexes.
136  Pair<int> typeIds_;
137 
138  // Ratio of statistical weights for typeId[0]/typeId[1]
139  double weightRatio_;
140 
141  // Array with the identity of each bead for subtype 0
142  DArray<int> beadTypeIds0_;
143 
144  // Array with the identity of each bead for subtype 1
145  DArray<int> beadTypeIds1_;
146 
147  };
148 
149 }
150 #endif
A mutable linear polymer, for semigrand ensemble.
Definition: LinearSG.h:31
Classes used by all simpatico molecular simulations.
Mix-in class for mutable subclasses of Species.
Saving / output archive for binary ostream.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
A physical molecule (a set of covalently bonded Atoms).
A Species of linear polymers (abstract).
Definition: Linear.h:36