PSCF v1.3.1
rpg/fts/trajectory/RGridTrajectoryReader.h
1#ifndef RPG_RGRID_TRAJECTORY_READER_H
2#define RPG_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#include <prdc/cuda/RField.h> // member
13#include <util/containers/DArray.h> // member
14#include <iostream>
15
16namespace Pscf {
17namespace Rpg {
18
19 template <int D> class System;
20
21 using namespace Util;
22 using namespace Pscf::Prdc;
23 using namespace Pscf::Prdc::Cuda;
24
30 template <int D>
32 {
33
34 public:
35
42
47
60 void open(std::string filename);
61
70 bool readFrame();
71
75 void close();
76
80 void readHeader();
81
82 protected:
86 void allocate();
87
92
93 // Pointer to the parent system.
94 System<D>* systemPtr_;
95
96
97 private:
98
99 //
100 IntVec<D> meshDimensions_;
101
102 // Trajectory file.
103 std::ifstream inputfile_;
104
105 // Read Grid Field configuration
106 DArray< RField<D> > wField_;
107
108 // Has the variable been allocated?
109 bool isAllocated_;
110
111
112 };
113
114 // Get the parent system.
115 template <int D>
117 { return *systemPtr_; }
118
119 // Explicit instantiation declarations
120 extern template class RGridTrajectoryReader<1>;
121 extern template class RGridTrajectoryReader<2>;
122 extern template class RGridTrajectoryReader<3>;
123
124}
125}
126#endif
An IntVec<D, T> is a D-component vector of elements of integer type T.
Definition IntVec.h:27
void open(std::string filename)
Open trajectory file and read header, if any.
void allocate()
Allocate memory required by trajectory reader.
System< D > & system()
Return reference to parent system.
Main class, representing a complete physical system.
TrajectoryReader(System< D > &system)
Constructor.
Dynamically allocatable contiguous array template.
Definition DArray.h:32
Fields, FFTs, and utilities for periodic boundary conditions (CUDA)
Definition Reduce.cpp:14
Periodic fields and crystallography.
Definition CField.cpp:11
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.
Definition param_pc.dox:1