Version: SMASH-3.0
smash::OutputInterface Class Reference

#include <outputinterface.h>

Abstraction of generic output.

Any output should inherit this class. It provides virtual methods that will be called at predefined moments: 1) At event start and event end: at_eventstart, at_eventend 2) After every fixed time period: at_intermediate_time, thermodynamics_output 3) At each interaction: at_interaction

Definition at line 72 of file outputinterface.h.

Inheritance diagram for smash::OutputInterface:
smash::BinaryOutputBase smash::HepMcInterface smash::ICOutput smash::OscarOutput< Format, Contents > smash::RootOutput smash::ThermodynamicLatticeOutput smash::ThermodynamicOutput smash::VtkOutput

Public Member Functions

 OutputInterface (std::string name)
 Construct output interface. More...
 
virtual ~OutputInterface ()=default
 
virtual void at_eventstart (const Particles &particles, const int event_number, const EventInfo &info)
 Output launched at event start after initialization, when particles are generated but not yet propagated. More...
 
virtual void at_eventstart (const std::vector< Particles > &ensembles, int event_number)
 Output launched at event start after initialization, when particles are generated but not yet propagated. More...
 
virtual void at_eventstart (const int event_number, const ThermodynamicQuantity tq, const DensityType dens_type, RectangularLattice< DensityOnLattice > lattice)
 Output launched at event start after initialization, when particles are generated but not yet propagated. More...
 
virtual void at_eventstart (const int event_number, const ThermodynamicQuantity tq, const DensityType dens_type, RectangularLattice< EnergyMomentumTensor > lattice)
 Output launched atevent start after initialization, when particles are generated but not yet propagated. More...
 
virtual void at_eventend (const int event_number, const ThermodynamicQuantity tq, const DensityType dens_type)
 Output launched at event end. More...
 
virtual void at_eventend (const ThermodynamicQuantity tq)
 Output launched at event end. More...
 
virtual void at_eventend (const Particles &particles, const int event_number, const EventInfo &info)
 Output launched at event end. More...
 
virtual void at_eventend (const std::vector< Particles > &ensembles, const int event_number)
 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 std::unique_ptr< Clock > &clock, const DensityParameters &dens_param, const EventInfo &info)
 Output launched after every N'th timestep. More...
 
