PSCF v1.5.0
SweepFactory.tpp
1/*
2* PSCF - Polymer Self-Consistent Field
3*
4* Copyright 2015 - 2026, David Morse (morse012@um.edu) and co-authors
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 Rp {
15
16 using namespace Util;
17
18 template <int D, class T>
20 : systemPtr_(&system)
21 {}
22
26 template <int D, class T>
28 SweepFactory<D,T>::factory(std::string const & className) const
29 {
30 Sweep<D,T>* ptr = nullptr;
31
32 // First check if name is known by any subfactories
33 ptr = trySubfactories(className);
34 if (ptr) return ptr;
35
36 // Explicit class names
37 if (className == "Sweep" || className == "LinearSweep") {
38 ptr = new LinearSweep<D,T>(*systemPtr_);
39 }
40
41 return ptr;
42 }
43
44} // namespace Rp
45} // namespace Pscf
LinearSweep(System< D, T > &system)
Constructor.
Sweep< D, T > * factory(std::string const &className) const
Create an instance of a specified Sweep subclass.
SweepFactory(System< D, T > &system)
Constructor.
Solve a sequence of SCFT problems along a line in parameter space.
Base class template for classes that represent a complete system.
Sweep< D, T > * trySubfactories(const std::string &className) const
Definition Factory.h:427
Code for programs that simulate real-valued periodic fields.
Definition param_pc.dox:2
PSCF package top-level namespace.