Simpatico  v1.10
McConfigIo.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 "McConfigIo.h"
9 #include <mcMd/chemistry/Atom.h>
10 
11 namespace McMd
12 {
13 
14  using namespace Util;
15 
16  /*
17  * Constructor.
18  */
20  : McMdConfigIo(system)
21  {}
22 
23  /*
24  * Destructor.
25  */
27  {}
28 
29  /*
30  * Read data for one atom.
31  */
32  void McConfigIo::readAtom(std::istream &in, Atom& atom)
33  {
34  in >> atom.position();
35  boundary().shift(atom.position());
36  }
37 
38  /*
39  * Write data for one atom.
40  */
41  void McConfigIo::writeAtom(std::ostream &out, const Atom& atom)
42  { out << atom.position() << std::endl; }
43 
44 }
Boundary & boundary() const
Get the Boundary.
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
McConfigIo(System &system)
Constructor.
Definition: McConfigIo.cpp:19
Base class for default Mc and Md configIos.
Definition: McMdConfigIo.h:31
A point particle within a Molecule.
Utility classes for scientific computation.
Definition: accumulators.mod:1
void shift(Vector &r) const
Shift Cartesian Vector r to its primary image.
virtual void readAtom(std::istream &out, Atom &atom)
Read data for one atom.
Definition: McConfigIo.cpp:32
virtual void writeAtom(std::ostream &out, const Atom &atom)
Write data for one atom.
Definition: McConfigIo.cpp:41
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
virtual ~McConfigIo()
Destructor.
Definition: McConfigIo.cpp:26
const Vector & position() const
Get the position Vector by const reference.