Version: SMASH-1.7
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, bool empty_event)=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)
 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

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"),
44  is_IC_output_(name == "SMASH_IC") {}
const bool is_dilepton_output_
Is this the dilepton output?
const bool is_photon_output_
Is this the photon output?
const bool is_IC_output_
Is this the IC output?

Here is the call graph for this function:

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

Here is the caller graph for this function:

Member Function Documentation

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

Here is the caller graph for this function:

virtual void smash::OutputInterface::at_eventend ( const Particles particles,
const int  event_number,
double  impact_parameter,
bool  empty_event 
)
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.
[in]empty_eventWhether there was no interaction between the target and the projectile.

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

Here is the caller graph for this function:

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

Definition at line 76 of file outputinterface.h.

76  {
77  SMASH_UNUSED(action);
78  SMASH_UNUSED(density);
79  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24

Here is the caller graph for this function:

virtual void smash::OutputInterface::at_intermediate_time ( const Particles particles,
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
particlesList of particles.
clockSystem clock.
dens_paramParameters for density calculation.

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

Definition at line 87 of file outputinterface.h.

89  {
90  SMASH_UNUSED(particles);
91  SMASH_UNUSED(clock);
92  SMASH_UNUSED(dens_param);
93  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24
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 103 of file outputinterface.h.

105  {
106  SMASH_UNUSED(tq);
107  SMASH_UNUSED(dt);
108  SMASH_UNUSED(lattice);
109  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24
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 120 of file outputinterface.h.

122  {
123  SMASH_UNUSED(tq);
124  SMASH_UNUSED(dt);
125  SMASH_UNUSED(lattice);
126  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24
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 135 of file outputinterface.h.

135  {
136  SMASH_UNUSED(gct);
137  }
#define SMASH_UNUSED(x)
Mark as unused, silencing compiler warnings.
Definition: macros.h:24
bool smash::OutputInterface::is_dilepton_output ( ) const
inline

Get, whether this is the dilepton output?

Definition at line 140 of file outputinterface.h.

140 { return is_dilepton_output_; }
const bool is_dilepton_output_
Is this the dilepton output?

Here is the caller graph for this function:

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

Get, whether this is the photon output?

Definition at line 143 of file outputinterface.h.

143 { return is_photon_output_; }
const bool is_photon_output_
Is this the photon output?
bool smash::OutputInterface::is_IC_output ( ) const
inline

Get, whether this is the IC output?

Definition at line 146 of file outputinterface.h.

146 { return is_IC_output_; }
const bool is_IC_output_
Is this the IC output?
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 153 of file outputinterface.h.

153  {
154  switch (tq) {
156  return "rho_eckart";
158  return "tmn";
160  return "tmn_landau";
162  return "v_landau";
164  return "j_QBS";
165  }
166  throw std::invalid_argument("Unknown thermodynamic quantity.");
167  }

Here is the caller graph for this function:

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

174  {
175  switch (dens_type) {
176  case DensityType::Hadron:
177  return "hadron";
178  case DensityType::Baryon:
179  return "net_baryon";
181  return "net_baryonI3";
182  case DensityType::Pion:
183  return "pion";
185  return "tot_isospin3";
186  case DensityType::Charge:
187  return "charge";
189  return "strangeness";
190  case DensityType::None:
191  return "none";
192  }
193  throw std::invalid_argument("Unknown density type.");
194  }

Member Data Documentation

const bool smash::OutputInterface::is_dilepton_output_
protected

Is this the dilepton output?

Definition at line 198 of file outputinterface.h.

const bool smash::OutputInterface::is_photon_output_
protected

Is this the photon output?

Definition at line 201 of file outputinterface.h.

const bool smash::OutputInterface::is_IC_output_
protected

Is this the IC output?

Definition at line 204 of file outputinterface.h.


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