votca 2024-dev
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
votca::csg::H5MDTrajectoryReader Class Reference

class for reading H5MD trajectory. More...

#include <h5mdtrajectoryreader.h>

Inheritance diagram for votca::csg::H5MDTrajectoryReader:
Inheritance graph
[legend]
Collaboration diagram for votca::csg::H5MDTrajectoryReader:
Collaboration graph
[legend]

Public Member Functions

 H5MDTrajectoryReader ()
 
 ~H5MDTrajectoryReader () override
 
bool Open (const std::string &file) override
 Opens original trajectory file.
 
void Initialize (Topology &top)
 Initialize data structures.
 
bool FirstFrame (Topology &conf) override
 Reads in the first frame.
 
bool NextFrame (Topology &conf) override
 Reads in the next frame.
 
void Close () override
 Closes original trajectory file.
 
- Public Member Functions inherited from votca::csg::TrajectoryReader
virtual ~TrajectoryReader ()=default
 
virtual bool Open (const std::string &file)=0
 open a trejectory file
 
virtual void Close ()
 
virtual bool FirstFrame (Topology &top)=0
 read in the first frame
 
virtual bool NextFrame (Topology &top)=0
 read in the next frame
 

Private Types

enum  DatasetState { NONE , STATIC , TIMEDEPENDENT }
 

Private Member Functions

template<typename T1 >
T1 * ReadVectorData (hid_t ds, hid_t ds_data_type, Index row)
 Reads dataset that contains vectors.
 
template<typename T1 >
T1 * ReadScalarData (hid_t ds, hid_t ds_data_type, Index row)
 Reads dataset with scalar values.
 
template<typename T1 >
void ReadStaticData (hid_t ds, hid_t ds_data_type, std::unique_ptr< T1 > &outbuf)
 
void ReadBox (hid_t ds, hid_t ds_data_type, Index row, std::unique_ptr< double[]> &data_out)
 
double ReadScaleFactor (const hid_t &ds, const std::string &unit_type)
 
void CheckError (hid_t hid, std::string error_message)
 
bool GroupExists (hid_t file_id, std::string path)
 

Private Attributes

hid_t file_id_
 
hid_t ds_atom_position_
 
hid_t ds_atom_force_
 
hid_t ds_atom_velocity_
 
hid_t ds_atom_id_
 
hid_t ds_edges_group_
 
hid_t particle_group_
 
hid_t atom_position_group_
 
hid_t atom_force_group_
 
hid_t atom_velocity_group_
 
hid_t atom_id_group_
 
hid_t edges_group_
 
Index rank_
 
std::string fname_
 
bool first_frame_
 
DatasetState has_velocity_
 
DatasetState has_force_
 
DatasetState has_id_group_
 
DatasetState has_box_
 
bool file_opened_
 
Index idx_frame_
 
Index max_idx_frame_
 
Index N_particles_
 
int vec_components_
 
bool unit_module_enabled_ = false
 
double length_scaling_ = 1.0
 
double velocity_scaling_ = 1.0
 
double force_scaling_ = 1.0
 
std::unordered_map< std::string, double > votca_units_scaling_factors
 
boost::regex suffix_units = boost::regex("^([a-z]+)([0-9+-]+)")
 
Eigen::Matrix3d m
 

Additional Inherited Members

- Static Public Member Functions inherited from votca::csg::TrajectoryReader
static void RegisterPlugins (void)
 

Detailed Description

class for reading H5MD trajectory.

This class implements the H5MD trajectory reading function. The format of the H5MD file is defined in Pierre de Buyl, Peter H. Colberg, Felix Höfling, H5MD: A structured, efficient, and portable file format for molecular data, http://dx.doi.org/10.1016/j.cpc.2014.01.018 The current reference is available here: http://nongnu.org/h5md/

Definition at line 48 of file h5mdtrajectoryreader.h.

Member Enumeration Documentation

◆ DatasetState

Enumerator
NONE 
STATIC 
TIMEDEPENDENT 

Definition at line 69 of file h5mdtrajectoryreader.h.

Constructor & Destructor Documentation

◆ H5MDTrajectoryReader()

votca::csg::H5MDTrajectoryReader::H5MDTrajectoryReader ( )

Definition at line 36 of file h5mdtrajectoryreader.cc.

◆ ~H5MDTrajectoryReader()

votca::csg::H5MDTrajectoryReader::~H5MDTrajectoryReader ( )
override

Definition at line 43 of file h5mdtrajectoryreader.cc.

