ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Writer::H5md Namespace Reference

Classes

struct  Dataset
 
class  File
 Class for writing H5MD files. More...
 
struct  incompatible_h5mdfile
 
struct  left_backupfile
 
struct  Specification
 Layout information for H5MD files. More...
 

Typedefs

using MultiArray3i = boost::multi_array< int, 3 >
 
using Vector1hs = Utils::Vector< hsize_t, 1 >
 
using Vector2hs = Utils::Vector< hsize_t, 2 >
 
using Vector3hs = Utils::Vector< hsize_t, 3 >
 
using Vector1s = Utils::Vector< std::size_t, 1 >
 
using Vector2s = Utils::Vector< std::size_t, 2 >
 
using Vector3s = Utils::Vector< std::size_t, 3 >
 

Enumerations

enum  H5MDOutputFields : unsigned int {
  H5MD_OUT_NONE = 0u , H5MD_OUT_TYPE = 1u , H5MD_OUT_POS = 2u , H5MD_OUT_IMG = 4u ,
  H5MD_OUT_VEL = 8u , H5MD_OUT_FORCE = 16u , H5MD_OUT_MASS = 32u , H5MD_OUT_CHARGE = 16u ,
  H5MD_OUT_BONDS = 128u , H5MD_OUT_BOX_L = 256u , H5MD_OUT_LE_OFF = 512u , H5MD_OUT_LE_DIR = 1024u ,
  H5MD_OUT_LE_NORMAL = 2048u , H5MD_OUT_ALL = 0b1111111111111111u
}
 Constants which indicate what to output. More...
 

Functions

static auto fields_list_to_bitfield (std::vector< std::string > const &fields)
 
static void backup_file (std::filesystem::path const &from, std::filesystem::path const &to)
 
template<typename extent_type >
static void extend_dataset (HighFive::DataSet &dataset, extent_type const &change_extent)
 
template<typename value_type , typename extent_type >
static void write_dataset (value_type const &data, HighFive::DataSet &dataset, extent_type const &offset, extent_type const &count)
 
template<typename value_type , typename extent_type >
static void write_dataset (value_type const &data, HighFive::DataSet &dataset, extent_type const &change_extent, extent_type const &offset, extent_type const &count)
 
static void write_script (HighFive::File &h5md_file, std::filesystem::path const &script_path)
 
static std::vector< std::size_t > create_dims (hsize_t rank, hsize_t data_dim)
 
static std::vector< std::size_t > create_maxdims (hsize_t rank, hsize_t data_dim, hsize_t max_dim)
 
static std::vector< hsize_tcreate_chunk_dims (hsize_t rank, hsize_t data_dim, hsize_t size)
 
static void write_attributes (HighFive::File &h5md_file)
 
template<std::size_t dim, typename Serializer >
void write_td_particle_property (hsize_t prefix, hsize_t n_part_global, ParticleRange const &particles, HighFive::DataSet &dataset, Serializer serializer)
 
static void write_box (BoxGeometry const &box_geo, HighFive::DataSet &dataset)
 
static void write_le_off (LeesEdwardsBC const &lebc, HighFive::DataSet &dataset)
 
static void write_le_dir (LeesEdwardsBC const &lebc, HighFive::DataSet &dataset)
 
static void write_le_normal (LeesEdwardsBC const &lebc, HighFive::DataSet &dataset)
 

Variables

static std::unordered_map< std::string, H5MDOutputFields > const fields_map
 

Typedef Documentation

◆ MultiArray3i

using Writer::H5md::MultiArray3i = typedef boost::multi_array<int, 3>

Definition at line 61 of file h5md_core.cpp.

◆ Vector1hs

◆ Vector1s

Definition at line 65 of file h5md_core.cpp.

◆ Vector2hs

◆ Vector2s

Definition at line 66 of file h5md_core.cpp.

◆ Vector3hs

◆ Vector3s

Definition at line 67 of file h5md_core.cpp.

Enumeration Type Documentation

◆ H5MDOutputFields

Constants which indicate what to output.

To indicate the output of multiple fields, OR the corresponding values.

Enumerator
H5MD_OUT_NONE 
H5MD_OUT_TYPE 
H5MD_OUT_POS 
H5MD_OUT_IMG 
H5MD_OUT_VEL 
H5MD_OUT_FORCE 
H5MD_OUT_MASS 
H5MD_OUT_CHARGE 
H5MD_OUT_BONDS 
H5MD_OUT_BOX_L 
H5MD_OUT_LE_OFF 
H5MD_OUT_LE_DIR 
H5MD_OUT_LE_NORMAL 
H5MD_OUT_ALL 

Definition at line 55 of file h5md_core.hpp.

Function Documentation

◆ backup_file()

static void Writer::H5md::backup_file ( std::filesystem::path const from,
std::filesystem::path const to 
)
static

