Version: SMASH-3.4
icoutput.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2019-2020,2022-2025
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_ICOUTPUT_H_
11 #define SRC_INCLUDE_SMASH_ICOUTPUT_H_
12 
13 #include <filesystem>
14 #include <memory>
15 #include <string>
16 
17 #include "file.h"
18 #include "outputinterface.h"
19 #include "outputparameters.h"
20 #include "smash/config.h"
21 #include "smash/outputformatter.h"
22 namespace smash {
23 
24 /**
25  * \ingroup output
26  *
27  * SMASH output in a format containing initial conditions for hydrodynamic
28  * codes ("For_vHLLE"). Formatted such that it can be directly processed by
29  * vHLLE \iref{Karpenko:2015xea}.
30  */
31 class ICOutput : public OutputInterface {
32  public:
33  /**
34  * Create a new IC output.
35  *
36  * \param[in] path Path to the output file.
37  * \param[in] name Name of the output.
38  * \param[in] out_par Additional information on the configured output.
39  */
40  ICOutput(const std::filesystem::path &path, const std::string &name,
41  const OutputParameters &out_par);
42  ~ICOutput();
43 
44  /**
45  * Write event start line.
46  * \param[in] event_label Numbers of the current event and ensemble.
47  * \param[in] event Event info, see \ref event_info
48  */
49  void at_eventstart(const Particles &, const EventLabel &event_label,
50  const EventInfo &event) override;
51 
52  /**
53  * Write event end line.
54  * \param[in] particles Particles at end of event, expected to be empty
55  * \param[in] event_label Numbers of the current event and ensemble.
56  * \param[in] event Event info, see \ref event_info
57  */
58  void at_eventend(const Particles &particles, const EventLabel &event_label,
59  const EventInfo &event) override;
60 
61  /**
62  * Unused, but needed since virtually declared in mother class.
63  */
64  void at_intermediate_time(const Particles &, const std::unique_ptr<Clock> &,
65  const DensityParameters &, const EventLabel &,
66  const EventInfo &) override;
67  /**
68  * Write particle data at the hypersurface crossing point to the IC output.
69  *
70  * \param[in] action Details about the action
71  */
72  void at_interaction(const Action &action, const double) override;
73 
74  private:
75  /// Pointer to output file
77  /// Structure that holds all the information about what to printout
79 
80  /**
81  * Proper time of the particles removed when extracting initial conditions.
82  * Parameter used for testing purposes only. Used to verify that the initial
83  * proper time remains unchanged during the evolution. Determined from the
84  * actually removed particles.
85  * By construction, tau > 0. Nevertheless it is initialized with a negative
86  * number to easily find the first particle that is removed from the evolution
87  * in at_interaction().
88  */
89  double IC_proper_time_ = -1.0;
90 
91  /// Formatter of the output
93 };
94 
95 } // namespace smash
96 
97 #endif // SRC_INCLUDE_SMASH_ICOUTPUT_H_
Action is the base class for a generic process that takes a number of incoming particles and transfor...
Definition: action.h:35
A class to pre-calculate and store parameters relevant for density calculation.
Definition: density.h:92
SMASH output in a format containing initial conditions for hydrodynamic codes ("For_vHLLE").
Definition: icoutput.h:31
void at_eventstart(const Particles &, const EventLabel &event_label, const EventInfo &event) override
Write event start line.
Definition: icoutput.cc:118
void at_intermediate_time(const Particles &, const std::unique_ptr< Clock > &, const DensityParameters &, const EventLabel &, const EventInfo &) override
Unused, but needed since virtually declared in mother class.
Definition: icoutput.cc:139
RenamingFilePtr file_
Pointer to output file.
Definition: icoutput.h:76
ICOutput(const std::filesystem::path &path, const std::string &name, const OutputParameters &out_par)
Create a new IC output.
Definition: icoutput.cc:102
double IC_proper_time_
Proper time of the particles removed when extracting initial conditions.
Definition: icoutput.h:89
void at_interaction(const Action &action, const double) override
Write particle data at the hypersurface crossing point to the IC output.
Definition: icoutput.cc:146
const OutputParameters out_par_
Structure that holds all the information about what to printout.
Definition: icoutput.h:78
void at_eventend(const Particles &particles, const EventLabel &event_label, const EventInfo &event) override
Write event end line.
Definition: icoutput.cc:128
OutputFormatter< ToASCII > formatter_
Formatter of the output.
Definition: icoutput.h:92
A general-purpose formatter for output, supporting both ASCII and binary formats.
Abstraction of generic output.
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
A RAII type to replace std::FILE *.
Definition: file.h:72
Definition: action.h:24
Structure to contain custom data for output.
Structure to contain information about the event and ensemble numbers.
Helper structure for Experiment to hold output options and parameters.