PSCF v1.2
rpg/fts/analyzer/AnalyzerFactory.tpp
1#ifndef RPG_MC_MOVE_FACTORY_TPP
2#define RPG_MC_MOVE_FACTORY_TPP
3
4#include "AnalyzerFactory.h"
5
6// Subclasses of Analyzer
7#include "TrajectoryWriter.h"
8#include "ConcentrationWriter.h"
9#include "HamiltonianAnalyzer.h"
10#include "BinaryStructureFactorGrid.h"
11#include "StepLogger.h"
12#include "PerturbationDerivative.h"
13#include "ChiDerivative.h"
14#include "ConcentrationDerivative.h"
15#include "MaxOrderParameter.h"
16#include "FourthOrderParameter.h"
17
18namespace Pscf {
19namespace Rpg {
20
21 using namespace Util;
22
23 /*
24 * Constructor
25 */
26 template <int D>
28 : sysPtr_(&system),
29 simulatorPtr_(&simulator)
30 {}
31
32 /*
33 * Return a pointer to a instance of Analyzer subclass className.
34 */
35 template <int D>
36 Analyzer<D>* AnalyzerFactory<D>::factory(const std::string &className) const
37 {
38 Analyzer<D>* ptr = 0;
39
40 // Try subfactories first
41 ptr = trySubfactories(className);
42 if (ptr) return ptr;
43
44
45 // Try to match classname
46 if (className == "TrajectoryWriter") {
47 ptr = new TrajectoryWriter<D>(*simulatorPtr_, *sysPtr_);
48 } else if (className == "ConcentrationWriter") {
49 ptr =
50 new ConcentrationWriter<D>(*simulatorPtr_, *sysPtr_);
51 } else if (className == "HamiltonianAnalyzer") {
52 ptr =
53 new HamiltonianAnalyzer<D>(*simulatorPtr_, *sysPtr_);
54 } else if (className == "BinaryStructureFactorGrid") {
55 ptr =
56 new BinaryStructureFactorGrid<D>(*simulatorPtr_,
57 *sysPtr_);
58 } else if (className == "StepLogger") {
59 ptr = new StepLogger<D>();
60 } else if (className == "PerturbationDerivative") {
61 ptr = new PerturbationDerivative<D>(*simulatorPtr_,
62 *sysPtr_);
63 } else if (className == "ChiDerivative") {
64 ptr = new ChiDerivative<D>(*simulatorPtr_, *sysPtr_);
65 } else if (className == "ConcentrationDerivative") {
66 ptr = new ConcentrationDerivative<D>(*simulatorPtr_,
67 *sysPtr_);
68 } else if (className == "MaxOrderParameter") {
69 ptr = new MaxOrderParameter<D>(*simulatorPtr_, *sysPtr_);
70 } else if (className == "FourthOrderParameter") {
71 ptr = new FourthOrderParameter<D>(*simulatorPtr_, *sysPtr_);
72 }
73
74 return ptr;
75 }
76
77}
78}
79#endif
Analyzer< D > * factory(const std::string &className) const
Method to create any Analyzer supplied with PSCF.
AnalyzerFactory(Simulator< D > &simulator, System< D > &system)
Constructor.
Abstract base for periodic output and/or analysis actions.
BinaryStructureFactorGrid evaluates AB diblock structure factors in Fourier space.
Evaluate the derivative of H with respect to chi.
Evaluate the derivative of H with respect to concentration.
Periodically write snapshots to a trajectory file.
FourthOrderParameter is used to detect an order-disorder transition.
Compute averages and output block averages of Hamiltonian components.
MaxOrderParameter is used to detect an order-disorder transition.
Evaluate the derivative of H w/ respect to perturbation parameter lambda.
Field theoretic simulator (base class).
Definition rpg/System.h:41
Periodically write snapshots to a trajectory file.
Main class for calculations that represent one system.
Definition rpg/System.h:107
Periodically write snapshots to a trajectory file.
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.