Simpatico  v1.10
mcMd/analyzers/system/ConfigWriter.h
1 #ifndef MCMD_CONFIG_WRITER_H
2 #define MCMD_CONFIG_WRITER_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 <mcMd/analyzers/SystemAnalyzer.h>
12 #include <mcMd/simulation/System.h>
13 
14 namespace McMd
15 {
16 
17  using namespace Util;
18 
36  class ConfigWriter : public SystemAnalyzer<System>
37  {
38 
39  public:
40 
46  ConfigWriter(System& system);
47 
51  virtual ~ConfigWriter()
52  {}
53 
59  virtual void readParameters(std::istream& in);
60 
66  virtual void save(Serializable::OArchive& ar);
67 
73  virtual void loadParameters(Serializable::IArchive& ar);
74 
81  template <class Archive>
82  void serialize(Archive& ar, const unsigned int version);
83 
87  virtual void setup();
88 
94  virtual void sample(long iStep);
95 
96  private:
97 
98  // Output file stream
99  std::ofstream outputFile_;
100 
102  long nSample_;
103 
105  long isInitialized_;
106 
107  };
108 
109  /*
110  * Serialize to/from an archive.
111  */
112  template <class Archive>
113  void ConfigWriter::serialize(Archive& ar, const unsigned int version)
114  {
115  Analyzer::serialize(ar, version);
116  ar & nSample_;
117  }
118 
119 }
120 #endif
Periodically dump system configuration to a new file.
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
void serialize(Archive &ar, PairSelector &selector, const unsigned int version)
Serialize a PairSelector.
Definition: PairSelector.h:167
Saving / output archive for binary ostream.
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Template for Analyzer associated with one System.
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.