virtual void at_intermediate_time (const std::vector< Particles > &ensembles, const std::unique_ptr< 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_lattice_output (RectangularLattice< DensityOnLattice > &lattice, const double current_time)
 Output to write thermodynamics from the lattice. More...
 
virtual void thermodynamics_lattice_output (RectangularLattice< DensityOnLattice > &lattice, const double current_time, const std::vector< Particles > &ensembles, const DensityParameters &dens_param)
 Output to write thermodynamics from the lattice. More...
 
virtual void thermodynamics_lattice_output (const ThermodynamicQuantity tq, RectangularLattice< EnergyMomentumTensor > &lattice, const double current_time)
 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...
 
virtual void fields_output (const std::string name1, const std::string name2, RectangularLattice< std::pair< ThreeVector, ThreeVector >> &lat)
 Write fields in vtk output. 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...
 

Protected Attributes

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...
 

Constructor & Destructor Documentation

◆ OutputInterface()

smash::OutputInterface::OutputInterface ( std::string  name)
inlineexplicit

Construct output interface.

Parameters
[in]name(File)name of output.

Definition at line 78 of file outputinterface.h.

79  : is_dilepton_output_(name == "Dileptons"),
80  is_photon_output_(name == "Photons"),
81  is_IC_output_(name == "SMASH_IC") {}
const bool is_photon_output_
Is this the photon output?
const bool is_dilepton_output_
Is this the dilepton output?
const bool is_IC_output_
Is this the IC output?

◆ ~OutputInterface()

virtual smash::OutputInterface::~OutputInterface ( )
virtualdefault

Member Function Documentation

◆ at_eventstart() [1/4]

virtual void smash::OutputInterface::at_eventstart ( const Particles particles,
const int  event_number,
const EventInfo info 
)
inlinevirtual

Output launched at event start after initialization, when particles are generated but not yet propagated.

Parameters
particlesList of particles.
event_numberNumber of the current event.
[in]infoEvent info, see event_info

Reimplemented in smash::VtkOutput, smash::RootOutput, smash::OscarOutput< Format, Contents >, smash::HepMcInterface, smash::BinaryOutputParticles, smash::BinaryOutputCollisions, smash::BinaryOutputInitialConditions, and smash::ICOutput.

Definition at line 91 of file outputinterface.h.

92  {
93  SMASH_UNUSED(particles);
94  SMASH_UNUSED(event_number);
95  SMASH_UNUSED(info);
96  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24

◆ at_eventstart() [2/4]

virtual void smash::OutputInterface::at_eventstart ( const std::vector< Particles > &  ensembles,
int  event_number 
)
inlinevirtual

Output launched at event start after initialization, when particles are generated but not yet propagated.

Parameters
ensemblesList of particles.
[in]event_numberNumber of the current event.

Reimplemented in smash::ThermodynamicOutput.

Definition at line 103 of file outputinterface.h.

104  {
105  SMASH_UNUSED(ensembles);
106  SMASH_UNUSED(event_number);
107  }

◆ at_eventstart() [3/4]

virtual void smash::OutputInterface::at_eventstart ( const int  event_number,
const ThermodynamicQuantity  tq,
const DensityType  dens_type,
RectangularLattice< DensityOnLattice lattice 
)
inlinevirtual

Output launched at event start after initialization, when particles are generated but not yet propagated.

Parameters
[in]event_numberNumber of the current event.
[in]tqThermodynamic quantity to deal with.
[in]dens_typeDensity type for the reference frame.
[in]latticeLattice of tabulated values.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 117 of file outputinterface.h.

120  {
121  SMASH_UNUSED(event_number);
122  SMASH_UNUSED(tq);
123  SMASH_UNUSED(dens_type);
124  SMASH_UNUSED(lattice);
125  }

◆ at_eventstart() [4/4]

virtual void smash::OutputInterface::at_eventstart ( const int  event_number,
const ThermodynamicQuantity  tq,
const DensityType  dens_type,
RectangularLattice< EnergyMomentumTensor lattice 
)
inlinevirtual

Output launched atevent start after initialization, when particles are generated but not yet propagated.

Parameters
[in]event_numberNumber of the current event.
[in]tqThermodynamic quantity to deal with.
[in]dens_typeDensity type for the reference frame.
[in]latticeLattice of tabulated values.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 135 of file outputinterface.h.

138  {
139  SMASH_UNUSED(event_number);
140  SMASH_UNUSED(tq);
141  SMASH_UNUSED(dens_type);
142  SMASH_UNUSED(lattice);
143  }

◆ at_eventend() [1/4]

virtual void smash::OutputInterface::at_eventend ( const int  event_number,
const ThermodynamicQuantity  tq,
const DensityType  dens_type 
)
inlinevirtual

Output launched at event end.

Event end is determined by maximal timestep option.

Parameters
[in]event_numberNumber of the current event.
[in]tqThermodynamic quantity to deal with
[in]dens_typeDensity type for the evaluation of thermodynamic quantities

Definition at line 153 of file outputinterface.h.

155  {
156  SMASH_UNUSED(event_number);
157  SMASH_UNUSED(tq);
158  SMASH_UNUSED(dens_type);
159  }

◆ at_eventend() [2/4]

virtual void smash::OutputInterface::at_eventend ( const ThermodynamicQuantity  tq)
inlinevirtual

Output launched at event end.

Event end is determined by maximal timestep option.

Parameters
[in]tqThermodynamic quantity to deal with.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 166 of file outputinterface.h.

166 { SMASH_UNUSED(tq); }

◆ at_eventend() [3/4]

virtual void smash::OutputInterface::at_eventend ( const Particles particles,
const int  event_number,
const EventInfo info 
)
inlinevirtual

Output launched at event end.

Event end is determined by maximal timestep option.

Parameters
particlesList of particles.
event_numberNumber of the current event.
[in]infoEvent info, see event_info

Reimplemented in smash::VtkOutput, smash::RootOutput, smash::ICOutput, smash::BinaryOutputInitialConditions, smash::BinaryOutputParticles, and smash::OscarOutput< Format, Contents >.

Definition at line 175 of file outputinterface.h.

176  {
177  SMASH_UNUSED(particles);
178  SMASH_UNUSED(event_number);
179  SMASH_UNUSED(info);
180  }

◆ at_eventend() [4/4]

virtual void smash::OutputInterface::at_eventend ( const std::vector< Particles > &  ensembles,
const int  event_number 
)
inlinevirtual

Output launched at event end.

Event end is determined by maximal timestep option.

Parameters
ensemblesList of particles.
event_numberNumber of the current event.

Reimplemented in smash::ThermodynamicOutput.

Definition at line 187 of file outputinterface.h.

188  {
189  SMASH_UNUSED(ensembles);
190  SMASH_UNUSED(event_number);
191  }

◆ at_interaction()

virtual void smash::OutputInterface::at_interaction ( const Action action,
const double  density 
)
inlinevirtual

Called whenever an action modified one or more particles.

Parameters
actionThe action object, containing the initial and final state etc.
densityThe density at the interaction point.

Reimplemented in smash::ICOutput, smash::BinaryOutputInitialConditions, smash::RootOutput, smash::OscarOutput< Format, Contents >, smash::HepMcInterface, and smash::BinaryOutputCollisions.

Definition at line 200 of file outputinterface.h.

200  {
201  SMASH_UNUSED(action);
202  SMASH_UNUSED(density);
203  }

◆ at_intermediate_time() [1/2]

virtual void smash::OutputInterface::at_intermediate_time ( const Particles particles,
const std::unique_ptr< Clock > &  clock,
const DensityParameters dens_param,
const EventInfo info 
)
inlinevirtual

Output launched after every N'th timestep.

N is controlled by an option.

Parameters
particlesList of particles.
clockSystem clock.
dens_paramParameters for density calculation.
[in]infoEvent info, see event_info

Reimplemented in smash::VtkOutput, smash::RootOutput, smash::OscarOutput< Format, Contents >, smash::BinaryOutputParticles, and smash::ICOutput.

Definition at line 212 of file outputinterface.h.

215  {
216  SMASH_UNUSED(particles);
217  SMASH_UNUSED(clock);
218  SMASH_UNUSED(dens_param);
219  SMASH_UNUSED(info);
220  }

◆ at_intermediate_time() [2/2]

virtual void smash::OutputInterface::at_intermediate_time ( const std::vector< Particles > &  ensembles,
const std::unique_ptr< Clock > &  clock,
const DensityParameters dens_param 
)
inlinevirtual

Output launched after every N'th timestep.

N is controlled by an option.

Parameters
ensemblesList of particles.
clockSystem clock.
dens_paramParameters for density calculation.

Reimplemented in smash::ThermodynamicOutput.

Definition at line 227 of file outputinterface.h.

229  {
230  SMASH_UNUSED(ensembles);
231  SMASH_UNUSED(clock);
232  SMASH_UNUSED(dens_param);
233  }

◆ thermodynamics_output() [1/3]

virtual void smash::OutputInterface::thermodynamics_output ( const ThermodynamicQuantity  tq,
const DensityType  dt,
RectangularLattice< DensityOnLattice > &  lattice 
)
inlinevirtual

Output to write thermodynamics from the lattice.

Parameters
tqThermodynamic quantity to be written, used for file name etc.
dtType of density, i.e. which particles to take into account.
latticeLattice of tabulated values.

Used for vtk output.

Reimplemented in smash::VtkOutput.

Definition at line 243 of file outputinterface.h.

245  {
246  SMASH_UNUSED(tq);
247  SMASH_UNUSED(dt);
248  SMASH_UNUSED(lattice);
249  }

◆ thermodynamics_output() [2/3]

virtual void smash::OutputInterface::thermodynamics_output ( const ThermodynamicQuantity  tq,
const DensityType  dt,
RectangularLattice< EnergyMomentumTensor > &  lattice 
)
inlinevirtual

Output to write energy-momentum tensor and related quantities from the lattice.

Parameters
tqThermodynamic quantity to be written: Tmn, Tmn_Landau, v_Landau.
dtType of density, i.e. which particles to take into account.
latticeLattice of tabulated values.

Used for vtk output.

Reimplemented in smash::VtkOutput.

Definition at line 260 of file outputinterface.h.

262  {
263  SMASH_UNUSED(tq);
264  SMASH_UNUSED(dt);
265  SMASH_UNUSED(lattice);
266  }

◆ thermodynamics_lattice_output() [1/3]

virtual void smash::OutputInterface::thermodynamics_lattice_output ( RectangularLattice< DensityOnLattice > &  lattice,
const double  current_time 
)
inlinevirtual

Output to write thermodynamics from the lattice.

Parameters
[in]latticeLattice type DensityOnLattice of tabulated values.
[in]current_timeTime of the simulation in the computational frame.

Used for thermodynamic lattice output.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 275 of file outputinterface.h.

277  {
278  SMASH_UNUSED(lattice);
279  SMASH_UNUSED(current_time);
280  }

◆ thermodynamics_lattice_output() [2/3]

virtual void smash::OutputInterface::thermodynamics_lattice_output ( RectangularLattice< DensityOnLattice > &  lattice,
const double  current_time,
const std::vector< Particles > &  ensembles,
const DensityParameters dens_param 
)
inlinevirtual

Output to write thermodynamics from the lattice.

Parameters
[in]latticeLattice type FourVector of tabulated values.
[in]current_timeTime of the simulation in the computational frame.
[in]ensemblesParticles, from which the 4-currents j_{Q,B,S} are computed
[in]dens_paramset of parameters, defining smearing. For more info about smearing see ASCII thermodynamics output.

Used for thermodynamic lattice output.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 294 of file outputinterface.h.

297  {
298  SMASH_UNUSED(lattice);
299  SMASH_UNUSED(current_time);
300  SMASH_UNUSED(ensembles);
301  SMASH_UNUSED(dens_param);
302  }

◆ thermodynamics_lattice_output() [3/3]

virtual void smash::OutputInterface::thermodynamics_lattice_output ( const ThermodynamicQuantity  tq,
RectangularLattice< EnergyMomentumTensor > &  lattice,
const double  current_time 
)
inlinevirtual

Output to write energy-momentum tensor and related quantities from the lattice.

Parameters
[in]tqThermodynamic quantity to be written, used for file name etc.
[in]latticeLattice type EnergyMomentumTensor of tabulated values.
[in]current_timeTime of the simulation in the computational frame.

Used for thermodynamic lattice output.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 313 of file outputinterface.h.

316  {
317  SMASH_UNUSED(tq);
318  SMASH_UNUSED(lattice);
319  SMASH_UNUSED(current_time);
320  }

◆ thermodynamics_output() [3/3]

virtual void smash::OutputInterface::thermodynamics_output ( const GrandCanThermalizer gct)
inlinevirtual

Output to write energy-momentum tensor and related quantities from the thermalizer class.

Parameters
gctPointer to thermalizer

Only used for vtk output. Not connected to ThermodynamicOutput.

Reimplemented in smash::VtkOutput.

Definition at line 329 of file outputinterface.h.

329  {
330  SMASH_UNUSED(gct);
331  }

◆ fields_output()

virtual void smash::OutputInterface::fields_output ( const std::string  name1,
const std::string  name2,
RectangularLattice< std::pair< ThreeVector, ThreeVector >> &  lat 
)
inlinevirtual

Write fields in vtk output.

Fields are a pair of threevectors for example electric and magnetic field

Parameters
[in]name1Name of the first field
[in]name2Name of the second field
[in]latLattice storing both fields

Reimplemented in smash::VtkOutput.

Definition at line 342 of file outputinterface.h.

344  {
345  SMASH_UNUSED(name1);
346  SMASH_UNUSED(name2);
347  SMASH_UNUSED(lat);
348  }

◆ is_dilepton_output()

bool smash::OutputInterface::is_dilepton_output ( ) const
inline

Get, whether this is the dilepton output?

Definition at line 351 of file outputinterface.h.

351 { return is_dilepton_output_; }

◆ is_photon_output()

bool smash::OutputInterface::is_photon_output ( ) const
inline

Get, whether this is the photon output?

Definition at line 354 of file outputinterface.h.

354 { return is_photon_output_; }

◆ is_IC_output()

bool smash::OutputInterface::is_IC_output ( ) const
inline

Get, whether this is the IC output?

Definition at line 357 of file outputinterface.h.

357 { return is_IC_output_; }

◆ to_string() [1/2]

const char* smash::OutputInterface::to_string ( const ThermodynamicQuantity  tq)
inline

Convert thermodynamic quantities to strings.

Parameters
[in]tqEnum value of the thermodynamic quantity.
Returns
String description of the enumerator.

Definition at line 364 of file outputinterface.h.

364  {
365  switch (tq) {
367  return "rho_eckart";
369  return "tmn";
371  return "tmn_landau";
373  return "v_landau";
375  return "j_QBS";
376  }
377  throw std::invalid_argument("Unknown thermodynamic quantity.");
378  }

◆ to_string() [2/2]

const char* smash::OutputInterface::to_string ( const DensityType  dens_type)
inline

Convert density types to strings.

Parameters
[in]dens_typeenum value of the density type
Returns
String description of the enumerator.

Definition at line 385 of file outputinterface.h.

385  {
386  switch (dens_type) {
387  case DensityType::Hadron:
388  return "hadron";
389  case DensityType::Baryon:
390  return "net_baryon";
392  return "net_baryonI3";
393  case DensityType::Pion:
394  return "pion";
396  return "tot_isospin3";
397  case DensityType::Charge:
398  return "charge";
400  return "strangeness";
401  case DensityType::None:
402  return "none";
403  }
404  throw std::invalid_argument("Unknown density type.");
405  }

Member Data Documentation

◆ is_dilepton_output_

const bool smash::OutputInterface::is_dilepton_output_
protected

Is this the dilepton output?

Definition at line 409 of file outputinterface.h.

◆ is_photon_output_

const bool smash::OutputInterface::is_photon_output_
protected

Is this the photon output?

Definition at line 412 of file outputinterface.h.

◆ is_IC_output_

const bool smash::OutputInterface::is_IC_output_
protected

Is this the IC output?

Definition at line 415 of file outputinterface.h.


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