Simpatico  v1.10
IntraStructureFactor.h
1 #ifndef MCMD_INTRA_STRUCTURE_FACTOR_H
2 #define MCMD_INTRA_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 #include <util/containers/Pair.h> // member template parameter
16 
17 #include <util/global.h>
18 
19 #include <iostream>
20 #include <complex>
21 
22 namespace McMd
23 {
24 
25  using namespace Util;
26 
91  : public SystemAnalyzer<System>
92  {
93 
94  public:
95 
101  IntraStructureFactor(System &system);
102 
107 
122  virtual void readParameters(std::istream& in);
123 
129  virtual void loadParameters(Serializable::IArchive& ar);
130 
136  virtual void save(Serializable::OArchive& ar);
137 
144  template <class Archive>
145  void serialize(Archive& ar, const unsigned int version);
146 
150  virtual void setup();
151 
157  void sample(long iStep);
158 
162  virtual void output();
163 
164  protected:
165 
169  std::ofstream outputFile_;
170 
177 
182 
187 
188  // Array of miller index vectors for wavevectors
189  DArray<IntVector> waveIntVectors_;
190 
191  // Array of wave vectors
192  DArray<Vector> waveVectors_;
193 
194  // Array of atom type indices (-1 indicates a sum of all types)
195  DArray< Pair<int> > atomTypeIdPairs_;
196 
199 
201  int nWave_;
202 
205 
207  int nSample_;
208 
211 
212 
213  private:
215  bool isInitialized_;
216 
220  void makeWaveVectors();
221 
222  };
223 
224  /*
225  * Serialize to/from an archive.
226  */
227  template <class Archive>
229  const unsigned int version)
230  {
231  Analyzer::serialize(ar, version);
232  ar & speciesId_;
233  ar & nAtomTypeIdPair_;
234  ar & atomTypeIdPairs_;
235  ar & nWave_;
236  ar & waveIntVectors_;
237  ar & nAtomType_;
238  ar & structureFactors_;
239  ar & fourierModes_;
240  ar & nSample_;
241  }
242 
243 }
244 #endif
int nAtomTypeIdPair_
Number of selected atom type pairs.
DMatrix< std::complex< double > > fourierModes_
Fourier modes.
Intramolecular contribution to the structure factor S(k)
DMatrix< double > structureFactorDelta_
Contribution of current time step to structure factor average.
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.
int nSample_
Number of samples thus far.
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
Utility classes for scientific computation.
Definition: accumulators.mod:1
int nWave_
Number of wavevectors.
Template for Analyzer associated with one System.
int speciesId_
Index for molecular species.
int nAtomType_
Number of atom types, copied from Simulation::nAtomType().
Dynamically allocatable contiguous array template.
Definition: DArray.h:31
Saving archive for binary istream.
std::ofstream outputFile_
Output file stream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
DMatrix< double > structureFactors_
Structure factor accumulators.
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.