#include <thermodynamiclatticeoutput.h>
Writes the thermodynamic quantities at lattice points versus time.
This class is a temporary solution to write thermodynamic quantities out. Calculations are called directly inside the output functions. In future it should be substituted by some more general output.
Definition at line 42 of file thermodynamiclatticeoutput.h.
Public Member Functions | |
ThermodynamicLatticeOutput (const std::filesystem::path &path, const std::string &name, const OutputParameters &out_par, const bool enable_ascii, const bool enable_binary) | |
Construct Output. More... | |
~ThermodynamicLatticeOutput () | |
Default destructor. More... | |
void | at_eventstart (const int event_number, const ThermodynamicQuantity tq, const DensityType dens_type, const RectangularLattice< DensityOnLattice > lattice) override |
Output launched at event start after initialization, when particles are generated but not yet propagated. More... | |
void | at_eventstart (const int event_number, const ThermodynamicQuantity tq, const DensityType dens_type, const RectangularLattice< EnergyMomentumTensor > lattice) override |
Output launched at event start after initialization, when particles are generated but not yet propagated. More... | |
void | at_eventend (const ThermodynamicQuantity tq) override |
Final actions at the end of each event (it closes the output files). More... | |
void | thermodynamics_lattice_output (RectangularLattice< DensityOnLattice > &lattice, double current_time) override |
Prints the density lattice on a grid. More... | |
void | thermodynamics_lattice_output (RectangularLattice< DensityOnLattice > &lattice, const double current_time, const std::vector< Particles > &ensembles, const DensityParameters &dens_param) override |
Prints the density lattice on a grid. More... | |
void | thermodynamics_lattice_output (const ThermodynamicQuantity tq, RectangularLattice< EnergyMomentumTensor > &lattice, double current_time) override |
Prints the energy-momentum-tensor lattice on a grid. More... | |
Public Member Functions inherited from smash::OutputInterface | |
OutputInterface (std::string name) | |
Construct output interface. More... | |
virtual | ~OutputInterface ()=0 |
Pure virtual destructor to make class abstract and prevent its instantiation. More... | |
virtual void | at_eventstart (const Particles &, const int, const EventInfo &) |
Output launched at event start after initialization, when particles are generated but not yet propagated. More... | |
virtual void | at_eventstart (const std::vector< Particles > &, int) |
Output launched at event start after initialization, when particles are generated but not yet propagated. More... | |
virtual void | at_eventend (const int, const ThermodynamicQuantity, const DensityType) |
Output launched at event end. More... | |
virtual void | at_eventend (const Particles &, const int, const EventInfo &) |
Output launched at event end. More... | |
virtual void | at_eventend (const std::vector< Particles > &, const int) |
Output launched at event end. More... | |
virtual void | at_interaction (const Action &, const double) |
Called whenever an action modified one or more particles. More... | |
virtual void | at_intermediate_time (const Particles &, const std::unique_ptr< Clock > &, const DensityParameters &, const EventInfo &) |
Output launched after every N'th time-step. More... | |
virtual void | at_intermediate_time (const std::vector< Particles > &, const std::unique_ptr< Clock > &, const DensityParameters &) |
Output launched after every N'th timestep. More... | |
virtual void | thermodynamics_output (const ThermodynamicQuantity, const DensityType, RectangularLattice< DensityOnLattice > &) |
Output to write thermodynamics from the lattice. More... | |
virtual void | thermodynamics_output (const ThermodynamicQuantity, const DensityType, RectangularLattice< EnergyMomentumTensor > &) |
Output to write energy-momentum tensor and related quantities from the lattice. More... | |
virtual void | thermodynamics_output (const GrandCanThermalizer &) |
Output to write energy-momentum tensor and related quantities from the thermalizer class. More... | |
virtual void | fields_output (const std::string, const std::string, RectangularLattice< std::pair< ThreeVector, ThreeVector >> &) |
Write fields in vtk output Fields are a pair of threevectors for example electric and magnetic field. 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... | |
bool | is_IC_output () const |
Get, whether this is the IC 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... | |
Static Public Attributes | |
static const double_t | version = 1.0 |
Version of the thermodynamic lattice output. More... | |
Private Member Functions | |
std::string | make_filename (const std::string &description, const int event_number, const char type) |
Makes a file name given a description and a counter. More... | |
std::string | make_varname (const ThermodynamicQuantity tq, const DensityType dens_type) |
Makes a variable name given quantity and density type. More... | |
void | write_therm_lattice_ascii_header (std::shared_ptr< std::ofstream > file, const ThermodynamicQuantity &tq) |
Writes the header for the ASCII output files. More... | |
void | write_therm_lattice_binary_header (std::shared_ptr< std::ofstream > file, const ThermodynamicQuantity &tq) |
Writes the header for the binary output files. More... | |
int | to_int (const ThermodynamicQuantity &tq) |
Convert a ThermodynamicQuantity into an int. More... | |
Private Attributes | |
const OutputParameters | out_par_ |
Structure that holds all the information about what to printout. More... | |
const std::filesystem::path | base_path_ |
filesystem path for output More... | |
std::map< ThermodynamicQuantity, std::shared_ptr< std::ofstream > > | output_ascii_files_ |
map of output file handlers for ASCII format More... | |
std::map< ThermodynamicQuantity, std::shared_ptr< std::ofstream > > | output_binary_files_ |
map of output file handlers for binary format More... | |
std::array< int, 3 > | nodes_ |
number of nodes in the lattice along the three axes More... | |
std::array< double, 3 > | sizes_ |
lattice resolution along the three axes More... | |
std::array< double, 3 > | origin_ |
lattice origin orientation: if 0,0,0 is the origin of a cube with face widths 10, the center is at 5,5,5 More... | |
bool | enable_ascii_ |
enable output type ASCII More... | |
bool | enable_binary_ |
enable output type Binary More... | |
bool | enable_output_ |
enable output, of any kind (if False, the object does nothing) More... | |
Additional Inherited Members | |
Protected Attributes inherited from smash::OutputInterface | |
const bool | is_dilepton_output_ |
Is this the dilepton output? More... | |
const bool | is_photon_output_ |
Is this the photon output? More... | |
const bool | is_IC_output_ |
Is this the IC output? More... | |
smash::ThermodynamicLatticeOutput::ThermodynamicLatticeOutput | ( | const std::filesystem::path & | path, |
const std::string & | name, | ||
const OutputParameters & | out_par, | ||
const bool | enable_ascii, | ||
const bool | enable_binary | ||
) |
Construct Output.
[in] | path | Path to output |
[in] | name | Filename |
[in] | out_par | Parameters of output |
[in] | enable_ascii | Bool (True or False) to enable ASCII format |
[in] | enable_binary | Bool (True or False) to enable binary format |
Definition at line 184 of file thermodynamiclatticeoutput.cc.
smash::ThermodynamicLatticeOutput::~ThermodynamicLatticeOutput | ( | ) |
|
overridevirtual |
Output launched at event start after initialization, when particles are generated but not yet propagated.
[in] | event_number | Number of the current event. |
[in] | tq | Thermodynamic quantity to deal with |
[in] | dens_type | Density type for the reference frame. |
[in] | lattice | Specialized Lattice for DensityOnLattice |
Reimplemented from smash::OutputInterface.
Definition at line 246 of file thermodynamiclatticeoutput.cc.
|
overridevirtual |
Output launched at event start after initialization, when particles are generated but not yet propagated.
[in] | event_number | Number of the current event. |
[in] | tq | Thermodynamic quantity to deal with. |
[in] | dens_type | Density type for the reference frame. |
[in] | lattice | Specialized Lattice for EnergyMomentumTensor |
Reimplemented from smash::OutputInterface.
Definition at line 333 of file thermodynamiclatticeoutput.cc.
|
overridevirtual |
Final actions at the end of each event (it closes the output files).
[in] | tq | The quantity that has been written in the output file, see ThermodynamicQuantity. |
Reimplemented from smash::OutputInterface.
Definition at line 458 of file thermodynamiclatticeoutput.cc.
|
overridevirtual |
Prints the density lattice on a grid.
[in] | lattice | DensityOnLattice lattice to use. |
[in] | current_time | The output time in the computational frame |
Reimplemented from smash::OutputInterface.
Definition at line 509 of file thermodynamiclatticeoutput.cc.
|
overridevirtual |
Prints the density lattice on a grid.
[in] | lattice | DensityOnLattice lattice to use. |
[in] | current_time | The output time in the computational frame |
[in] | ensembles | Particles, from which the 4-currents j_{Q,B,S} are computed |
[in] | dens_param | set of parameters, defining smearing. For more info about smearing see ASCII thermodynamics output. |
Reimplemented from smash::OutputInterface.
Definition at line 540 of file thermodynamiclatticeoutput.cc.
|
overridevirtual |
Prints the energy-momentum-tensor lattice on a grid.
[in] | tq | The quantity whose energy-momentum tensor should be written, see ThermodynamicQuantity. |
[in] | lattice | EnergyMomentumTensor lattice to use. |
[in] | current_time | The output time in the computational frame |
Reimplemented from smash::OutputInterface.
Definition at line 610 of file thermodynamiclatticeoutput.cc.
|
private |
Makes a file name given a description and a counter.
[in] | description | The description. |
[in] | event_number | The event number. |
[in] | type | Flag for the file type: 'a' for ASCII, 'b' for Binary |
Definition at line 738 of file thermodynamiclatticeoutput.cc.
|
private |
Makes a variable name given quantity and density type.
[in] | tq | The quantity. |
[in] | dens_type | The density type. |
Definition at line 751 of file thermodynamiclatticeoutput.cc.
|
private |
Writes the header for the ASCII output files.
file | Output file. | |
[in] | tq | The quantity to be written, see ThermodynamicQuantity. |
Definition at line 757 of file thermodynamiclatticeoutput.cc.
|
private |
Writes the header for the binary output files.
[in] | file | Output file. |
[in] | tq | The quantity to be written, see ThermodynamicQuantity. |
Definition at line 774 of file thermodynamiclatticeoutput.cc.
|
private |
Convert a ThermodynamicQuantity into an int.
[in] | tq | The quantity to be converted, see ThermodynamicQuantity. |
Definition at line 719 of file thermodynamiclatticeoutput.cc.
|
static |
Version of the thermodynamic lattice output.
Definition at line 45 of file thermodynamiclatticeoutput.h.
|
private |
Structure that holds all the information about what to printout.
Definition at line 134 of file thermodynamiclatticeoutput.h.
|
private |
filesystem path for output
Definition at line 183 of file thermodynamiclatticeoutput.h.
|
private |
map of output file handlers for ASCII format
Definition at line 187 of file thermodynamiclatticeoutput.h.
|
private |
map of output file handlers for binary format
Definition at line 191 of file thermodynamiclatticeoutput.h.
|
private |
number of nodes in the lattice along the three axes
Definition at line 194 of file thermodynamiclatticeoutput.h.
|
private |
lattice resolution along the three axes
Definition at line 197 of file thermodynamiclatticeoutput.h.
|
private |
lattice origin orientation: if 0,0,0 is the origin of a cube with face widths 10, the center is at 5,5,5
Definition at line 202 of file thermodynamiclatticeoutput.h.
|
private |
enable output type ASCII
Definition at line 205 of file thermodynamiclatticeoutput.h.
|
private |
enable output type Binary
Definition at line 208 of file thermodynamiclatticeoutput.h.
|
private |
enable output, of any kind (if False, the object does nothing)
Definition at line 211 of file thermodynamiclatticeoutput.h.