1#ifndef RPG_RGRID_TRAJECTORY_READER_TPP
2#define RPG_RGRID_TRAJECTORY_READER_TPP
11#include "RGridTrajectoryReader.h"
12#include <rpg/system/System.h>
13#include <pscf/math/IntVec.h>
14#include <pscf/mesh/MeshIterator.h>
15#include <util/misc/ioUtil.h>
38 const int nMonomer =
system().mixture().nMonomer();
42 wField_.allocate(nMonomer);
43 for (
int i = 0; i < nMonomer; ++i) {
44 wField_[i].allocate(dimensions);
56 system().fileMaster().open(filename, inputfile_);
64 int nMonomer =
system().mixture().nMonomer();
70 system().setUnitCell(tmpUnitCell);
82 UTIL_THROW(
"Real Grid Field is not allocated");
86 std::stringstream line;
101 step = std::stoi(value);
113 int nMonomer =
system().mixture().nMonomer();
118 system().w().setRGrid(wField_);
128 { inputfile_.close();}
An IntVec<D, T> is a D-component vector of elements of integer type T.
Base template for UnitCell<D> classes, D=1, 2 or 3.
File input/output operations and format conversions for fields.
void readFieldHeader(std::istream &in, int &nMonomer, UnitCell< D > &unitCell, bool &isSymmetric) const
Reader header of field file (fortran PSCF format)
void readFieldsRGridData(std::istream &in, DArray< RField< D > > &fields, int nMonomer) const override
Read data for an array of r-grid fields, with no header section.
RGridTrajectoryReader(System< D > &system)
Constructor.
bool readFrame()
Read a single frame.
void readHeader()
Read header of trajectory file.
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.
void close()
Close the trajectory file.
Main class, representing one complete system.
TrajectoryReader(System< D > &system)
Constructor.
static std::ostream & file()
Get log ostream by reference.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
void checkString(std::istream &in, const std::string &expected)
Extract string from stream, and compare to expected value.
bool getNextLine(std::istream &in, std::string &line)
Read the next non-empty line into a string, strip trailing whitespace.
bool hasSymmetry(AT const &in, Basis< D > const &basis, IntVec< D > const &dftDimensions, double epsilon=1.0e-8, bool verbose=true)
Check if a k-grid field has the declared space group symmetry.
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.