PSCF v1.4.0
StepFactory.tpp
1#ifndef CPC_STEP_FACTORY_TPP
2#define CPC_STEP_FACTORY_TPP
3
4#include "StepFactory.h"
5#include <cpc/fts/Simulator.h>
6
7// Subclasses of Step
8//#include "ExplicitStep.h"
9
10namespace Pscf {
11namespace Cpc {
12
13 using namespace Util;
14
15 /*
16 * Constructor
17 */
18 template <int D>
20 : simulatorPtr_(&simulator)
21 {}
22
23 /*
24 * Return a pointer to a instance of Step subclass className.
25 */
26 template <int D>
27 Step<D>* StepFactory<D>::factory(const std::string &className) const
28 {
29 Step<D>* ptr = 0;
30
31 // Try subfactories first
32 ptr = trySubfactories(className);
33 if (ptr) return ptr;
34
35
36 #if 0
37 // Try to match classname
38 if (className == "ExplicitStep" || className == "Step") {
39 ptr = new ExplicitStep<D>(*simulatorPtr_);
40 }
41 #endif
42
43 return ptr;
44 }
45
46} // namespace Cpc
47} // namespace Pscf
48#endif
Simulator for complex Langevin field theoretic simulation.
StepFactory(Simulator< D > &simulator)
Constructor.
Step< D > * factory(const std::string &className) const
Method to create any Step supplied with PSCF.
Step is an abstract base class for Brownian dynamics steps.
Definition Step.h:33
Step< D > * trySubfactories(const std::string &className) const
Definition Factory.h:425
Complex periodic fields, CL-FTS (CPU).
Definition cpc.mod:6
PSCF package top-level namespace.