PSCF v1.3
rpc/fts/trajectory/RGridTrajectoryReader.h
1#ifndef RPC_RGRID_TRAJECTORY_READER_H
2#define RPC_RGRID_TRAJECTORY_READER_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include "TrajectoryReader.h" // base class
12
13#include <prdc/cpu/RField.h> // member
14#include <pscf/math/IntVec.h> // member
15#include <util/containers/DArray.h> // member
16
17#include <string>
18#include <iostream>
19
20namespace Pscf {
21namespace Rpc {
22
23 template <int D> class System;
24
25 using namespace Util;
26 using namespace Pscf::Prdc::Cpu;
27
33 template <int D>
35 {
36
37 public:
38
43
48
59 void open(std::string filename);
60
69 bool readFrame();
70
74 void close();
75
79 void readHeader();
80
81 void readFieldsRGrid(std::istream &in, DArray<RField<D> >& fields);
82
83 protected:
84
88 void allocate();
89
91
92 private:
93
94 // Field configuration
95 DArray< RField<D> > wField_;
96
97 // Dimensions of computational mesh (# of points in each direction)
98 IntVec<D> meshDimensions_;
99
100 // Trajectory file input stream
101 std::ifstream inputfile_;
102
103 // Has wField_ been allocated?
104 bool isAllocated_;
105
106 };
107
108 #ifndef RPC_RGRID_TRAJECTORY_READER_TPP
109 // Suppress implicit instantiation
110 extern template class RGridTrajectoryReader<1>;
111 extern template class RGridTrajectoryReader<2>;
112 extern template class RGridTrajectoryReader<3>;
113 #endif
114
115}
116}
117#endif
An IntVec<D, T> is a D-component vector of elements of integer type T.
Definition IntVec.h:27
Field of real double precision values on an FFT mesh.
Definition cpu/RField.h:29
void open(std::string filename)
Open trajectory file and read header, if any.
void allocate()
Allocate memory required by trajectory reader.
Main class, representing one complete system.
Trajectory file reader (base class).
TrajectoryReader(System< D > &system)
Constructor.
System< D > & system()
Return reference to parent system.
Dynamically allocatable contiguous array template.
Definition DArray.h:32
Fields and FFTs for periodic boundary conditions (CPU)
Definition CField.cpp:12
Real periodic fields, SCFT and PS-FTS (CPU).
Definition param_pc.dox:2
PSCF package top-level namespace.
Definition param_pc.dox:1