Simpatico  v1.10
StructureFactorP.h
1 #ifndef MCMD_STRUCTURE_FACTOR_P_H
2 #define MCMD_STRUCTURE_FACTOR_P_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 
90  : public SystemAnalyzer<System>
91  {
92 
93  public:
94 
100  StructureFactorP(System &system);
101 
105  ~StructureFactorP();
106 
121  virtual void readParameters(std::istream& in);
122 
128  virtual void loadParameters(Serializable::IArchive& ar);
129 
135  virtual void save(Serializable::OArchive& ar);
136 
143  template <class Archive>
144  void serialize(Archive& ar, const unsigned int version);
145 
149  virtual void setup();
150 
156  void sample(long iStep);
157 
161  virtual void output();
162 
163  protected:
164 
166  std::ofstream outputFile_;
167 
174 
175  /*
176  * Fourier modes (temporary).
177  *
178  * First index is wavevector, second is atom type.
179  */
180  DMatrix< std::complex<double> > fourierModes_;
181 
184 
187 
190 
192  int nWave_;
193 
196 
198  int nSample_;
199 
202 
205 
209  void makeWaveVectors();
210 
211  };
212 
216  template <class Archive>
217  void StructureFactorP::serialize(Archive& ar, const unsigned int version)
218  {
219  Analyzer::serialize(ar, version);
220  ar & nAtomType_;
221  ar & nAtomTypeIdPair_;
222  ar & atomTypeIdPairs_;
223  ar & nWave_;
224  ar & waveIntVectors_;
225 
226  ar & structureFactors_;
227  ar & nSample_;
228  }
229 
230 }
231 #endif
StructureFactorP evaluates partial structure factors in Fourier space.
int nAtomTypeIdPair_
Number of selected atom type pairs.
std::ofstream outputFile_
Output file stream.
bool isInitialized_
Has readParam been called?
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.
DArray< IntVector > waveIntVectors_
Array of miller index IntVectors for wavevectors.
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
Utility classes for scientific computation.
Definition: accumulators.mod:1
int nAtomType_
Number of atom types, copied from Simulation::nAtomType().
Template for Analyzer associated with one System.
int nSample_
Number of samples thus far.
Dynamically allocatable contiguous array template.
Definition: DArray.h:31
Saving archive for binary istream.
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.
DArray< Vector > waveVectors_
Array of wave vectors (temporary)
DArray< Pair< int > > atomTypeIdPairs_
Array of atom type indices (-1 indicates a sum of all types)
int nWave_
Number of wavevectors.