Member Function Documentation

◆ CheckError()

void votca::csg::H5MDTrajectoryReader::CheckError ( hid_t  hid,
std::string  error_message 
)
inlineprivate

Definition at line 135 of file h5mdtrajectoryreader.h.

◆ Close()

void votca::csg::H5MDTrajectoryReader::Close ( )
overridevirtual

Closes original trajectory file.

Reimplemented from votca::csg::TrajectoryReader.

Definition at line 107 of file h5mdtrajectoryreader.cc.

◆ FirstFrame()

bool votca::csg::H5MDTrajectoryReader::FirstFrame ( Topology conf)
overridevirtual

Reads in the first frame.

Implements votca::csg::TrajectoryReader.

Definition at line 234 of file h5mdtrajectoryreader.cc.

◆ GroupExists()

bool votca::csg::H5MDTrajectoryReader::GroupExists ( hid_t  file_id,
std::string  path 
)
inlineprivate

Definition at line 142 of file h5mdtrajectoryreader.h.

◆ Initialize()

void votca::csg::H5MDTrajectoryReader::Initialize ( Topology top)

Initialize data structures.

Definition at line 114 of file h5mdtrajectoryreader.cc.

◆ NextFrame()

bool votca::csg::H5MDTrajectoryReader::NextFrame ( Topology conf)
overridevirtual

Reads in the next frame.

Reading the data.

Implements votca::csg::TrajectoryReader.

Definition at line 245 of file h5mdtrajectoryreader.cc.

◆ Open()

bool votca::csg::H5MDTrajectoryReader::Open ( const std::string &  file)
overridevirtual

Opens original trajectory file.

Implements votca::csg::TrajectoryReader.

Definition at line 50 of file h5mdtrajectoryreader.cc.

◆ ReadBox()

void votca::csg::H5MDTrajectoryReader::ReadBox ( hid_t  ds,
hid_t  ds_data_type,
Index  row,
std::unique_ptr< double[]> &  data_out 
)
private

Definition at line 351 of file h5mdtrajectoryreader.cc.

◆ ReadScalarData()

template<typename T1 >
T1 * votca::csg::H5MDTrajectoryReader::ReadScalarData ( hid_t  ds,
hid_t  ds_data_type,
Index  row 
)
inlineprivate

Reads dataset with scalar values.

Definition at line 99 of file h5mdtrajectoryreader.h.

◆ ReadScaleFactor()

double votca::csg::H5MDTrajectoryReader::ReadScaleFactor ( const hid_t &  ds,
const std::string &  unit_type 
)
private

Definition at line 370 of file h5mdtrajectoryreader.cc.

◆ ReadStaticData()

template<typename T1 >
void votca::csg::H5MDTrajectoryReader::ReadStaticData ( hid_t  ds,
hid_t  ds_data_type,
std::unique_ptr< T1 > &  outbuf 
)
inlineprivate

Definition at line 121 of file h5mdtrajectoryreader.h.

◆ ReadVectorData()

template<typename T1 >
T1 * votca::csg::H5MDTrajectoryReader::ReadVectorData ( hid_t  ds,
hid_t  ds_data_type,
Index  row 
)
inlineprivate

Reads dataset that contains vectors.

Definition at line 73 of file h5mdtrajectoryreader.h.

Member Data Documentation

◆ atom_force_group_

hid_t votca::csg::H5MDTrajectoryReader::atom_force_group_
private

Definition at line 160 of file h5mdtrajectoryreader.h.

◆ atom_id_group_

hid_t votca::csg::H5MDTrajectoryReader::atom_id_group_
private

Definition at line 162 of file h5mdtrajectoryreader.h.

◆ atom_position_group_

hid_t votca::csg::H5MDTrajectoryReader::atom_position_group_
private

Definition at line 159 of file h5mdtrajectoryreader.h.

◆ atom_velocity_group_

hid_t votca::csg::H5MDTrajectoryReader::atom_velocity_group_
private

Definition at line 161 of file h5mdtrajectoryreader.h.

◆ ds_atom_force_

hid_t votca::csg::H5MDTrajectoryReader::ds_atom_force_
private

Definition at line 153 of file h5mdtrajectoryreader.h.

◆ ds_atom_id_

hid_t votca::csg::H5MDTrajectoryReader::ds_atom_id_
private

Definition at line 155 of file h5mdtrajectoryreader.h.

◆ ds_atom_position_

hid_t votca::csg::H5MDTrajectoryReader::ds_atom_position_
private

