Version: SMASH-2.0
smash::OutputInterface Class Referenceabstract

#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 65 of file outputinterface.h.

Inheritance diagram for smash::OutputInterface:
[legend]
Collaboration diagram for smash::OutputInterface:
[legend]

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)=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, const EventInfo &info)=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 std::unique_ptr< Clock > &clock, const DensityParameters &dens_param, const EventInfo &info)
 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...
 
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 71 of file outputinterface.h.

72  : is_dilepton_output_(name == "Dileptons"),
73  is_photon_output_(name == "Photons"),
74  is_IC_output_(name == "SMASH_IC") {}

◆ ~OutputInterface()

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

Member Function Documentation

◆ at_eventstart()

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

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

Implemented in smash::BinaryOutputParticles, smash::BinaryOutputCollisions, smash::RootOutput, smash::OscarOutput< Format, Contents >, smash::ThermodynamicOutput, smash::VtkOutput, smash::HepMcOutput, smash::BinaryOutputInitialConditions, and smash::ICOutput.

◆ at_eventend()

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

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

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

◆ 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::BinaryOutputInitialConditions, smash::ICOutput, smash::BinaryOutputCollisions, smash::RootOutput, and smash::OscarOutput< Format, Contents >.

Definition at line 104 of file outputinterface.h.

104  {
105  SMASH_UNUSED(action);
106  SMASH_UNUSED(density);
107  }
Here is the caller graph for this function:

◆ at_intermediate_time()

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::BinaryOutputParticles, smash::RootOutput, smash::OscarOutput< Format, Contents >, smash::ThermodynamicOutput, smash::VtkOutput, and smash::ICOutput.

Definition at line 116 of file outputinterface.h.

119  {
120  SMASH_UNUSED(particles);
121  SMASH_UNUSED(clock);
122  SMASH_UNUSED(dens_param);
123  SMASH_UNUSED(info);
124  }

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

Only used for vtk output. Not connected to ThermodynamicOutput.

Reimplemented in smash::VtkOutput.

Definition at line 134 of file outputinterface.h.

136  {
137  SMASH_UNUSED(tq);
138  SMASH_UNUSED(dt);
139  SMASH_UNUSED(lattice);
140  }

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

Only used for vtk output. Not connected to ThermodynamicOutput.

Reimplemented in smash::VtkOutput.

Definition at line 151 of file outputinterface.h.

153  {
154  SMASH_UNUSED(tq);
155  SMASH_UNUSED(dt);
156  SMASH_UNUSED(lattice);
157  }

◆ 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 166 of file outputinterface.h.

166  {
167  SMASH_UNUSED(gct);
168  }

◆ is_dilepton_output()

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

Get, whether this is the dilepton output?

Definition at line 171 of file outputinterface.h.

171 { return is_dilepton_output_; }
Here is the caller graph for this function:

◆ is_photon_output()

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

Get, whether this is the photon output?

Definition at line 174 of file outputinterface.h.

174 { 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 177 of file outputinterface.h.

177 { 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 184 of file outputinterface.h.

184  {
185  switch (tq) {
187  return "rho_eckart";
189  return "tmn";
191  return "tmn_landau";
193  return "v_landau";
195  return "j_QBS";
196  }
197  throw std::invalid_argument("Unknown thermodynamic quantity.");
198  }
Here is the caller graph for this function:

◆ 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 205 of file outputinterface.h.

205  {
206  switch (dens_type) {
207  case DensityType::Hadron:
208  return "hadron";
209  case DensityType::Baryon:
210  return "net_baryon";
212  return "net_baryonI3";
213  case DensityType::Pion:
214  return "pion";
216  return "tot_isospin3";
217  case DensityType::Charge:
218  return "charge";
220  return "strangeness";
221  case DensityType::None:
222  return "none";
223  }
224  throw std::invalid_argument("Unknown density type.");
225  }

Member Data Documentation

◆ is_dilepton_output_

const bool smash::OutputInterface::is_dilepton_output_
protected

Is this the dilepton output?

Definition at line 229 of file outputinterface.h.

◆ is_photon_output_

const bool smash::OutputInterface::is_photon_output_
protected

Is this the photon output?

Definition at line 232 of file outputinterface.h.

◆ is_IC_output_

const bool smash::OutputInterface::is_IC_output_
protected

Is this the IC output?

Definition at line 235 of file outputinterface.h.


The documentation for this class was generated from the following file:
smash::DensityType::Strangeness
ThermodynamicQuantity::TmnLandau
ThermodynamicQuantity::LandauVelocity
smash::DensityType::BaryonicIsospin
smash::OutputInterface::is_photon_output_
const bool is_photon_output_
Is this the photon output?
Definition: outputinterface.h:232
smash::DensityType::Charge
ThermodynamicQuantity::Tmn
smash::DensityType::Pion
smash::OutputInterface::is_dilepton_output_
const bool is_dilepton_output_
Is this the dilepton output?
Definition: outputinterface.h:229
ThermodynamicQuantity::EckartDensity
SMASH_UNUSED
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24
smash::DensityType::None
smash::DensityType::Isospin3_tot
ThermodynamicQuantity::j_QBS
smash::DensityType::Hadron
smash::DensityType::Baryon
smash::OutputInterface::is_IC_output_
const bool is_IC_output_
Is this the IC output?
Definition: outputinterface.h:235