Version: SMASH-3.4
thermodynamicoutput.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2020,2022,2024,2026
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_THERMODYNAMICOUTPUT_H_
11 #define SRC_INCLUDE_SMASH_THERMODYNAMICOUTPUT_H_
12 
13 #include <memory>
14 #include <set>
15 #include <string>
16 #include <vector>
17 
18 #include "density.h"
19 #include "experimentparameters.h"
20 #include "file.h"
21 #include "forwarddeclarations.h"
22 #include "outputinterface.h"
23 #include "outputparameters.h"
24 #include "threevector.h"
25 
26 namespace smash {
27 
28 /**
29  * \ingroup output
30  *
31  * \brief Writes the thermodynamic quantities at a specified point versus time
32  *
33  * This class is a temporary solution to write thermodynamic
34  * quantities out. Calculations are called directly inside the
35  * output functions. In future it should be substituted by some
36  * more general output.
37  *
38  */
40  public:
41  /**
42  * Construct Output
43  * param[in] path Path to output
44  * param[in] name Filename
45  * param[in] out_par Parameters of output
46  */
47  ThermodynamicOutput(const std::filesystem::path &path,
48  const std::string &name, const OutputParameters &out_par);
49  /// Default destructor
51 
52  /**
53  * Write the event header
54  *
55  * \param[in] ensembles Dummy, is just here to satisfy inheritance
56  * \param[in] event_number Event number to be written to the header
57  */
58  void at_eventstart(const std::vector<Particles> &ensembles,
59  const int event_number) override;
60 
61  /**
62  * Only flush the output the file
63  *
64  * \param[in] ensembles Dummy, is just here to satisfy inheritance
65  * \param[in] event_number Dummy, is just here to satisfy inheritance
66  */
67  void at_eventend(const std::vector<Particles> &ensembles,
68  const int event_number) override;
69 
70  /**
71  * Write thermodynamics every fixed time interval. For configuring the output
72  * see \ref doxypage_output_thermodyn.
73  *
74  * \param[in] ensembles Particles, from which thermodynamic variables are
75  * computed
76  * \param[in] clock Clock, needed to get current time
77  * \param[in] dens_param set of parameters, defining smearing.
78  * For more info about
79  * smearing see \ref doxypage_output_thermodyn.
80  */
81  void at_intermediate_time(const std::vector<Particles> &ensembles,
82  const std::unique_ptr<Clock> &clock,
83  const DensityParameters &dens_param) override;
84 
85  /**
86  * Print density along the specified line. Useful to make 1D plots of density
87  * profiles.
88  *
89  * \param[in] file_name name of the file to print out
90  * \param[in] param Parameters for density calculation
91  * \param[in] plist particles, from which density is computed
92  * \param[in] dens_type type of density
93  * \param[in] line_start starting point of the line
94  * \param[in] line_end ending point of the line
95  * \param[in] n_points number of points along the line, where density
96  * is printed out
97  */
98  void density_along_line(const char *file_name, const ParticleList &plist,
99  const DensityParameters &param, DensityType dens_type,
100  const ThreeVector &line_start,
101  const ThreeVector &line_end, int n_points);
102 
103  private:
104  /// Pointer to output file
106  /// Structure that holds all the information about what to printout
108 };
109 
110 } // namespace smash
111 
112 #endif // SRC_INCLUDE_SMASH_THERMODYNAMICOUTPUT_H_
A class to pre-calculate and store parameters relevant for density calculation.
Definition: density.h:92
Abstraction of generic output.
A RAII type to replace std::FILE *.
Definition: file.h:72
Writes the thermodynamic quantities at a specified point versus time.
void at_eventend(const std::vector< Particles > &ensembles, const int event_number) override
Only flush the output the file.
void density_along_line(const char *file_name, const ParticleList &plist, const DensityParameters &param, DensityType dens_type, const ThreeVector &line_start, const ThreeVector &line_end, int n_points)
Print density along the specified line.
ThermodynamicOutput(const std::filesystem::path &path, const std::string &name, const OutputParameters &out_par)
Construct Output param[in] path Path to output param[in] name Filename param[in] out_par Parameters o...
void at_intermediate_time(const std::vector< Particles > &ensembles, const std::unique_ptr< Clock > &clock, const DensityParameters &dens_param) override
Write thermodynamics every fixed time interval.
void at_eventstart(const std::vector< Particles > &ensembles, const int event_number) override
Write the event header.
RenamingFilePtr file_
Pointer to output file.
const OutputParameters out_par_
Structure that holds all the information about what to printout.
~ThermodynamicOutput()
Default destructor.
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
DensityType
Allows to choose which kind of density to calculate.
Definition: action.h:24
Helper structure for Experiment to hold output options and parameters.