PSCF v1.2
Pscf::Rpg::RGridTrajectoryReader< D > Class Template Reference

Trajectory file reader. More...

#include <RGridTrajectoryReader.h>

Inheritance diagram for Pscf::Rpg::RGridTrajectoryReader< D >:
Pscf::Rpg::TrajectoryReader< D >

Public Member Functions

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

Protected Member Functions

void allocate ()
 Allocate memory required by trajectory reader.
 
System< D > & system ()
 Return reference to parent system.
 
- Protected Member Functions inherited from Pscf::Rpg::TrajectoryReader< D >
System< D > & system ()
 Return reference to parent system.
 

Detailed Description

template<int D>
class Pscf::Rpg::RGridTrajectoryReader< D >

Trajectory file reader.

Definition at line 31 of file rpg/fts/trajectory/RGridTrajectoryReader.h.

Constructor & Destructor Documentation

◆ RGridTrajectoryReader()

template<int D>
Pscf::Rpg::RGridTrajectoryReader< D >::RGridTrajectoryReader ( System< D > & system)

Constructor.

Parameters
systemparent System<D> object

Definition at line 29 of file rpg/fts/trajectory/RGridTrajectoryReader.tpp.

◆ ~RGridTrajectoryReader()

template<int D>
virtual Pscf::Rpg::RGridTrajectoryReader< D >::~RGridTrajectoryReader ( )
inlinevirtual

Destructor.

Definition at line 46 of file rpg/fts/trajectory/RGridTrajectoryReader.h.

Member Function Documentation

◆ open()

template<int D>
void Pscf::Rpg::RGridTrajectoryReader< D >::open ( std::string filename)
virtual

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. If compiled with MPI enabled, so that each processor simulates a different system, it also prepends a processor id prefix before the input prefix.

Parameters
filenametrajectory input file name.

Implements Pscf::Rpg::TrajectoryReader< D >.

Definition at line 54 of file rpg/fts/trajectory/RGridTrajectoryReader.tpp.

◆ readFrame()

template<int D>
bool Pscf::Rpg::RGridTrajectoryReader< D >::readFrame ( )
virtual

Read a single frame.

Frames are assumed to be read consecutively.

This function reads a frame from the trajectory file that was opened by the open() function.

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

Implements Pscf::Rpg::TrajectoryReader< D >.

Definition at line 76 of file rpg/fts/trajectory/RGridTrajectoryReader.tpp.

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

◆ close()

template<int D>
void Pscf::Rpg::RGridTrajectoryReader< D >::close ( )
virtual

Close the trajectory file.

Implements Pscf::Rpg::TrajectoryReader< D >.

Definition at line 125 of file rpg/fts/trajectory/RGridTrajectoryReader.tpp.

◆ readHeader()

◆ allocate()

template<int D>
void Pscf::Rpg::RGridTrajectoryReader< D >::allocate ( )
protected

Allocate memory required by trajectory reader.

Definition at line 36 of file rpg/fts/trajectory/RGridTrajectoryReader.tpp.

References UTIL_CHECK.

◆ system()

template<int D>
System< D > & Pscf::Rpg::RGridTrajectoryReader< D >::system ( )
inlineprotected

Return reference to parent system.

Definition at line 116 of file rpg/fts/trajectory/RGridTrajectoryReader.h.


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