Simpatico  v1.10
ddMd/analyzers/scattering/StructureFactor.h
1 #ifndef DDMD_STRUCTURE_FACTOR_H
2 #define DDMD_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 <ddMd/analyzers/Analyzer.h>
12 #include <ddMd/simulation/Simulation.h>
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 DdMd
22 {
23 
24  using namespace Util;
25 
81  class StructureFactor : public Analyzer
82  {
83 
84  public:
85 
87  static const int Samples = 100000;
88 
94  StructureFactor(Simulation& simulation);
95 
99  ~StructureFactor();
100 
106  virtual void readParameters(std::istream& in);
107 
113  virtual void loadParameters(Serializable::IArchive &ar);
114 
120  virtual void save(Serializable::OArchive &ar);
121 
125  virtual void clear();
126 
132  void sample(long iStep);
133 
137  virtual void output();
138 
139  protected:
140 
144  std::ofstream outputFile_;
145 
152 
159 
166 
171 
176 
183 
185  int nWave_;
186 
188  int nMode_;
189 
191  int nSample_;
192 
195 
198 
201 
205  void makeWaveVectors();
206 
207  };
208 
209 }
210 #endif
Abstract base for periodic output and/or analysis actions.
DArray< IntVector > waveIntVectors_
Array of Miller index IntVectors for wavevectors.
DMatrix< double > structureFactors_
Structure factor accumulators.
int nAtomType_
Number of atom types, copied from Simulation::nAtomType().
DArray< Vector > waveVectors_
Array of floating point wave vectors.
File containing preprocessor macros for error handling.
Parallel domain decomposition (DD) MD simulation.
Main object for a domain-decomposition MD simulation.
Saving / output archive for binary ostream.
Utility classes for scientific computation.
Definition: accumulators.mod:1
std::ofstream outputFile_
Output file stream.
DMatrix< std::complex< double > > totalFourierModes_
Total fourier modes of concentration.
Dynamically allocatable contiguous array template.
Definition: DArray.h:31
StructureFactor evaluates structure factors in Fourier space.
Saving archive for binary istream.
DMatrix< std::complex< double > > fourierModes_
Fourier modes of concentration.
int nSample_
Number of samples thus far.
DMatrix< double > modes_
Array of mode vectors.
bool isInitialized_
Has readParam been called?