Simpatico  v1.10
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
McMd::TrajectoryReader Class Referenceabstract

Detailed Description

Trajectory file reader (base class).

Definition at line 30 of file mcMd/trajectory/TrajectoryReader.h.

#include <TrajectoryReader.h>

Inheritance diagram for McMd::TrajectoryReader:
McMd::DCDTrajectoryReader McMd::DdMdTrajectoryReader McMd::LammpsDumpReader

Public Member Functions

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

Protected Member Functions

Systemsystem () const
 Get a reference to the parent System. More...
 
Simulationsimulation () const
 Get a reference to the parent Simulation. More...
 
Boundaryboundary () const
 Get the Boundary. More...
 
virtual void addMolecules ()
 Add all molecules to system. More...
 

Protected Attributes

int nAtomTotal_
 Total number of atoms (all species) More...
 

Constructor & Destructor Documentation

McMd::TrajectoryReader::TrajectoryReader ( System system)

Constructor.

Definition at line 23 of file mcMd/trajectory/TrajectoryReader.cpp.

McMd::TrajectoryReader::~TrajectoryReader ( )
virtual

Destructor.

Definition at line 33 of file mcMd/trajectory/TrajectoryReader.cpp.

Member Function Documentation

virtual void McMd::TrajectoryReader::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 McMd::DCDTrajectoryReader, McMd::DdMdTrajectoryReader, and McMd::LammpsDumpReader.

Referenced by McMd::MdSimulation::analyzeTrajectory(), and McMd::McSimulation::analyzeTrajectory().

virtual bool McMd::TrajectoryReader::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 McMd::DCDTrajectoryReader, McMd::DdMdTrajectoryReader, and McMd::LammpsDumpReader.

Referenced by McMd::MdSimulation::analyzeTrajectory(), and McMd::McSimulation::analyzeTrajectory().

virtual void McMd::TrajectoryReader::close ( )
pure virtual
System & McMd::TrajectoryReader::system ( ) const
inlineprotected
Simulation & McMd::TrajectoryReader::simulation ( ) const
inlineprotected
Boundary & McMd::TrajectoryReader::boundary ( ) const
inlineprotected
void McMd::TrajectoryReader::addMolecules ( )
protectedvirtual

Member Data Documentation

int McMd::TrajectoryReader::nAtomTotal_
protected

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