Loading...
Searching...
No Matches
PLMD::TrajectoryParser Class Reference

#include <TrajectoryParser.h>

Public Types

enum class  trajfmt {
  molfile , xdr_xtc , xdr_trr , xyz ,
  gro , dlp4 , error
}
 

Public Member Functions

 TrajectoryParser ()
 
 ~TrajectoryParser ()
 
std::optional< std::string > init (std::string_view fmt, FILE *fileHandle)
 
std::optional< std::string > init (std::string_view fmt, std::string_view fname, bool useMolfile=false, int command_line_natoms=-1)
 
int nOfAtoms () const
 Return the number of atoms.
 
std::optional< std::string > readAtoms (int stride, bool dont_read_pbc, bool debug_pd, int pd_start, int pd_nlocal, long long int &step, double *masses, double *charges, double *coordinates, double *cell)
 
std::optional< std::string > readAtoms (int stride, bool dont_read_pbc, bool debug_pd, int pd_start, int pd_nlocal, long long int &step, float *masses, float *charges, float *coordinates, float *cell)
 
std::optional< std::string > readFrame (int stride, bool dont_read_pbc, bool debug_pd, int pd_start, int pd_nlocal, long long int &step, double &timeStep, double *masses, double *charges, double *coordinates, double *cell)
 
std::optional< std::string > readFrame (int stride, bool dont_read_pbc, bool debug_pd, int pd_start, int pd_nlocal, long long int &step, float &timeStep, float *masses, float *charges, float *coordinates, float *cell)
 
std::optional< std::string > readHeader (long long int &step, double &timeStep)
 
std::optional< std::string > readHeader (long long int &step, float &timeStep)
 
std::optional< std::string > rewind ()
 Return the file pointer to the initial position (use at your own risk)
 

Static Public Member Functions

static trajfmt FMTfromString (std::string_view fmt)
 
static std::vector< std::string > getMolfilePluginsnames ()
 
static void registerKeywords (Keywords &keys)
 
static std::string toString (trajfmt fmt)
 
static std::vector< std::string > trajectoryOptions ()
 

Private Attributes

std::unique_ptr< fileParserparser
 

Member Enumeration Documentation

◆ trajfmt

Enumerator
molfile 
xdr_xtc 
xdr_trr 
xyz 
gro 
dlp4 
error 

Constructor & Destructor Documentation

◆ TrajectoryParser()

PLMD::TrajectoryParser::TrajectoryParser ( )
default

◆ ~TrajectoryParser()

PLMD::TrajectoryParser::~TrajectoryParser ( )
default

Member Function Documentation

◆ FMTfromString()

TrajectoryParser::trajfmt PLMD::TrajectoryParser::FMTfromString ( std::string_view fmt)
static

◆ getMolfilePluginsnames()

std::vector< std::string > PLMD::TrajectoryParser::getMolfilePluginsnames ( )
static

◆ init() [1/2]

std::optional< std::string > PLMD::TrajectoryParser::init ( std::string_view fmt,
FILE * fileHandle )

◆ init() [2/2]

std::optional< std::string > PLMD::TrajectoryParser::init ( std::string_view fmt,
std::string_view fname,
bool useMolfile = false,
int command_line_natoms = -1 )

◆ nOfAtoms()

int PLMD::TrajectoryParser::nOfAtoms ( ) const

Return the number of atoms.

◆ readAtoms() [1/2]

std::optional< std::string > PLMD::TrajectoryParser::readAtoms ( int stride,
bool dont_read_pbc,
bool debug_pd,
int pd_start,
int pd_nlocal,
long long int & step,
double * masses,
double * charges,
double * coordinates,
double * cell )

◆ readAtoms() [2/2]

std::optional< std::string > PLMD::TrajectoryParser::readAtoms ( int stride,
bool dont_read_pbc,
bool debug_pd,
int pd_start,
int pd_nlocal,
long long int & step,
float * masses,
float * charges,
float * coordinates,
float * cell )

◆ readFrame() [1/2]

std::optional< std::string > PLMD::TrajectoryParser::readFrame ( int stride,
bool dont_read_pbc,
bool debug_pd,
int pd_start,
int pd_nlocal,
long long int & step,
double & timeStep,
double * masses,
double * charges,
double * coordinates,
double * cell )

◆ readFrame() [2/2]

std::optional< std::string > PLMD::TrajectoryParser::readFrame ( int stride,
bool dont_read_pbc,
bool debug_pd,
int pd_start,
int pd_nlocal,
long long int & step,
float & timeStep,
float * masses,
float * charges,
float * coordinates,
float * cell )

◆ readHeader() [1/2]

std::optional< std::string > PLMD::TrajectoryParser::readHeader ( long long int & step,
double & timeStep )

◆ readHeader() [2/2]

std::optional< std::string > PLMD::TrajectoryParser::readHeader ( long long int & step,
float & timeStep )

◆ registerKeywords()

void PLMD::TrajectoryParser::registerKeywords ( Keywords & keys)
static

◆ rewind()

std::optional< std::string > PLMD::TrajectoryParser::rewind ( )

Return the file pointer to the initial position (use at your own risk)

◆ toString()

std::string PLMD::TrajectoryParser::toString ( trajfmt fmt)
static

◆ trajectoryOptions()

std::vector< std::string > PLMD::TrajectoryParser::trajectoryOptions ( )
static

Member Data Documentation

◆ parser

std::unique_ptr<fileParser> PLMD::TrajectoryParser::parser
private

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