WaveBlocksND
|
Our HDF5 writer class. More...
#include <hdf5writer.hpp>
Public Member Functions | |
hdf5writer (std::string name) | |
Construction of hdf5 writer class with a name. More... | |
template<class MultiIndex > | |
void | set_coeff_dim (waveblocks::wavepackets::ScalarHaWp< D, MultiIndex > packet) |
runtime function to evaluate number of coefficients More... | |
template<class MultiIndex > | |
void | prestructuring (waveblocks::wavepackets::ScalarHaWp< D, MultiIndex > packet, double dt) |
prestructure after knowing bool values and packet More... | |
void | set_write_packet (bool flag) |
sets bool value for writing the packet(matrices and coefficients) More... | |
void | set_write_energies (bool flag) |
sets bool value for writing the energies More... | |
void | set_write_norm (bool flag) |
sets bool value for writing norms More... | |
void | set_timestep_packet (int timestep) |
set timestep for writing packet More... | |
void | set_timestep_norm (int timestep) |
set timestep for writing norms More... | |
void | set_timestep_energies (int timestep) |
set timestep for writing energies More... | |
void | set_timestep_epot (int timestep) |
set timestep for writing epot More... | |
void | set_timestep_ekin (int timestep) |
set timestep for writing ekin More... | |
void | set_chunk_dim (void) |
Set up chunk dimension for the written variables. More... | |
void | set_elem_space (void) |
Set up elem space for HDF interface. More... | |
void | set_group_structure (double dt) |
set up group structure in file More... | |
void | select_elem_hyperslabs (void) |
From HDF interface select element hyperslabs. More... | |
void | set_file_dataspace (void) |
set dataspace used in file More... | |
void | allocate_datasets (void) |
allocate space for datasets More... | |
void | setup_extension_norm (void) |
setup extension for norms More... | |
void | setup_extension_epot (void) |
setup extension for epot More... | |
void | setup_extension_ekin (void) |
setup extension for ekin More... | |
void | setup_extension_packet (void) |
setup extension for packet More... | |
void | extend_dataset_packet (void) |
extend dataset for next timestep for packet More... | |
void | extend_dataset_norm (void) |
extend dataset for next timestep for norms More... | |
void | extend_dataset_epot (void) |
extend dataset for next timestep for epot More... | |
void | extend_dataset_ekin (void) |
extend dataset for next timestep for ekin More... | |
void | update_filespace_ekin (void) |
update ekin filespace More... | |
void | update_filespace_epot (void) |
update epot filespace More... | |
void | update_filespace_norm (void) |
update norms filespace More... | |
void | update_filespace_packet (void) |
update packet filespace More... | |
void | transform (std::vector< ctype > &newdata, Eigen::Matrix< complex_t, D, D > mat) |
transform Eigen::Matrix<complex_t,D,D> into std::vector<ctype> More... | |
void | transform (std::vector< ctype > &newdata, Eigen::Matrix< real_t, D, 1 > mat) |
transform Eigen::Matrix<real_t,D,1> into std::vector<ctype> More... | |
void | transform (std::vector< ctype > &newdata, complex_t arg) |
transform a std::complex variable into std::vector<ctype> More... | |
void | transform (std::vector< ctype > &newdata, Eigen::Matrix< complex_t, Eigen::Dynamic, 1 > cmat) |
transform an Eigen::Matrix<complex_t,Eigen::Dynamic,1> to std::vector<ctype> More... | |
void | transform (std::vector< ctype > &newdata, real_t arg) |
transform real_t to std::vector<ctype> More... | |
template<class MultiIndex > | |
void | store_packet (const waveblocks::wavepackets::ScalarHaWp< D, MultiIndex > &packetto) |
store ScalarHaWp<D,Multiindex> packet More... | |
void | store_energies (double epot_, double ekin_) |
store energies in chosen timestep More... | |
template<class MultiIndex > | |
void | store_norm (const waveblocks::wavepackets::ScalarHaWp< D, MultiIndex > &packet) |
store norms in chosen timestep More... | |
void | select_file_writespace_packet (void) |
select file writespace for packet More... | |
void | advance_packet (void) |
advance writing position for packet and extends set More... | |
void | select_file_writespace_ekin (void) |
select file writespace for ekin More... | |
void | advance_ekin (void) |
advance writing position for ekin and extends set More... | |
void | select_file_writespace_epot (void) |
select file writespace for epot More... | |
void | advance_epot (void) |
advance writing position for epot and extends set More... | |
void | select_file_writespace_norm (void) |
select file writespace for norms More... | |
void | advance_norm (void) |
advance writing position for norms and extends set More... | |
void | cleanup_packet (void) |
reverse last dataset extension for packet More... | |
void | cleanup_ekin (void) |
reverse last dataset extension for ekin More... | |
void | cleanup_epot (void) |
reverse last dataset extension for epot More... | |
void | cleanup_norm (void) |
reverse last dataset extension for norms More... | |
void | poststructuring (void) |
last resize for exact length More... | |
Private Attributes | |
H5std_string | filename_ |
placeholder for filename More... | |
CompType | mytype_ |
declaration of H5:CompType member used for HDF interface to write ctype* More... | |
H5File | file_ |
H5File placeholder. More... | |
std::map< std::string, bool > | wrlist ={{"packet",1},{"energy",0},{"norm",0}} |
maps string to bool for constructing und writing defined variables More... | |
Attribute | apacket |
attribute to save bool packet in datablock_0 More... | |
Attribute | aenergy |
attribute to save bool energy in datablock_0 More... | |
Attribute | anorm |
attribute to save bool norm in datablock_0 More... | |
Attribute | adt |
attribute to save dt in datablock_0 More... | |
Attribute | aversion |
attribute to save file version More... | |
double | dref =0. |
fillvalue for energys for allocation More... | |
int | version =2 |
version number More... | |
int | iref =0 |
fillvalue for timegrids for allocation More... | |
H5std_string | packet_group_string ="/Pi" |
String for H5Group to save packet to. Default:Pi. More... | |
H5std_string | datablock_string ="/datablock_0" |
String for H5Group for datablock.default. datablock_0. More... | |
H5std_string | coefficient_group_string ="/coefficients" |
String for H5Group of coefficients. Default:coefficients. More... | |
H5std_string | wavepacket_group_string ="/wavepacket" |
String for H5Group for packet and coefficients. Default:wavepacket. More... | |
H5std_string | energies_group ="/energies" |
name for group energies Default:energies More... | |
H5std_string | norms_group ="/norm" |
name for group norms Default:norm More... | |
H5std_string | observables_group ="/observables" |
name for group observables Default:observables More... | |
DSetCreatPropList | plist_qp |
PropList for packet.q() packet.p() More... | |
DSetCreatPropList | plist_QP |
PropList for packet.Q() packet.P() More... | |
DSetCreatPropList | plist_S |
PropList for packet.S() More... | |
DSetCreatPropList | plist_energy |
PropList for energies. More... | |
DSetCreatPropList | plist_c |
PropList for coefficients. More... | |
DSetCreatPropList | plist_time |
PropList for timegrids. More... | |
DSetCreatPropList | plist_norms |
PropList for norms. More... | |
const int | RANK1 =1 |
rank 1 identifier More... | |
const int | RANK2 =2 |
rank 2 identifier More... | |
const int | RANK3 =3 |
rank 3 identifier More... | |
const hsize_t | maxdims1 [1] ={H5S_UNLIMITED} |
max dim identifier for rank1 for extension More... | |
const hsize_t | maxdims2 [2] ={H5S_UNLIMITED,H5S_UNLIMITED} |
max dim identifier for rank2 for extension More... | |
const hsize_t | maxdims3 [3] ={H5S_UNLIMITED,H5S_UNLIMITED,H5S_UNLIMITED} |
max dim identifier for rank3 for extension More... | |
hsize_t | exqp [3] |
extension for packet.q() packet.p() More... | |
hsize_t | exQP [3] |
extension for packet.Q() packet.P() More... | |
hsize_t | exS [3] |
extension for packet.S() and packet.sdQ() More... | |
hsize_t | exc [2] |
extension for coefficients More... | |
hsize_t | exekin [2] |
extension for ekin More... | |
hsize_t | exepot [2] |
extension for epot More... | |
hsize_t | exnorms [2] |
extension for norms More... | |
hsize_t | ex_timegrid_norms [1] |
extension for timegrid for norms More... | |
hsize_t | ex_timegrid_epot [1] |
extension for timegrid for epot More... | |
hsize_t | ex_timegrid_ekin [1] |
extension for timegrid for ekin More... | |
hsize_t | ex_timegrid_packet [1] |
extension for timegrid for packet More... | |
hsize_t | qpelem [3] |
size of q,p element written from program to file needed by HDF interface More... | |
DataSpace | qpelemspace |
space of q,p element written from program to file needed by HDF interface More... | |
hsize_t | QPelem [3] |
size of Q,P element written from program to file needed by HDF interface More... | |
DataSpace | QPelemspace |
space of Q,P element written from program to file needed by HDF interface More... | |
hsize_t | Selem [3] |
size of S element written from program to file needed by HDF interface More... | |
DataSpace | Selemspace |
space of S element written from program to file needed by HDF interface More... | |
hsize_t | energyelem [2] |
size of energy element written from program to file needed by HDF interface More... | |
DataSpace | energyelemspace |
space of energy element written from program to file needed by HDF interface More... | |
hsize_t | timeelem [1] |
size of timegrid element written from program to file needed by HDF interface More... | |
DataSpace | timelemspace |
space of timegrid element written from program to file needed by HDF interface More... | |
hsize_t | celem [2] |
size of coefficient element written from program to file needed by HDF interface More... | |
DataSpace | celemspace |
space of coefficient element written from program to file needed by HDF interface More... | |
hsize_t | normelem [2] |
size of coefficient element written from program to file needed by HDF interface More... | |
DataSpace | normelemspace |
space of norm element written from program to file needed by HDF interface More... | |
int | index_packet =1 |
index used for storing packet More... | |
int | index_norm =1 |
index used for storing norm More... | |
int | index_ekin =1 |
index used for storing ekin More... | |
int | index_epot =1 |
index used for storing epot More... | |
int | timestepsize_norms =1 |
timestepsize for norm timegrid More... | |
int | timestepsize_ekin =1 |
timestepsize for ekin timegrid More... | |
int | timestepsize_epot =1 |
timestepsize for epot timegrid More... | |
int | timestepsize_packet =1 |
timestepsize for packet timegrid More... | |
int | tindex_ekin =0 |
timeindex for modulo writing ekin More... | |
int | tindex_epot =0 |
timeindex for modulo writing epot More... | |
int | tindex_norm =0 |
timeindex for modulo writing norms More... | |
int | tindex_packet =0 |
timeindex for modulo writing packet More... | |
int | csize |
runtime size coefficients More... | |
std::shared_ptr< Group > | gblock |
group for datablock More... | |
std::shared_ptr< Group > | gpacket |
group for packet More... | |
std::shared_ptr< Group > | gPi |
group for matrices in packet More... | |
std::shared_ptr< Group > | gcoefficient |
group for coefficients in packet More... | |
std::shared_ptr< Group > | genergy |
group for energies More... | |
std::shared_ptr< Group > | gnorms |
group for norms More... | |
std::shared_ptr< Group > | gobservables |
group for observables More... | |
DataSpace | qspace |
space for packet.q() in file More... | |
std::shared_ptr< DataSet > | qs |
dataset for packet.q() in file More... | |
DataSpace | pspace |
space for packet.p() in file More... | |
std::shared_ptr< DataSet > | ps |
dataset for packet.p() in file More... | |
DataSpace | Qspace |
space for packet.Q() in file More... | |
std::shared_ptr< DataSet > | Qs |
dataset for packet.Q() in file More... | |
DataSpace | Pspace |
space for packet.P() in file More... | |
std::shared_ptr< DataSet > | Ps |
dataset for packet.P() in file More... | |
DataSpace | Sspace |
space for packet.S() in file More... | |
std::shared_ptr< DataSet > | Ss |
dataset for packet.S() in file More... | |
DataSpace | adQspace |
space for packet.sdQ() in file More... | |
std::shared_ptr< DataSet > | adQs |
dataset for packet.sdQ() in file More... | |
DataSpace | cspace |
space for coefficients in file More... | |
std::shared_ptr< DataSet > | coeffs |
dataset for coefficients in file More... | |
DataSpace | timespace_packet |
space for timegrid for packet in file More... | |
std::shared_ptr< DataSet > | times_packet |
dataset for timegrid for packet in file More... | |
DataSpace | timespace_ekin |
space for timegrid ekin More... | |
std::shared_ptr< DataSet > | times_ekin |
dataset for timegrid for ekin in file More... | |
DataSpace | timespace_epot |
space for timegrid epot More... | |
std::shared_ptr< DataSet > | times_epot |
dataset for timegrid for epot in file More... | |
DataSpace | timespace_norms |
space for timegrid in file More... | |
std::shared_ptr< DataSet > | times_norms |
dataset for timegrid in file More... | |
DataSpace | energyspace_ekin |
space for ekin in file More... | |
std::shared_ptr< DataSet > | energys_ekin |
dataset for ekin in file More... | |
DataSpace | energyspace_epot |
space for epot in file More... | |
std::shared_ptr< DataSet > | energys_epot |
dataset for epot in file More... | |
DataSpace | normspace |
space for norms More... | |
std::shared_ptr< DataSet > | normss |
dataset for norms in file More... | |
Friends | |
struct | ctype |
Our HDF5 writer class.
This class is templated on the Dimension D which is also used to also define the dimensionality of the HaWpBasisVector. Also after ctor is called there has to follow a prestructuring<MultiIndex>() for correct construction
|
inline |
Construction of hdf5 writer class with a name.
name | for construction |
Construction of hdf5 writer from std::string
name | where also implicitly the definition of our H5:CompType is hidden. Also the H5::File gets constructed by the |
name | where it is open with H5F_ACC_TRUNC value |
|
inline |
advance writing position for ekin and extends set
Wrapper for index_ekin++, set_up_extension_ekin(), extend_dataset_ekin() and update_filespace_ekin()
|
inline |
advance writing position for epot and extends set
Wrapper for index_epot++, set_up_extension_epot(), extend_dataset_epot() and update_filespace_epot()
|
inline |
advance writing position for norms and extends set
Wrapper for index_norm++, set_up_extension_norms(), extend_dataset_norms() and update_filespace_norms()
|
inline |
advance writing position for packet and extends set
Wrapper for index_packet++, set_up_extension_packet(), extend_dataset_packet() and update_filespace_packet()
|
inline |
allocate space for datasets
Allocate all datasets in file depending on the set bool values. This is called once and uses shared_ptr for easy use no garbage collection needed.
|
inline |
reverse last dataset extension for ekin
Last writing process extended set although it is the last one. This just reverses the last extension so the dataset is exactly as big as the number of timesteps written.
|
inline |
reverse last dataset extension for epot
Last writing process extended set although it is the last one. This just reverses the last extension so the dataset is exactly as big as the number of timesteps written.
|
inline |
reverse last dataset extension for norms
Last writing process extended set although it is the last one. This just reverses the last extension so the dataset is exactly as big as the number of timesteps written.
|
inline |
reverse last dataset extension for packet
Last writing process extended set although it is the last one. This just reverses the last extension so the dataset is exactly as big as the number of timesteps written.
|
inline |
extend dataset for next timestep for ekin
Called after a subset was written and extension is set.
|
inline |
extend dataset for next timestep for epot
Called after a subset was written and extension is set.
|
inline |
extend dataset for next timestep for norms
Called after a subset was written and extension is set.
|
inline |
extend dataset for next timestep for packet
Called after a subset was written and extension is set.
|
inline |
last resize for exact length
Wrapper for all cleanup calls
|
inline |
prestructure after knowing bool values and packet
packet | used for evaluation number of coefficients |
dt | to save timestepsize as attribute |
|
inline |
From HDF interface select element hyperslabs.
These elements are selected such that in every timestep it can be written to file. This is onlye called once because the elemantary spaces should never change.
|
inline |
select file writespace for ekin
Called always before ekin is written to evaluate space to write.
|
inline |
select file writespace for epot
Called always before epot is written to evaluate space to write.
|
inline |
select file writespace for norms
Called always before norms are written to evaluate space to write.
|
inline |
select file writespace for packet
Called always before packet is written to evaluate space to write.
|
inline |
Set up chunk dimension for the written variables.
The HDF Interface needs that the PropList exits with chunked dimension otherwise it is not possible to extend this particular DataSet
|
inline |
runtime function to evaluate number of coefficients
packet | to deduce number of coefficients Used in prestructuring<MultiIndex> |
|
inline |
Set up elem space for HDF interface.
The HDF Interface needs a DataSpace for elements written from data to the file. A dataspace is constructet from a rank identifier and corresponding hsize_t dimension array which has to be of size rank
|
inline |
set dataspace used in file
Initial construction of the spaces for all sets. Also called only once because later with extensions it has to be resett in every extension call with new sizes.
|
inline |
set up group structure in file
dt | for writing global timestep |
This is needed for the correct subtructure of all datasets. It also sets Attributes in datablock to save which datasets were written and its correspondig global timestep.
|
inline |
set timestep for writing ekin
timestep |
|
inline |
set timestep for writing energies
timestep |
|
inline |
set timestep for writing epot
timestep |
|
inline |
set timestep for writing norms
timestep |
|
inline |
set timestep for writing packet
timestep |
|
inline |
sets bool value for writing the energies
flag |
|
inline |
sets bool value for writing norms
flag |
|
inline |
sets bool value for writing the packet(matrices and coefficients)
flag |
|
inline |
setup extension for ekin
Called after a subset was written.
|
inline |
setup extension for epot
Called after a subset was written.
|
inline |
setup extension for norms
Called after a subset was written.
|
inline |
setup extension for packet
Called after a subset was written.
|
inline |
store energies in chosen timestep
epot_ | |
ekin_ |
|
inline |
store norms in chosen timestep
Extendable for norms user is interested in.
|
inline |
store ScalarHaWp<D,Multiindex> packet
Uses the the transformer PacketToCoefficients<wavepackets::ScalarHaWp<D,MultiIndex>>to(packet) and the packet.parameters() function to call their corresponding transform function which then can be written to dataset.
|
inline |
transform Eigen::Matrix<complex_t,D,D> into std::vector<ctype>
newdata | |
mat | Transforms an Eigen::Matrix<complex_t,D,D> into a writeable ctype* |
|
inline |
transform Eigen::Matrix<real_t,D,1> into std::vector<ctype>
newdata | |
mat | Transforms an Eigen::Matrix<real_t,D,1> into a writable std::vector<ctype> |
|
inline |
transform a std::complex variable into std::vector<ctype>
newdata | |
arg | Transform a complex_t type into writable std::vector<ctype> |
|
inline |
transform an Eigen::Matrix<complex_t,Eigen::Dynamic,1> to std::vector<ctype>
newdata | |
cmat | Transform a Eigen::Matrix<complex_t,Eigen::Dynamic,1> into writable std::vector<ctype> |
|
inline |
transform real_t to std::vector<ctype>
newdata | |
arg | Transforms a real_t into writeable std::vector<ctype> |
|
inline |
update ekin filespace
Needs to be done after extending this dataset
|
inline |
update epot filespace
Needs to be done after extending this dataset
|
inline |
update norms filespace
Needs to be done after extending this dataset
|
inline |
update packet filespace
Needs to be done after extending this dataset
|
friend |
|
private |
dataset for packet.sdQ() in file
|
private |
space for packet.sdQ() in file
|
private |
attribute to save dt in datablock_0
|
private |
attribute to save bool energy in datablock_0
|
private |
attribute to save bool norm in datablock_0
|
private |
attribute to save bool packet in datablock_0
|
private |
attribute to save file version
|
private |
size of coefficient element written from program to file needed by HDF interface
|
private |
space of coefficient element written from program to file needed by HDF interface
|
private |
String for H5Group of coefficients. Default:coefficients.
|
private |
dataset for coefficients in file
|
private |
runtime size coefficients
|
private |
space for coefficients in file
|
private |
String for H5Group for datablock.default. datablock_0.
|
private |
fillvalue for energys for allocation
|
private |
name for group energies Default:energies
|
private |
size of energy element written from program to file needed by HDF interface
|
private |
space of energy element written from program to file needed by HDF interface
|
private |
dataset for ekin in file
|
private |
dataset for epot in file
|
private |
space for ekin in file
|
private |
space for epot in file
|
private |
extension for timegrid for ekin
|
private |
extension for timegrid for epot
|
private |
extension for timegrid for norms
|
private |
extension for timegrid for packet
|
private |
extension for coefficients
|
private |
extension for ekin
|
private |
extension for epot
|
private |
extension for norms
|
private |
extension for packet.q() packet.p()
|
private |
extension for packet.Q() packet.P()
|
private |
extension for packet.S() and packet.sdQ()
|
private |
H5File placeholder.
|
private |
placeholder for filename
|
private |
group for datablock
|
private |
group for coefficients in packet
|
private |
group for energies
|
private |
group for norms
|
private |
group for observables
|
private |
group for packet
|
private |
group for matrices in packet
|
private |
index used for storing ekin
|
private |
index used for storing epot
|
private |
index used for storing norm
|
private |
index used for storing packet
|
private |
fillvalue for timegrids for allocation
|
private |
max dim identifier for rank1 for extension
|
private |
max dim identifier for rank2 for extension
|
private |
max dim identifier for rank3 for extension
|
private |
declaration of H5:CompType member used for HDF interface to write ctype*
|
private |
size of coefficient element written from program to file needed by HDF interface
|
private |
space of norm element written from program to file needed by HDF interface
|
private |
name for group norms Default:norm
|
private |
space for norms
|
private |
dataset for norms in file
|
private |
name for group observables Default:observables
|
private |
String for H5Group to save packet to. Default:Pi.
|
private |
PropList for coefficients.
|
private |
PropList for energies.
|
private |
PropList for norms.
|
private |
PropList for packet.q() packet.p()
|
private |
PropList for packet.Q() packet.P()
|
private |
PropList for packet.S()
|
private |
PropList for timegrids.
|
private |
dataset for packet.p() in file
|
private |
dataset for packet.P() in file
|
private |
space for packet.p() in file
|
private |
space for packet.P() in file
|
private |
size of q,p element written from program to file needed by HDF interface
|
private |
size of Q,P element written from program to file needed by HDF interface
|
private |
space of q,p element written from program to file needed by HDF interface
|
private |
space of Q,P element written from program to file needed by HDF interface
|
private |
dataset for packet.q() in file
|
private |
dataset for packet.Q() in file
|
private |
space for packet.q() in file
|
private |
space for packet.Q() in file
|
private |
rank 1 identifier
|
private |
rank 2 identifier
|
private |
rank 3 identifier
|
private |
size of S element written from program to file needed by HDF interface
|
private |
space of S element written from program to file needed by HDF interface
|
private |
dataset for packet.S() in file
|
private |
space for packet.S() in file
|
private |
size of timegrid element written from program to file needed by HDF interface
|
private |
space of timegrid element written from program to file needed by HDF interface
|
private |
dataset for timegrid for ekin in file
|
private |
dataset for timegrid for epot in file
|
private |
dataset for timegrid in file
|
private |
dataset for timegrid for packet in file
|
private |
space for timegrid ekin
|
private |
space for timegrid epot
|
private |
space for timegrid in file
|
private |
space for timegrid for packet in file
|
private |
timestepsize for ekin timegrid
|
private |
timestepsize for epot timegrid
|
private |
timestepsize for norm timegrid
|
private |
timestepsize for packet timegrid
|
private |
timeindex for modulo writing ekin
|
private |
timeindex for modulo writing epot
|
private |
timeindex for modulo writing norms
|
private |
timeindex for modulo writing packet
|
private |
version number
|
private |
String for H5Group for packet and coefficients. Default:wavepacket.
|
private |
maps string to bool for constructing und writing defined variables