PSCF v1.1
fd1d/sweep/SweepFactory.cpp
1/*
2* PSCF - Polymer Self-Consistent Field Theory
3*
4* Copyright 2016 - 2022, The Regents of the University of Minnesota
5* Distributed under the terms of the GNU General Public License.
6*/
7
8#include "SweepFactory.h"
9
10// Subclasses of Sweep
11#include "LinearSweep.h"
12
13namespace Pscf {
14namespace Fd1d {
15
16 using namespace Util;
17
19 : systemPtr_(&system)
20 {}
21
22 /*
23 * Return a pointer to a instance of Sweep subclass speciesName.
24 */
25 Sweep* SweepFactory::factory(const std::string &className) const
26 {
27 Sweep *ptr = 0;
28
29 // First if name is known by any subfactories
30 ptr = trySubfactories(className);
31 if (ptr) return ptr;
32
33 // Explicit class names
34 if (className == "Sweep" || className == "LinearSweep") {
35 ptr = new LinearSweep(*systemPtr_);
36 }
37
38 return ptr;
39 }
40
41}
42}
Base class for a sweep in parameter space where parameters change linearly with the sweep variable.
Sweep * factory(std::string const &className) const
Method to create any Sweep subclass.
SweepFactory(System &system)
Constructor.
Solve a sequence of problems along a line in parameter space.
Main class in SCFT simulation of one system.
Definition: fd1d/System.h:63
Sweep * trySubfactories(const std::string &className) const
Search through subfactories for match.
Definition: Factory.h:425
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1