PSCF v1.2
Pscf::Rpg::TrajectoryReader< D > Class Template Referenceabstract

Trajectory file reader. More...

#include <TrajectoryReader.h>

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

Public Member Functions

 TrajectoryReader (System< D > &system)
 Constructor.
 
virtual ~TrajectoryReader ()
 Destructor.
 
virtual void open (std::string filename)=0
 Open trajectory file and read header, if any.
 
virtual bool readFrame ()=0
 Read a single frame.
 
virtual void close ()=0
 Close the trajectory file.
 

Protected Member Functions

System< D > & system ()
 Return reference to parent system.
 

Detailed Description

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

Trajectory file reader.

Definition at line 30 of file rpg/fts/trajectory/TrajectoryReader.h.

Constructor & Destructor Documentation

◆ TrajectoryReader()

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

Constructor.

Definition at line 22 of file rpg/fts/trajectory/TrajectoryReader.tpp.

◆ ~TrajectoryReader()

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

Destructor.

Definition at line 43 of file rpg/fts/trajectory/TrajectoryReader.h.

Member Function Documentation

◆ open()

template<int D>
virtual void Pscf::Rpg::TrajectoryReader< D >::open ( std::string filename)
pure 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.

Implemented in Pscf::Rpg::RGridTrajectoryReader< D >.

Referenced by Pscf::Rpg::BdSimulator< D >::analyze(), and Pscf::Rpg::McSimulator< D >::analyze().

◆ readFrame()

template<int D>
virtual bool Pscf::Rpg::TrajectoryReader< D >::readFrame ( )
pure 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

Implemented in Pscf::Rpg::RGridTrajectoryReader< D >.

Referenced by Pscf::Rpg::BdSimulator< D >::analyze(), and Pscf::Rpg::McSimulator< D >::analyze().

◆ close()

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

◆ system()

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

Return reference to parent system.

Definition at line 95 of file rpg/fts/trajectory/TrajectoryReader.h.


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