Version: SMASH-1.5
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 35 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)=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...
 

Protected Attributes

const bool is_dilepton_output_
 Is this the dilepton output? More...
 
const bool is_photon_output_
 Is this the photon 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 41 of file outputinterface.h.

42  : is_dilepton_output_(name == "Dileptons"),
43  is_photon_output_(name == "Photons") {}
const bool is_dilepton_output_
Is this the dilepton output?
const bool is_photon_output_
Is this the photon output?

◆ ~OutputInterface()

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

Member Function Documentation

◆ at_eventstart()

virtual void smash::OutputInterface::at_eventstart ( const Particles particles,
const int  event_number 
)
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.

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

◆ at_eventend()

virtual void smash::OutputInterface::at_eventend ( const Particles particles,
const int  event_number,
double  impact_parameter 
)
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.
impact_parameterDistance between centers of nuclei in this event. Only makes sense for collider modus.

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

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

Definition at line 73 of file outputinterface.h.

73  {
74  SMASH_UNUSED(action);
75  SMASH_UNUSED(density);
76  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24
Here is the caller graph for this function:

◆ at_intermediate_time()

virtual void smash::OutputInterface::at_intermediate_time ( const Particles particles,
const Clock clock,
const DensityParameters dens_param 
)
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.

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

Definition at line 84 of file outputinterface.h.

86  {
87  SMASH_UNUSED(particles);
88  SMASH_UNUSED(clock);
89  SMASH_UNUSED(dens_param);
90  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24

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

102  {
103  SMASH_UNUSED(tq);
104  SMASH_UNUSED(dt);
105  SMASH_UNUSED(lattice);
106  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24

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

119  {
120  SMASH_UNUSED(tq);
121  SMASH_UNUSED(dt);
122  SMASH_UNUSED(lattice);
123  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24

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

132  {
133  SMASH_UNUSED(gct);
134  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24

◆ is_dilepton_output()

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

Get, whether this is the dilepton output?

Definition at line 137 of file outputinterface.h.

137 { return is_dilepton_output_; }
const bool is_dilepton_output_
Is this the 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 140 of file outputinterface.h.

140 { return is_photon_output_; }
const bool is_photon_output_
Is this the photon 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 147 of file outputinterface.h.

147  {
148  switch (tq) {
150  return "rho_eckart";
152  return "tmn";
154  return "tmn_landau";
156  return "v_landau";
157  }
158  throw std::invalid_argument("Unknown thermodynamic quantity.");
159  }
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 166 of file outputinterface.h.

166  {
167  switch (dens_type) {
168  case DensityType::Hadron:
169  return "hadron";
170  case DensityType::Baryon:
171  return "net_baryon";
173  return "net_baryonI3";
174  case DensityType::Pion:
175  return "pion";
176  case DensityType::None:
177  return "none";
178  }
179  throw std::invalid_argument("Unknown density type.");
180  }

Member Data Documentation

◆ is_dilepton_output_

const bool smash::OutputInterface::is_dilepton_output_
protected

Is this the dilepton output?

Definition at line 184 of file outputinterface.h.

◆ is_photon_output_

const bool smash::OutputInterface::is_photon_output_
protected

Is this the photon output?

Definition at line 187 of file outputinterface.h.


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