PSCF v1.2
rpc/fts/trajectory/TrajectoryReaderFactory.tpp
1#ifndef RPC_TRAJECTORY_READER_FACTORY_TPP
2#define RPC_TRAJECTORY_READER_FACTORY_TPP
3
4#include "TrajectoryReaderFactory.h"
5
6#include <rpc/System.h>
7
8// Subclasses of ConfigIo
9#include "RGridTrajectoryReader.h"
10
11namespace Pscf {
12namespace Rpc {
13
14 using namespace Util;
15
16 /*
17 * Constructor
18 */
19 template <int D>
23
24 /*
25 * Return a pointer to a instance of Trajectory subclass className.
26 */
27 template <int D>
29 TrajectoryReaderFactory<D>::factory(const std::string &className) const
30 {
31 TrajectoryReader<D> *ptr = 0;
32
33 // Try subfactories first
34 ptr = trySubfactories(className);
35 if (ptr) return ptr;
36
37 if (className == "RGridTrajectoryReader"
38 || className == "TrajectoryReader") {
39 ptr = new RGridTrajectoryReader<D>(*sysPtr_);
40 }
41
42 return ptr;
43 }
44
45}
46}
47#endif
Main class for SCFT or PS-FTS simulation of one system.
Definition rpc/System.h:100
TrajectoryReader< D > * factory(const std::string &className) const
Method to create any TrajectoryReader supplied with PSCF.
Trajectory file reader (base class).
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.