PSCF v1.2
rpc/fts/analyzer/AnalyzerFactory.tpp
1#ifndef RPC_ANALYZER_FACTORY_TPP
2#define RPC_ANALYZER_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 Rpc {
20
21 using namespace Util;
22
23 /*
24 * Constructor
25 */
26 template <int D>
28 System<D>& system)
29 : sysPtr_(&system),
30 simulatorPtr_(&simulator)
31 {}
32
33 /*
34 * Return a pointer to a instance of Analyzer subclass className.
35 */
36 template <int D>
37 Analyzer<D>* AnalyzerFactory<D>::factory(const std::string &className) const
38 {
39 Analyzer<D>* ptr = 0;
40
41 // Try subfactories first
42 ptr = trySubfactories(className);
43 if (ptr) return ptr;
44
45
46 // Try to match classname
47 if (className == "TrajectoryWriter") {
48 ptr = new TrajectoryWriter<D>(*simulatorPtr_, *sysPtr_);
49 } else if (className == "ConcentrationWriter") {
50 ptr = new ConcentrationWriter<D>(*simulatorPtr_, *sysPtr_);
51 } else if (className == "HamiltonianAnalyzer") {
52 ptr = new HamiltonianAnalyzer<D>(*simulatorPtr_, *sysPtr_);
53 } else if (className == "BinaryStructureFactorGrid") {
54 ptr
55 = new BinaryStructureFactorGrid<D>(*simulatorPtr_, *sysPtr_);
56 } else if (className == "StepLogger") {
57 ptr = new StepLogger<D>();
58 } else if (className == "PerturbationDerivative") {
59 ptr = new PerturbationDerivative<D>(*simulatorPtr_, *sysPtr_);
60 } else if (className == "ChiDerivative") {
61 ptr = new ChiDerivative<D>(*simulatorPtr_, *sysPtr_);
62 } else if (className == "ConcentrationDerivative") {
63 ptr = new ConcentrationDerivative<D>(*simulatorPtr_, *sysPtr_);
64 } else if (className == "MaxOrderParameter") {
65 ptr = new MaxOrderParameter<D>(*simulatorPtr_, *sysPtr_);
66 } else if (className == "FourthOrderParameter") {
67 ptr = new FourthOrderParameter<D>(*simulatorPtr_, *sysPtr_);
68 }
69
70 return ptr;
71 }
72
73}
74}
75#endif
AnalyzerFactory(Simulator< D > &simulator, System< D > &system)
Constructor.
Analyzer< D > * factory(const std::string &className) const
Method to create any Analyzer supplied with PSCF.
Abstract base for periodic output and/or analysis actions.
BinaryStructureFactorGrid evaluates AB copolymer structure factors.
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 rpc/System.h:38
Periodically write snapshots to a trajectory file.
Main class for SCFT or PS-FTS simulation of one system.
Definition rpc/System.h:100
Periodically write snapshots to a trajectory file.
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.