Simpatico  v1.10
mcMd/analyzers/system/StructureFactor.h
1 #ifndef MCMD_STRUCTURE_FACTOR_H
2 #define MCMD_STRUCTURE_FACTOR_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/containers/DMatrix.h> // member template
14 #include <util/containers/DArray.h> // member template
15 
16 #include <util/global.h>
17 
18 #include <iostream>
19 #include <complex>
20 
21 namespace McMd
22 {
23 
24  using namespace Util;
25 
55  class StructureFactor : public SystemAnalyzer<System>
56  {
57 
58  public:
59 
65  StructureFactor(System &system);
66 
70  ~StructureFactor();
71 
77  virtual void readParameters(std::istream& in);
78 
84  virtual void loadParameters(Serializable::IArchive& ar);
85 
91  virtual void save(Serializable::OArchive& ar);
92 
99  template <class Archive>
100  void serialize(Archive& ar, const unsigned int version);
101 
105  virtual void setup();
106 
112  virtual void sample(long iStep);
113 
117  virtual void output();
118 
119  protected:
120 
124  std::ofstream outputFile_;
125 
132 
139 
144 
149 
156 
158  int nWave_;
159 
161  int nMode_;
162 
164  int nSample_;
165 
168 
172  void makeWaveVectors();
173 
176 
177  private:
178 
180  bool isInitialized_;
181  };
182 
186  template <class Archive>
187  void StructureFactor::serialize(Archive& ar, const unsigned int version)
188  {
189  Analyzer::serialize(ar, version);
190  ar & nAtomType_;
191  ar & nMode_;
192  ar & modes_;
193  ar & nWave_;
194  ar & waveIntVectors_;
195 
196  ar & structureFactors_;
197  ar & nSample_;
198 
199  #if 0
200  ar & maximumValue_;
201  ar & maximumWaveIntVector_;
202  ar & maximumQ_;
203  #endif
204  }
205 
206 }
207 #endif
int nSample_
Number of samples thus far.
DArray< Vector > waveVectors_
Array of floating point wave vectors (temporary).
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
DMatrix< std::complex< double > > fourierModes_
Instantaneous Fourier amplitudes (temporary)
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
DMatrix< double > modes_
Array of mode vectors.
Saving / output archive for binary ostream.
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
int nAtomType_
Number of atom types, copied from Simulation::nAtomType().
DMatrix< double > structureFactors_
Structure factor accumulators.
Utility classes for scientific computation.
Definition: accumulators.mod:1
DArray< IntVector > waveIntVectors_
Array of Miller index IntVectors for wavevectors.
std::ofstream outputFile_
Output file stream.
Template for Analyzer associated with one System.
StructureFactor evaluates structure factors in Fourier space.
Dynamically allocatable contiguous array template.
Definition: DArray.h:31
bool isFirstStep_
Is this the first step?
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).