Simpatico  v1.10
ddMd/configIos/LammpsConfigIo.h
1 #ifndef DDMD_LAMMPS_CONFIG_IO_H
2 #define DDMD_LAMMPS_CONFIG_IO_H
3 
4 /*
5 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
6 *
7 * Copyright 2010 - 2017, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include <ddMd/configIos/ConfigIo.h>
12 #include <ddMd/chemistry/Group.h>
13 #include <util/space/Vector.h>
14 
15 #include <vector>
16 
17 namespace DdMd
18 {
19 
20  class Simulation;
21 
22  using namespace Util;
23 
33  class LammpsConfigIo : public ConfigIo
34  {
35 
36  public:
37 
42 
48  LammpsConfigIo(Simulation& simulation);
49 
66  virtual void readConfig(std::ifstream& file, MaskPolicy maskPolicy);
67 
77  virtual void writeConfig(std::ofstream& file);
78 
79  private:
80 
81  int nAtomType_;
82 
83  int nBondType_;
84 
85  int nAngleType_;
86 
87  int nDihedralType_;
88 
89  int nImproperType_;
90 
91  struct IoAtom {
92  Vector position;
93  Vector velocity;
94  int typeId;
95  int id;
96 
97  IoAtom()
98  : position(0.0),
99  velocity(0.0),
100  typeId(-1),
101  id(-1)
102  {}
103 
104  };
105 
109  std::vector<IoAtom> atoms_;
110 
111  template <int N>
112  struct IoGroup {
113  int id;
114  Group<N> group;
115  };
116 
120  template <int N>
121  void readGroups(std::ifstream& file, const char* sectionLabel,
122  int nGroup, GroupDistributor<N>& distributor);
123 
127  template <int N>
128  void writeGroups(std::ofstream& file, const char* sectionLabel,
129  GroupStorage<N>& storage, GroupCollector<N>& collector);
130 
131  };
132 
133 }
134 #endif
A Vector is a Cartesian vector.
Definition: Vector.h:75
Lammps data file format for configuration files.
Parallel domain decomposition (DD) MD simulation.
Main object for a domain-decomposition MD simulation.
Class for collecting Groups from processors to master processor.
Utility classes for scientific computation.
Definition: accumulators.mod:1
MaskPolicy
Enumeration of policies for suppressing ("masking") some pair interactions.
A container for all the Group<N> objects on this processor.
Abstract reader/writer for configuration files.
A group of covalently interacting atoms.
Class template for distributing Group<N> objects among processors.