Definition at line 96 of file h5md_core.cpp.

References stream.

◆ create_chunk_dims()

static std::vector< hsize_t > Writer::H5md::create_chunk_dims ( hsize_t  rank,
hsize_t  data_dim,
hsize_t  size 
)
static

Definition at line 229 of file h5md_core.cpp.

References stream.

◆ create_dims()

static std::vector< std::size_t > Writer::H5md::create_dims ( hsize_t  rank,
hsize_t  data_dim 
)
static

Definition at line 206 of file h5md_core.cpp.

References stream.

◆ create_maxdims()

static std::vector< std::size_t > Writer::H5md::create_maxdims ( hsize_t  rank,
hsize_t  data_dim,
hsize_t  max_dim 
)
static

Definition at line 217 of file h5md_core.cpp.

References stream.

◆ extend_dataset()

template<typename extent_type >
static void Writer::H5md::extend_dataset ( HighFive::DataSet &  dataset,
extent_type const change_extent 
)
static

◆ fields_list_to_bitfield()

static auto Writer::H5md::fields_list_to_bitfield ( std::vector< std::string > const fields)
static

Definition at line 85 of file h5md_core.cpp.

References fields_map, H5MD_OUT_NONE, and stream.

◆ write_attributes()

static void Writer::H5md::write_attributes ( HighFive::File &  h5md_file)
static

Definition at line 274 of file h5md_core.cpp.

References stream.

◆ write_box()

static void Writer::H5md::write_box ( BoxGeometry const box_geo,
HighFive::DataSet &  dataset 
)
static

◆ write_dataset() [1/2]

template<typename value_type , typename extent_type >
static void Writer::H5md::write_dataset ( value_type const data,
HighFive::DataSet &  dataset,
extent_type const change_extent,
extent_type const offset,
extent_type const count 
)
static

Definition at line 132 of file h5md_core.cpp.

References extend_dataset(), stream, and write_dataset().

◆ write_dataset() [2/2]

template<typename value_type , typename extent_type >
static void Writer::H5md::write_dataset ( value_type const data,
HighFive::DataSet &  dataset,
extent_type const offset,
extent_type const count 
)
static

◆ write_le_dir()

static void Writer::H5md::write_le_dir ( LeesEdwardsBC const lebc,
HighFive::DataSet &  dataset 
)
static

Definition at line 527 of file h5md_core.cpp.

References extend_dataset(), stream, and write_dataset().

Referenced by Writer::H5md::File::write().

◆ write_le_normal()

static void Writer::H5md::write_le_normal ( LeesEdwardsBC const lebc,
HighFive::DataSet &  dataset 
)
static

Definition at line 539 of file h5md_core.cpp.

References extend_dataset(), stream, and write_dataset().

Referenced by Writer::H5md::File::write().

◆ write_le_off()

static void Writer::H5md::write_le_off ( LeesEdwardsBC const lebc,
HighFive::DataSet &  dataset 
)
static

Definition at line 516 of file h5md_core.cpp.

References extend_dataset(), stream, and write_dataset().

Referenced by Writer::H5md::File::write().

◆ write_script()

static void Writer::H5md::write_script ( HighFive::File &  h5md_file,
std::filesystem::path const script_path 
)
static

Definition at line 140 of file h5md_core.cpp.

References stream.

◆ write_td_particle_property()

template<std::size_t dim, typename Serializer >
void Writer::H5md::write_td_particle_property ( hsize_t  prefix,
hsize_t  n_part_global,
ParticleRange const particles,
HighFive::DataSet &  dataset,
Serializer  serializer 
)

Definition at line 488 of file h5md_core.cpp.

References extend_dataset(), ParticleRange::size(), stream, and write_dataset().

Variable Documentation

◆ fields_map

std::unordered_map<std::string, H5MDOutputFields> const Writer::H5md::fields_map
static
Initial value:
= {
{"all", H5MD_OUT_ALL},
{"particle.type", H5MD_OUT_TYPE},
{"particle.position", H5MD_OUT_POS},
{"particle.image", H5MD_OUT_IMG},
{"particle.velocity", H5MD_OUT_VEL},
{"particle.force", H5MD_OUT_FORCE},
{"particle.bonds", H5MD_OUT_BONDS},
{"particle.charge", H5MD_OUT_CHARGE},
{"particle.mass", H5MD_OUT_MASS},
{"box.length", H5MD_OUT_BOX_L},
{"lees_edwards.offset", H5MD_OUT_LE_OFF},
{"lees_edwards.direction", H5MD_OUT_LE_DIR},
{"lees_edwards.normal", H5MD_OUT_LE_NORMAL},
}

Definition at line 69 of file h5md_core.cpp.

Referenced by fields_list_to_bitfield(), and Writer::H5md::File::valid_fields().