Simpatico  v1.10
Point.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 "Point.h"
9 
10 namespace Simp
11 {
12 
13  using namespace Util;
14 
15  /*
16  * Default constructor.
17  */
19  : Species(),
20  type_(-1)
21  {
22  nAtom_ = 1;
23  // nBond_, nAngle_, & nDihedral_ initialized to 0 in Species.
24  }
25 
26  /*
27  * Read type.
28  */
29  void Point::readSpeciesParam(std::istream &in)
30  {
31  read<int>(in,"type", type_);
32  allocate();
33  atomTypeIds_[0] = type_;
34  }
35 
36  /*
37  * Read type.
38  */
40  {
41  loadParameter<int>(ar,"type", type_);
42  allocate();
43  atomTypeIds_[0] = type_;
44  }
45 
46  /*
47  * Save atom type.
48  */
50  {
51  ar << moleculeCapacity_;
52  ar << type_;
53  }
54 
55 }
int moleculeCapacity_
Number of molecules associated with the species.
Classes used by all simpatico molecular simulations.
int nAtom_
Number of atoms per molecule.
Saving / output archive for binary ostream.
DArray< int > atomTypeIds_
Array of atom type Ids, indexed by local atom id.
virtual void readSpeciesParam(std::istream &in)
Read atom type.
Definition: Point.cpp:29
int type_
Atom type id for all molecules of this species.
Definition: Point.h:48
virtual void loadSpeciesParam(Serializable::IArchive &ar)
Load species structure from an Archive.
Definition: Point.cpp:39
Point()
Default constructor.
Definition: Point.cpp:18
Utility classes for scientific computation.
Definition: accumulators.mod:1
Saving archive for binary istream.
void allocate()
Allocate chemical structure arrays.
A Species represents a set of chemically similar molecules.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
Definition: Point.cpp:49