Inovesa
Tool to simulate beam dynamics in synchrotron light sources
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
vfps::HDF5File Class Reference

HDF5 result file as it is written to disk. More...

#include <HDF5File.hpp>

Public Types

enum  AppendType : uint_fast16_t { All, Defaults, PhaseSpace }
 The AppendType enum. More...
 

Public Member Functions

 HDF5File (const std::string &filename, const std::shared_ptr< PhaseSpace > ps, const ElectricField *ef, const std::shared_ptr< Impedance > imp, const size_t nparticles, const double t_sync, const double f_rev)
 HDF5File. More...
 
void addParameterToGroup (std::string groupname, std::string paramname, H5::PredType type, void *data)
 
void append (const ElectricField *ef, const bool fullspectrum=true)
 append synchrotron radiation data More...
 
void appendPadded (const ElectricField *ef)
 savePaddedProfile More...
 
void appendRFKicks (const std::vector< std::array< vfps::meshaxis_t, 2 >> &kicks)
 
void appendTracks (const std::vector< PhaseSpace::Position > &p)
 
void append (const PhaseSpace &ps, const timeaxis_t t, const AppendType at=AppendType::Defaults)
 
void append (const WakeKickMap *wkm)
 
template<int rank, typename datatype >
vfps::HDF5File::DatasetInfo< rank > _makeDatasetInfo (std::string name, std::array< hsize_t, rank > dims, std::array< hsize_t, rank > chunkdims, std::array< hsize_t, rank > maxdims)
 

Static Public Member Functions

static std::unique_ptr< PhaseSpacereadPhaseSpace (std::string fname, meshaxis_t qmin, meshaxis_t qmax, meshaxis_t pmin, meshaxis_t pmax, oclhptr_t oclh, double Qb, double Ib_unscaled, double bl, double dE, int64_t use_step=-1l)
 

Detailed Description

HDF5 result file as it is written to disk.

The file is created on construction. Constant data is already added on construction. All data that might change during simulation is added later, the file is (only) prepared so that it can be appended.

There are axis (named /Infos/AxisValues_...) and datasets containing the actual data (named .../data). The latter have links to the corrsponding axis next to them, that hold information on the dimension of the dataset.

To avoid slowing down computation, data is saved as a binary copy. This leaves normalization, units and dimensions untouched. Conversion to physical units is facilitated by conversion factors, that are given as attributes to the data frames.

Definition at line 48 of file HDF5File.hpp.

Member Enumeration Documentation

◆ AppendType

enum vfps::HDF5File::AppendType : uint_fast16_t
strong

The AppendType enum.

All: save everything Defaults: (no phase space) PhaseSpace: phase space only

Definition at line 98 of file HDF5File.hpp.

Constructor & Destructor Documentation

◆ HDF5File()

vfps::HDF5File::HDF5File ( const std::string &  filename,
const std::shared_ptr< PhaseSpace ps,
const ElectricField ef,
const std::shared_ptr< Impedance imp,
const size_t  nparticles,
const double  t_sync,
const double  f_rev 
)

HDF5File.

Parameters
filenamefile name to save HDF5 file to
psphase space (to know dimensions, etc.)
efelectric field used for CSR computation
impImpedance
wfmwake
nparticles
t_sync
f_rev

Definition at line 29 of file HDF5File.cpp.

Member Function Documentation

◆ append()

void vfps::HDF5File::append ( const ElectricField ef,
const bool  fullspectrum = true 
)

append synchrotron radiation data

Parameters
efelectric fild used for CSR computation
fullspectrumsafe full CSR spectrum or only integrated power

Definition at line 358 of file HDF5File.cpp.

◆ appendPadded()

void vfps::HDF5File::appendPadded ( const ElectricField ef)

savePaddedProfile

Parameters
ef
timestep0 or 1 (for start or end of simulation)

Definition at line 366 of file HDF5File.cpp.


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