PSCF v1.4.0
rpc/scft/sweep/SweepFactory.cpp
1/*
2* PSCF - Polymer Self-Consistent Field
3*
4* Copyright 2015 - 2025, 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 Rpc{
15
16 using namespace Util;
17
18 template <int D>
20 : systemPtr_(&system)
21 {}
22
26 template <int D>
27 Sweep<D>* SweepFactory<D>::factory(std::string const & className)
28 const
29 {
30 Sweep<D> *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>(*systemPtr_);
39 }
40
41 return ptr;
42 }
43
44} // namespace Rpc
45} // namespace Pscf
46
47// Explicit instantiation definitions
48namespace Pscf {
49 namespace Rpc {
50 template class SweepFactory<1>;
51 template class SweepFactory<2>;
52 template class SweepFactory<3>;
53 }
54}
Sweep in which parameters vary linearly with sweep variable s.
SweepFactory(System< D > &system)
Constructor.
Sweep< D > * factory(std::string const &className) const
Method to create any Sweep subclass.
Solve a sequence of SCFT problems along a line in parameter space.
A complete physical system.
Sweep< D > * trySubfactories(const std::string &className) const
Definition Factory.h:425
Real periodic fields, SCFT and PS-FTS (CPU).
Definition param_pc.dox:2
PSCF package top-level namespace.