PSCF v1.1
pspc/sweep/SweepFactory.tpp
1#ifndef PSPC_SWEEP_FACTORY_TPP
2#define PSPC_SWEEP_FACTORY_TPP
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include "SweepFactory.h"
12
13// subclasses of Sweep
14#include "LinearSweep.h"
15// #include "NonlinearSweep.h" Eventually!
16
17namespace Pscf{
18 namespace Pspc{
19
20 using namespace Util;
21
22 template <int D>
24 : systemPtr_(&system)
25 {}
26
30 template <int D>
31 Sweep<D>* SweepFactory<D>::factory(std::string const & className) const
32 {
33 Sweep<D> *ptr = 0;
34
35 // First check if name is known by any subfactories
36 ptr = trySubfactories(className);
37 if (ptr) return ptr;
38
39 // Explicit class names
40 if (className == "Sweep" || className == "LinearSweep") {
41 ptr = new LinearSweep<D>(*systemPtr_);
42 }
43
44 return ptr;
45 }
46
47 }
48}
49
50
51#endif
A sweep in parameter space where one or more parameters change linearly with the sweep variable.
Sweep< D > * factory(std::string const &className) const
Method to create any Sweep subclass.
SweepFactory(System< D > &system)
Constructor.
Solve a sequence of problems along a line in parameter space.
Main class for SCFT simulation of one system.
Definition: pspc/System.h:76
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1