Version: SMASH-3.1
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

Attention
This class provides more virtual methods than those needed in different children classes. Although this is against the inheritance "is-a" relationship, it somehow simplifies here the hierarchy, because we avoid having many more interfaces. Furthermore all base virtual methods are implemented as no-operations, i.e. empty. This implies that they can and will be called if the interface is used polymorphically but the child does not implement the called method. This happens e.g. in the Experiment class where an array of pointers to the base class is initialized with different children and then different methods are called on all array entries (some will do what has to be done, but most will just do nothing).
Note
The parameters of most methods in this base class are not documented, as irrelevant for the empty implementation. However, every child class which overrides some methods documents them in detail. Refer to them for further information.

Definition at line 88 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 ()=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_eventstart (const int, const ThermodynamicQuantity, const DensityType, RectangularLattice< DensityOnLattice >)
 Output launched at event start after initialization, when particles are generated but not yet propagated. More...
 
virtual void at_eventstart (const int, const ThermodynamicQuantity, const DensityType, RectangularLattice< EnergyMomentumTensor >)
 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 ThermodynamicQuantity)
 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_lattice_output (RectangularLattice< DensityOnLattice > &, const double)
 Output to write thermodynamics from the lattice. More...
 
virtual void thermodynamics_lattice_output (RectangularLattice< DensityOnLattice > &, const double, const std::vector< Particles > &, const DensityParameters &)
 Output to write thermodynamics from the lattice. More...
 
virtual void thermodynamics_lattice_output (const ThermodynamicQuantity, RectangularLattice< EnergyMomentumTensor > &, const double)
 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...
 

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

95  : is_dilepton_output_(name == "Dileptons"),
96  is_photon_output_(name == "Photons"),
97  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()

smash::OutputInterface::~OutputInterface ( )
inlinepure virtualdefault

Pure virtual destructor to make class abstract and prevent its instantiation.

It needs a definition which is done outside the class.

Member Function Documentation

◆ at_eventstart() [1/4]

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

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

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

Definition at line 108 of file outputinterface.h.

108 {}

◆ at_eventstart() [2/4]

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

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

Reimplemented in smash::ThermodynamicOutput.

Definition at line 114 of file outputinterface.h.

114 {}

◆ at_eventstart() [3/4]

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

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

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 120 of file outputinterface.h.

122  {}

◆ at_eventstart() [4/4]

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

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

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 128 of file outputinterface.h.

130  {}

◆ at_eventend() [1/4]

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

Output launched at event end.

Event end is determined by maximal time-step option.

Definition at line 136 of file outputinterface.h.

137  {}

◆ at_eventend() [2/4]

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

Output launched at event end.

Event end is determined by maximal time-step option.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 143 of file outputinterface.h.

143 {}

◆ at_eventend() [3/4]

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

Output launched at event end.

Event end is determined by maximal time-step option.

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

Definition at line 149 of file outputinterface.h.

149 {}

◆ at_eventend() [4/4]

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

Output launched at event end.

Event end is determined by maximal time-step option.

Reimplemented in smash::ThermodynamicOutput.

Definition at line 154 of file outputinterface.h.

154 {}

◆ at_interaction()

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

Called whenever an action modified one or more particles.

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

Definition at line 159 of file outputinterface.h.

159 {}

◆ at_intermediate_time() [1/2]

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

Output launched after every N'th time-step.

N is controlled by an option.

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

Definition at line 164 of file outputinterface.h.

167  {}

◆ at_intermediate_time() [2/2]

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

Output launched after every N'th timestep.

N is controlled by an option.

Reimplemented in smash::ThermodynamicOutput.

Definition at line 171 of file outputinterface.h.

173  {}

◆ thermodynamics_output() [1/3]

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

Output to write thermodynamics from the lattice.

Used for vtk output.

Reimplemented in smash::VtkOutput.

Definition at line 179 of file outputinterface.h.

181  {}

◆ thermodynamics_output() [2/3]

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

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

Used for vtk output.

Reimplemented in smash::VtkOutput.

Definition at line 187 of file outputinterface.h.

189  {}

◆ thermodynamics_lattice_output() [1/3]

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

Output to write thermodynamics from the lattice.

Used for thermodynamic lattice output.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 195 of file outputinterface.h.

196  {}

◆ thermodynamics_lattice_output() [2/3]

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

Output to write thermodynamics from the lattice.

Used for thermodynamic lattice output.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 202 of file outputinterface.h.

204  {}

◆ thermodynamics_lattice_output() [3/3]

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

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

Used for thermodynamic lattice output.

Reimplemented in smash::ThermodynamicLatticeOutput.

Definition at line 210 of file outputinterface.h.

212  {}

◆ thermodynamics_output() [3/3]

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

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

Only used for vtk output. Not connected to ThermodynamicOutput.

Reimplemented in smash::VtkOutput.

Definition at line 219 of file outputinterface.h.

219 {}

◆ fields_output()

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

Write fields in vtk output Fields are a pair of threevectors for example electric and magnetic field.

Reimplemented in smash::VtkOutput.

Definition at line 225 of file outputinterface.h.

227  {}

◆ is_dilepton_output()

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

Get, whether this is the dilepton output?

Definition at line 230 of file outputinterface.h.

230 { 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 233 of file outputinterface.h.

233 { 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 236 of file outputinterface.h.

236 { 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 243 of file outputinterface.h.

243  {
244  switch (tq) {
246  return "rho_eckart";
248  return "tmn";
250  return "tmn_landau";
252  return "v_landau";
254  return "j_QBS";
255  }
256  throw std::invalid_argument("Unknown thermodynamic quantity.");
257  }
@ EckartDensity
Density in the Eckart frame.
@ Tmn
Energy-momentum tensor in lab frame.
@ LandauVelocity
Velocity of the Landau rest frame.
@ j_QBS
Electric (Q), baryonic (B) and strange (S) currents.
@ TmnLandau
Energy-momentum tensor in Landau rest frame.

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

264  {
265  switch (dens_type) {
266  case DensityType::Hadron:
267  return "hadron";
268  case DensityType::Baryon:
269  return "net_baryon";
271  return "net_baryonI3";
272  case DensityType::Pion:
273  return "pion";
275  return "tot_isospin3";
276  case DensityType::Charge:
277  return "charge";
279  return "strangeness";
280  case DensityType::None:
281  return "none";
282  }
283  throw std::invalid_argument("Unknown density type.");
284  }

Member Data Documentation

◆ is_dilepton_output_

const bool smash::OutputInterface::is_dilepton_output_
protected

Is this the dilepton output?

Definition at line 288 of file outputinterface.h.

◆ is_photon_output_

const bool smash::OutputInterface::is_photon_output_
protected

Is this the photon output?

Definition at line 291 of file outputinterface.h.

◆ is_IC_output_

const bool smash::OutputInterface::is_IC_output_
protected

Is this the IC output?

Definition at line 294 of file outputinterface.h.


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