Simpatico  v1.10
CompositionProfile.h
1 #ifndef MCMD_COMPOSITION_PROFILE_H
2 #define MCMD_COMPOSITION_PROFILE_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> // base class template
12 #include <mcMd/simulation/System.h> // base class template parameter
13 #include <util/accumulators/Distribution.h>
14 #include <util/containers/DArray.h> // member template
15 
16 #include <util/global.h>
17 
18 #include <iostream>
19 
20 namespace McMd
21 {
22 
23  using namespace Util;
34  class CompositionProfile : public SystemAnalyzer<System>
35  {
36 
37  public:
38 
44  CompositionProfile(System &system);
45 
50 
63  virtual void readParameters(std::istream& in);
64 
68  virtual void setup();
69 
75  void sample(long iStep);
76 
82  virtual void loadParameters(Serializable::IArchive &ar);
83 
89  virtual void save(Serializable::OArchive &ar);
90 
97  template <class Archive>
98  void serialize(Archive &ar, const unsigned int version);
99 
100 
104  virtual void output();
105 
106  protected:
107 
109  std::ofstream outputFile_;
110 
113 
116 
119 
120  // Array of log file descriptors
121  DArray<std::ofstream> logFiles_;
122 
125 
127  int nSample_;
128 
131 
133  int nBins_;
134 
137 
140 
143 
147  void makeWaveVectors();
148 
149 
150  };
151 
152  /*
153  * Serialize to/from an archive.
154  */
155  template <class Archive>
156  void CompositionProfile::serialize(Archive& ar, const unsigned int version)
157  {
158  Analyzer::serialize(ar, version);
159  ar & nDirection_;
160  ar & intVectors_;
161  ar & waveVectors_;
162  ar & accumulators_;
163  ar & nSample_;
164  ar & nAtomType_;
165  }
166 
167 }
168 #endif
bool isInitialized_
Has readParam been called?
std::ofstream outputFile_
Output file stream.
bool isFirstStep_
True if this is the first step.
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
File containing preprocessor macros for error handling.
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
int nDirection_
Number of directions.
DArray< Distribution > currentAccumulators_
Distribution statistical accumulators.
Template for Analyzer associated with one System.
Dynamically allocatable contiguous array template.
Definition: DArray.h:31
int nSample_
Number of samples thus far.
Saving archive for binary istream.
int nBins_
Number of bins for density profile.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
DArray< Distribution > accumulators_
Distribution statistical accumulators.
DArray< Vector > waveVectors_
Array of direction vectors.
DArray< IntVector > intVectors_
Array of Miller index vectors for directions.
int nAtomType_
Number of atom types, copied from Simulation::nAtomType().
CompositionProfile evaluates the distribution of monomer positions along several user-specified direc...
void serialize(Archive &ar, const unsigned int version)
Serialize internal state to/from archive.