Definition at line 152 of file h5mdtrajectoryreader.h.

◆ ds_atom_velocity_

hid_t votca::csg::H5MDTrajectoryReader::ds_atom_velocity_
private

Definition at line 154 of file h5mdtrajectoryreader.h.

◆ ds_edges_group_

hid_t votca::csg::H5MDTrajectoryReader::ds_edges_group_
private

Definition at line 156 of file h5mdtrajectoryreader.h.

◆ edges_group_

hid_t votca::csg::H5MDTrajectoryReader::edges_group_
private

Definition at line 163 of file h5mdtrajectoryreader.h.

◆ file_id_

hid_t votca::csg::H5MDTrajectoryReader::file_id_
private

Definition at line 151 of file h5mdtrajectoryreader.h.

◆ file_opened_

bool votca::csg::H5MDTrajectoryReader::file_opened_
private

Definition at line 176 of file h5mdtrajectoryreader.h.

◆ first_frame_

bool votca::csg::H5MDTrajectoryReader::first_frame_
private

Definition at line 168 of file h5mdtrajectoryreader.h.

◆ fname_

std::string votca::csg::H5MDTrajectoryReader::fname_
private

Definition at line 167 of file h5mdtrajectoryreader.h.

◆ force_scaling_

double votca::csg::H5MDTrajectoryReader::force_scaling_ = 1.0
private

Definition at line 191 of file h5mdtrajectoryreader.h.

◆ has_box_

DatasetState votca::csg::H5MDTrajectoryReader::has_box_
private

Definition at line 174 of file h5mdtrajectoryreader.h.

◆ has_force_

DatasetState votca::csg::H5MDTrajectoryReader::has_force_
private

Definition at line 172 of file h5mdtrajectoryreader.h.

◆ has_id_group_

DatasetState votca::csg::H5MDTrajectoryReader::has_id_group_
private

Definition at line 173 of file h5mdtrajectoryreader.h.

◆ has_velocity_

DatasetState votca::csg::H5MDTrajectoryReader::has_velocity_
private

Definition at line 171 of file h5mdtrajectoryreader.h.

◆ idx_frame_

Index votca::csg::H5MDTrajectoryReader::idx_frame_
private

Definition at line 179 of file h5mdtrajectoryreader.h.

◆ length_scaling_

double votca::csg::H5MDTrajectoryReader::length_scaling_ = 1.0
private

Definition at line 189 of file h5mdtrajectoryreader.h.

◆ m

Eigen::Matrix3d votca::csg::H5MDTrajectoryReader::m
private

Definition at line 204 of file h5mdtrajectoryreader.h.

◆ max_idx_frame_

Index votca::csg::H5MDTrajectoryReader::max_idx_frame_
private

Definition at line 180 of file h5mdtrajectoryreader.h.

◆ N_particles_

Index votca::csg::H5MDTrajectoryReader::N_particles_
private

Definition at line 183 of file h5mdtrajectoryreader.h.

◆ particle_group_

hid_t votca::csg::H5MDTrajectoryReader::particle_group_
private

Definition at line 158 of file h5mdtrajectoryreader.h.

◆ rank_

Index votca::csg::H5MDTrajectoryReader::rank_
private

Definition at line 165 of file h5mdtrajectoryreader.h.

◆ suffix_units

boost::regex votca::csg::H5MDTrajectoryReader::suffix_units = boost::regex("^([a-z]+)([0-9+-]+)")
private

Definition at line 201 of file h5mdtrajectoryreader.h.

◆ unit_module_enabled_

bool votca::csg::H5MDTrajectoryReader::unit_module_enabled_ = false
private

Definition at line 188 of file h5mdtrajectoryreader.h.

◆ vec_components_

int votca::csg::H5MDTrajectoryReader::vec_components_
private

Definition at line 185 of file h5mdtrajectoryreader.h.

◆ velocity_scaling_

double votca::csg::H5MDTrajectoryReader::velocity_scaling_ = 1.0
private

Definition at line 190 of file h5mdtrajectoryreader.h.

◆ votca_units_scaling_factors

std::unordered_map<std::string, double> votca::csg::H5MDTrajectoryReader::votca_units_scaling_factors
private
Initial value:
=
std::unordered_map<std::string, double>({{"fm", 0.000001},
{"pm", 0.001},
{"nm", 1.0},
{"A", 0.1},
{"um", 1000.0}})

Definition at line 194 of file h5mdtrajectoryreader.h.


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