PSCF v1.4.0
SweepFactory.cu
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#include "LinearSweep.h"
11
12namespace Pscf{
13namespace Rpg{
14
15 using namespace Util;
16
17 /*
18 * Constructor.
19 */
20 template <int D>
22 : systemPtr_(&system)
23 {}
24
25 /*
26 * Return a pointer to a Sweep subclass with name className
27 */
28 template <int D>
29 Sweep<D>* SweepFactory<D>::factory(std::string const & className) const
30 {
31 Sweep<D> *ptr = 0;
32
33 // First check if name is known by any subfactories
34 ptr = trySubfactories(className);
35 if (ptr) return ptr;
36
37 // Explicit class names
38 if (className == "Sweep" || className == "LinearSweep") {
39 ptr = new LinearSweep<D>(*systemPtr_);
40 }
41
42 return ptr;
43 }
44
45} // namespace Rpg
46} // namespace Pscf
47
48// Explicit instantiation definitions
49namespace Pscf {
50 namespace Rpg {
51 template class SweepFactory<1>;
52 template class SweepFactory<2>;
53 template class SweepFactory<3>;
54 }
55}
Sweep in which parameters vary linearly with sweep variable s.
Sweep< D > * factory(std::string const &className) const
Method to create any Sweep subclass.
SweepFactory(System< D > &system)
Constructor.
Solve a sequence of SCFT problems along a line in parameter space.
Main class, representing a complete physical system.
Sweep< D > * trySubfactories(const std::string &className) const
Definition Factory.h:425
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.