PSCF v1.5.0
Pscf::Rp::RGridTrajectoryReader< D, T > Class Template Reference

Trajectory file reader. More...

#include <RGridTrajectoryReader.h>

Inheritance diagram for Pscf::Rp::RGridTrajectoryReader< D, T >:
Pscf::Rp::TrajectoryReader< D, T >

Public Member Functions

 RGridTrajectoryReader (System< D, T > &system)
 Constructor.
 ~RGridTrajectoryReader ()=default
 Destructor.
void open (std::string filename) override
 Open trajectory file and read header, if any.
void readHeader () override
 Read header of trajectory file (if any).
bool readFrame () override
 Read a single frame from the trajectory file.
void close () override
 Close the trajectory file.
Public Member Functions inherited from Pscf::Rp::TrajectoryReader< D, T >
 TrajectoryReader (System< D, T > &system)
 Constructor.
virtual ~TrajectoryReader ()=default
 Destructor.

Additional Inherited Members

Protected Member Functions inherited from Pscf::Rp::TrajectoryReader< D, T >
System< D, T > & system ()
 Return reference to parent system.

Detailed Description

template<int D, class T>
class Pscf::Rp::RGridTrajectoryReader< D, T >

Trajectory file reader.

Template parameters:

  • D : dimension
  • T : backend identifier class (CPT or CUT)

Definition at line 36 of file RGridTrajectoryReader.h.

Constructor & Destructor Documentation

◆ RGridTrajectoryReader()

template<int D, class T>
Pscf::Rp::RGridTrajectoryReader< D, T >::RGridTrajectoryReader ( System< D, T > & system)

Constructor.

Parameters
systemparent System object

Definition at line 35 of file RGridTrajectoryReader.tpp.

References Pscf::Rp::TrajectoryReader< D, T >::system(), and Pscf::Rp::TrajectoryReader< D, T >::TrajectoryReader().

◆ ~RGridTrajectoryReader()

Member Function Documentation

◆ open()

template<int D, class T>
void Pscf::Rp::RGridTrajectoryReader< D, T >::open ( std::string filename)
overridevirtual

Open trajectory file and read header, if any.

By convention, this function treats the trajectory filename as the name of an input file, and opens the file using the FileMaster:openInutFile function. This function prepends the input prefix (if any) to the file path.

Parameters
filenametrajectory input file name

Implements Pscf::Rp::TrajectoryReader< D, T >.

Definition at line 63 of file RGridTrajectoryReader.tpp.

References Pscf::Rp::TrajectoryReader< D, T >::system().

Referenced by ~RGridTrajectoryReader().

◆ readHeader()

template<int D, class T>
void Pscf::Rp::RGridTrajectoryReader< D, T >::readHeader ( )
overridevirtual

◆ readFrame()

template<int D, class T>
bool Pscf::Rp::RGridTrajectoryReader< D, T >::readFrame ( )
overridevirtual

Read a single frame from the trajectory file.

Returns
true if a frame is avaiable, false if at end of file

Implements Pscf::Rp::TrajectoryReader< D, T >.

Definition at line 91 of file RGridTrajectoryReader.tpp.

References Util::checkString(), Util::Log::file(), Util::getNextLine(), Pscf::Rp::FieldIo< D, T >::readFieldsRGridData(), Pscf::Rp::TrajectoryReader< D, T >::system(), UTIL_CHECK, and UTIL_THROW.

Referenced by ~RGridTrajectoryReader().

◆ close()

template<int D, class T>
void Pscf::Rp::RGridTrajectoryReader< D, T >::close ( )
overridevirtual

Close the trajectory file.

Implements Pscf::Rp::TrajectoryReader< D, T >.

Definition at line 144 of file RGridTrajectoryReader.tpp.

Referenced by ~RGridTrajectoryReader().


The documentation for this class was generated from the following files: