PSCF v1.4.0
TrajectoryReaderFactory.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 "TrajectoryReaderFactory.h"
9
10// Subclasses of ConfigIo
11#include "RGridTrajectoryReader.h"
12
13namespace Pscf {
14namespace Rpg {
15
16 using namespace Util;
17
18 /*
19 * Constructor
20 */
21 template <int D>
25
26 /*
27 * Return a pointer to a instance of TrajectoryReader subclass className.
28 */
29 template <int D>
31 TrajectoryReaderFactory<D>::factory(const std::string &className) const
32 {
33 TrajectoryReader<D> *ptr = 0;
34
35 // Try subfactories first
36 ptr = trySubfactories(className);
37 if (ptr) return ptr;
38
39 if (className == "RGridTrajectoryReader"
40 || className == "TrajectoryReader") {
41 ptr = new RGridTrajectoryReader<D>(*sysPtr_);
42 }
43 return ptr;
44 }
45
46 // Explicit instantiation declarations
47 template class TrajectoryReaderFactory<1>;
48 template class TrajectoryReaderFactory<2>;
49 template class TrajectoryReaderFactory<3>;
50
51}
52}
53
Main class, representing a complete physical system.
Factory for subclasses of TrajectoryReader.
TrajectoryReader< D > * factory(const std::string &className) const
Method to create any TrajectoryReader supplied with PSCF.
TrajectoryReaderFactory(System< D > &system)
Constructor.
Trajectory file reader (base class).
TrajectoryReader< 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.