#include <binaryoutput.h>
Base class for SMASH binary output.
Definition at line 28 of file binaryoutput.h.
|
| BinaryOutputBase (const bf::path &path, const std::string &mode, const std::string &name, bool extended_format) |
| Create binary output base. More...
|
|
void | write (const std::string &s) |
| Write string to binary output. More...
|
|
void | write (const double x) |
| Write double to binary output. More...
|
|
void | write (const FourVector &v) |
| Write four-vector to binary output. More...
|
|
void | write (const std::int32_t x) |
| Write integer (32 bit) to binary output. More...
|
|
void | write (const std::uint32_t x) |
| Write unsigned integer (32 bit) to binary output. More...
|
|
void | write (const std::uint16_t x) |
| Write unsigned integer (16 bit) to binary output. More...
|
|
void | write (const size_t x) |
| Write a std::size_t to binary output. More...
|
|
void | write (const Particles &particles) |
| Write particle data of each particle in particles to binary output. More...
|
|
void | write (const ParticleList &particles) |
| Write each particle data entry to binary output. More...
|
|
void | write_particledata (const ParticleData &p) |
| Write particle data to binary output. More...
|
|
|
| OutputInterface (std::string name) |
| Construct output interface. More...
|
|
virtual | ~OutputInterface ()=default |
|
virtual void | at_eventstart (const Particles &particles, const int event_number)=0 |
| Output launched at event start after initialization, when particles are generated but not yet propagated. More...
|
|
virtual void | at_eventend (const Particles &particles, const int event_number, double impact_parameter)=0 |
| Output launched at event end. More...
|
|
virtual void | at_interaction (const Action &action, const double density) |
| Called whenever an action modified one or more particles. More...
|
|
virtual void | at_intermediate_time (const Particles &particles, const Clock &clock, const DensityParameters &dens_param) |
| Output launched after every N'th timestep. More...
|
|
virtual void | thermodynamics_output (const ThermodynamicQuantity tq, const DensityType dt, RectangularLattice< DensityOnLattice > &lattice) |
| Output to write thermodynamics from the lattice. More...
|
|
virtual void | thermodynamics_output (const ThermodynamicQuantity tq, const DensityType dt, RectangularLattice< EnergyMomentumTensor > &lattice) |
| Output to write energy-momentum tensor and related quantities from the lattice. More...
|
|
virtual void | thermodynamics_output (const GrandCanThermalizer &gct) |
| Output to write energy-momentum tensor and related quantities from the thermalizer class. More...
|
|
bool | is_dilepton_output () const |
| Get, whether this is the dilepton output? More...
|
|
bool | is_photon_output () const |
| Get, whether this is the photon output? More...
|
|
const char * | to_string (const ThermodynamicQuantity tq) |
| Convert thermodynamic quantities to strings. More...
|
|
const char * | to_string (const DensityType dens_type) |
| Convert density types to strings. More...
|
|
smash::BinaryOutputBase::BinaryOutputBase |
( |
const bf::path & |
path, |
|
|
const std::string & |
mode, |
|
|
const std::string & |
name, |
|
|
bool |
extended_format |
|
) |
| |
|
explicitprotected |
Create binary output base.
- Parameters
-
[in] | path | Output path. |
[in] | mode | Is used to determine the file access mode. |
[in] | name | Name of the output. |
[in] | extended_format | Is the written output extended. |
Definition at line 127 of file binaryoutput.cc.
132 std::fwrite(
"SMSH", 4, 1,
file_.
get());
134 std::uint16_t format_variant =
static_cast<uint16_t
>(
extended_);
135 write(format_variant);
136 write(VERSION_MAJOR);
FILE * get()
Get the underlying FILE* pointer.
RenamingFilePtr file_
Binary particles output file path.
uint16_t format_version_
Binary file format version number.
void write(const std::string &s)
Write string to binary output.
OutputInterface(std::string name)
Construct output interface.
bool extended_
Option for extended output.
void smash::BinaryOutputBase::write |
( |
const std::string & |
s | ) |
|
|
protected |
Write string to binary output.
- Parameters
-
[in] | s | String to be written. |
Definition at line 140 of file binaryoutput.cc.
141 const auto size = boost::numeric_cast<uint32_t>(s.size());
142 std::fwrite(&size,
sizeof(std::uint32_t), 1,
file_.
get());
143 std::fwrite(s.c_str(), s.size(), 1,
file_.
get());
FILE * get()
Get the underlying FILE* pointer.
RenamingFilePtr file_
Binary particles output file path.
void smash::BinaryOutputBase::write |
( |
const double |
x | ) |
|
|
protected |
Write double to binary output.
- Parameters
-
[in] | x | Value to be written. |
Definition at line 146 of file binaryoutput.cc.
147 std::fwrite(&x,
sizeof(x), 1,
file_.
get());
FILE * get()
Get the underlying FILE* pointer.
RenamingFilePtr file_
Binary particles output file path.
void smash::BinaryOutputBase::write |
( |
const FourVector & |
v | ) |
|
|
protected |
Write four-vector to binary output.
- Parameters
-
[in] | v | Four-vector to be written. |
Definition at line 150 of file binaryoutput.cc.
151 std::fwrite(v.begin(),
sizeof(*v.begin()), 4,
file_.
get());
FILE * get()
Get the underlying FILE* pointer.
RenamingFilePtr file_
Binary particles output file path.
void smash::BinaryOutputBase::write |
( |
const std::int32_t |
x | ) |
|
|
inlineprotected |
Write integer (32 bit) to binary output.
- Parameters
-
[in] | x | Value to be written. |
Definition at line 63 of file binaryoutput.h.
64 std::fwrite(&x,
sizeof(x), 1,
file_.
get());
FILE * get()
Get the underlying FILE* pointer.
RenamingFilePtr file_
Binary particles output file path.
void smash::BinaryOutputBase::write |
( |
const std::uint32_t |
x | ) |
|
|
inlineprotected |
Write unsigned integer (32 bit) to binary output.
- Parameters
-
[in] | x | Value to be written. |
Definition at line 71 of file binaryoutput.h.
72 std::fwrite(&x,
sizeof(x), 1,
file_.
get());
FILE * get()
Get the underlying FILE* pointer.
RenamingFilePtr file_
Binary particles output file path.
void smash::BinaryOutputBase::write |
( |
const std::uint16_t |
x | ) |
|
|
inlineprotected |
Write unsigned integer (16 bit) to binary output.
- Parameters
-
[in] | x | Value to be written. |
Definition at line 79 of file binaryoutput.h.
80 std::fwrite(&x,
sizeof(x), 1,
file_.
get());
FILE * get()
Get the underlying FILE* pointer.
RenamingFilePtr file_
Binary particles output file path.
void smash::BinaryOutputBase::write |
( |
const size_t |
x | ) |
|
|
inlineprotected |
Write a std::size_t to binary output.
- Parameters
-
[in] | x | Value to be written. |
Definition at line 87 of file binaryoutput.h.
87 {
write(boost::numeric_cast<uint32_t>(x)); }
void write(const std::string &s)
Write string to binary output.
void smash::BinaryOutputBase::write |
( |
const Particles & |
particles | ) |
|
|
protected |
Write particle data of each particle in particles to binary output.
- Parameters
-
[in] | particles | List of particles, whose data is to be written. |
Definition at line 154 of file binaryoutput.cc.
155 for (
const auto &
p : particles) {
void write_particledata(const ParticleData &p)
Write particle data to binary output.
void smash::BinaryOutputBase::write |
( |
const ParticleList & |
particles | ) |
|
|
protected |
Write each particle data entry to binary output.
- Parameters
-
[in] | particles | List of particles, whose data is to be written. |
Definition at line 160 of file binaryoutput.cc.
161 for (
const auto &
p : particles) {
void write_particledata(const ParticleData &p)
Write particle data to binary output.
void smash::BinaryOutputBase::write_particledata |
( |
const ParticleData & |
p | ) |
|
|
protected |
Write particle data to binary output.
- Parameters
-
[in] | p | Particle data to be written. |
Definition at line 166 of file binaryoutput.cc.
168 double mass =
p.effective_mass();
169 std::fwrite(&mass,
sizeof(mass), 1,
file_.
get());
171 write(
p.pdgcode().get_decimal());
175 const auto history =
p.get_history();
176 write(history.collisions_per_particle);
177 write(
p.formation_time());
178 write(
p.xsec_scaling_factor());
179 write(history.id_process);
180 write(static_cast<int32_t>(history.process_type));
181 write(history.time_last_collision);
182 write(history.p1.get_decimal());
183 write(history.p2.get_decimal());
FILE * get()
Get the underlying FILE* pointer.
RenamingFilePtr file_
Binary particles output file path.
void write(const std::string &s)
Write string to binary output.
bool extended_
Option for extended output.
uint16_t smash::BinaryOutputBase::format_version_ = 6 |
|
private |
bool smash::BinaryOutputBase::extended_ |
|
private |
The documentation for this class was generated from the following files: