Version: SMASH-3.4
stringify.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2025-2026
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_STRINGIFY_H_
11 #define SRC_INCLUDE_SMASH_STRINGIFY_H_
12 
13 #include <string>
14 #include <vector>
15 
16 #include "einhard.hpp"
17 
18 #include "forwarddeclarations.h"
19 
20 namespace smash {
21 
22 /**
23  * Convert a ThermodynamicQuantity enum value to its corresponding string.
24  *
25  * \param[in] quantity The ThermodynamicQuantity enum value to convert.
26  *
27  * \return std::string Corresponding string representation.
28  * \throws std::invalid_argument If the enum value is unhandled.
29  */
30 std::string to_string(ThermodynamicQuantity quantity);
31 
32 /**
33  * Convert a CalculationFrame enum value to its corresponding string.
34  *
35  * \param[in] frame The CalculationFrame enum value to convert.
36  *
37  * \return std::string Corresponding string representation.
38  * \throws std::invalid_argument If the enum value is unhandled.
39  */
40 std::string to_string(CalculationFrame frame);
41 
42 /**
43  * Convert a DileptonBremsPionFormFactor enum value to its corresponding string.
44  *
45  * \param[in] factor The DileptonBremsPionFormFactor enum value to convert.
46  *
47  * \return std::string Corresponding string representation.
48  * \throws std::invalid_argument If the enum value is unhandled.
49  */
50 std::string to_string(DileptonBremsPionFormFactor factor);
51 
52 /**
53  * Convert a FermiMotion enum value to its corresponding string.
54  *
55  * \param[in] motion The FermiMotion enum value to convert.
56  *
57  * \return std::string Corresponding string representation.
58  * \throws std::invalid_argument If the enum value is unhandled.
59  */
60 std::string to_string(FermiMotion motion);
61 
62 /**
63  * Convert a DensityType enum value to its corresponding string.
64  *
65  * \param[in] type The DensityType enum value to convert.
66  *
67  * \return std::string Corresponding string representation.
68  * \throws std::invalid_argument If the enum value is unhandled.
69  */
70 std::string to_string(DensityType type);
71 
72 /**
73  * Convert an ExpansionMode enum value to its corresponding string.
74  *
75  * \param[in] mode The ExpansionMode enum value to convert.
76  *
77  * \return std::string Corresponding string representation.
78  * \throws std::invalid_argument If the enum value is unhandled.
79  */
80 std::string to_string(ExpansionMode mode);
81 
82 /**
83  * Convert a DerivativesMode enum value to its corresponding string.
84  *
85  * \param[in] mode The DerivativesMode enum value to convert.
86  *
87  * \return std::string Corresponding string representation.
88  * \throws std::invalid_argument If the enum value is unhandled.
89  */
90 std::string to_string(DerivativesMode mode);
91 
92 /**
93  * Convert a FieldDerivativesMode enum value to its corresponding string.
94  *
95  * \param[in] mode The FieldDerivativesMode enum value to convert.
96  *
97  * \return std::string Corresponding string representation.
98  * \throws std::invalid_argument If the enum value is unhandled.
99  */
100 std::string to_string(FieldDerivativesMode mode);
101 
102 /**
103  * Convert a SmearingMode enum value to its corresponding string.
104  *
105  * \param[in] mode The SmearingMode enum value to convert.
106  *
107  * \return std::string Corresponding string representation.
108  * \throws std::invalid_argument If the enum value is unhandled.
109  */
110 std::string to_string(SmearingMode mode);
111 
112 /**
113  * Convert a TimeStepMode enum value to its corresponding string.
114  *
115  * \param[in] mode The TimeStepMode enum value to convert.
116  *
117  * \return std::string Corresponding string representation.
118  * \throws std::invalid_argument If the enum value is unhandled.
119  */
120 std::string to_string(TimeStepMode mode);
121 
122 /**
123  * Convert a BoxInitialCondition enum value to its corresponding string.
124  *
125  * \param[in] cond The BoxInitialCondition enum value to convert.
126  *
127  * \return std::string Corresponding string representation.
128  * \throws std::invalid_argument If the enum value is unhandled.
129  */
130 std::string to_string(BoxInitialCondition cond);
131 
132 /**
133  * Convert a SphereInitialCondition enum value to its corresponding string.
134  *
135  * \param[in] cond The SphereInitialCondition enum value to convert.
136  *
137  * \return std::string Corresponding string representation.
138  * \throws std::invalid_argument If the enum value is unhandled.
139  */
140 std::string to_string(SphereInitialCondition cond);
141 
142 /**
143  * Convert a NNbarTreatment enum value to its corresponding string.
144  *
145  * \param[in] t The NNbarTreatment enum value to convert.
146  *
147  * \return std::string Corresponding string representation.
148  * \throws std::invalid_argument If the enum value is unhandled.
149  */
150 std::string to_string(NNbarTreatment t);
151 
152 /**
153  * Convert a Sampling enum value to its corresponding string.
154  *
155  * \param[in] s The Sampling enum value to convert.
156  *
157  * \return std::string Corresponding string representation.
158  * \throws std::invalid_argument If the enum value is unhandled.
159  */
160 std::string to_string(Sampling s);
161 
162 /**
163  * Convert a ThermalizationAlgorithm enum value to its corresponding string.
164  *
165  * \param[in] algo The ThermalizationAlgorithm enum value to convert.
166  *
167  * \return std::string Corresponding string representation.
168  * \throws std::invalid_argument If the enum value is unhandled.
169  */
170 std::string to_string(ThermalizationAlgorithm algo);
171 
172 /**
173  * Convert a CollisionCriterion enum value to its corresponding string.
174  *
175  * \param[in] c The CollisionCriterion enum value to convert.
176  *
177  * \return std::string Corresponding string representation.
178  * \throws std::invalid_argument If the enum value is unhandled.
179  */
180 std::string to_string(CollisionCriterion c);
181 
182 /**
183  * Convert a CharmRescattering enum value to its corresponding string.
184  *
185  * \param[in] c The CharmRescattering enum value to convert.
186  *
187  * \return std::string Corresponding string representation.
188  * \throws std::invalid_argument If the enum value is unhandled.
189  */
190 std::string to_string(CharmRescattering c);
191 
192 /**
193  * Convert a SpinInteractionType enum value to its corresponding string.
194  *
195  * \param[in] type The SpinInteractionType enum value to convert.
196  *
197  * \return std::string Corresponding string representation.
198  * \throws std::invalid_argument If the enum value is unhandled.
199  */
200 std::string to_string(SpinInteractionType type);
201 
202 /**
203  * Convert a HardStringTransitionMode enum value to its corresponding string.
204  *
205  * \param[in] mode The HardStringTransitionMode enum value to convert.
206  *
207  * \return std::string Corresponding string representation.
208  * \throws std::invalid_argument If the enum value is unhandled.
209  */
211 
212 /**
213  * Convert a TotalCrossSectionStrategy enum value to its corresponding string.
214  *
215  * \param[in] s The TotalCrossSectionStrategy enum value to convert.
216  *
217  * \return std::string Corresponding string representation.
218  * \throws std::invalid_argument If the enum value is unhandled.
219  */
220 std::string to_string(TotalCrossSectionStrategy s);
221 
222 /**
223  * Convert a PseudoResonance enum value to its corresponding string.
224  *
225  * \param[in] p The PseudoResonance enum value to convert.
226  *
227  * \return std::string Corresponding string representation.
228  * \throws std::invalid_argument If the enum value is unhandled.
229  */
230 std::string to_string(PseudoResonance p);
231 
232 /**
233  * Convert a FluidizationType enum value to its corresponding string.
234  *
235  * \param[in] f The FluidizationType enum value to convert.
236  *
237  * \return std::string Corresponding string representation.
238  * \throws std::invalid_argument If the enum value is unhandled.
239  */
240 std::string to_string(FluidizationType f);
241 
242 /**
243  * Convert an OutputOnlyFinal enum value to its corresponding string.
244  *
245  * \param[in] o The OutputOnlyFinal enum value to convert.
246  *
247  * \return std::string Corresponding string representation.
248  * \throws std::invalid_argument If the enum value is unhandled.
249  */
250 std::string to_string(OutputOnlyFinal o);
251 
252 /**
253  * Convert a LogLevel enum value to its corresponding string.
254  *
255  * \param[in] level The LogLevel enum value to convert.
256  *
257  * \return std::string Corresponding string representation.
258  * \throws std::invalid_argument If the enum value is unhandled.
259  */
260 std::string to_string(einhard::LogLevel level);
261 
262 /**
263  * Convert a ReactionsBitSet to a vector of strings for all set reactions.
264  *
265  * \param[in] s The ReactionsBitSet to convert.
266  *
267  * \return std::vector<std::string> Vector of all set reaction names.
268  */
269 std::vector<std::string> to_string(const ReactionsBitSet &s);
270 
271 /**
272  * Convert a MultiParticleReactionsBitSet to a vector of strings for all set
273  * reactions.
274  *
275  * \param[in] s The MultiParticleReactionsBitSet to convert.
276  *
277  * \return std::vector<std::string> Vector of all set reaction names.
278  */
279 std::vector<std::string> to_string(const MultiParticleReactionsBitSet &s);
280 
281 /**
282  * Convert a FluidizableProcessesBitSet to a vector of strings for all set
283  * processes.
284  *
285  * \param[in] s The FluidizableProcessesBitSet to convert.
286  *
287  * \return std::vector<std::string> Vector of all set process names.
288  */
289 std::vector<std::string> to_string(const FluidizableProcessesBitSet &s);
290 
291 } // namespace smash
292 
293 #endif // SRC_INCLUDE_SMASH_STRINGIFY_H_
This is the main include file for Einhard.
SmearingMode
Modes of smearing.
DileptonBremsPionFormFactor
Option to use form factors in dilepton bremsstrahlung as described in Shyam:2010vr .
FermiMotion
Option to use Fermi Motion.
ThermalizationAlgorithm
Defines the algorithm used for the forced thermalization.
FluidizationType
Possible methods to convert SMASH particle into fluid cells.
NNbarTreatment
Treatment of N Nbar Annihilation.
CharmRescattering
Possible charm scattering options.
TimeStepMode
The time step mode.
ThermodynamicQuantity
Represents thermodynamic quantities that can be printed out See user guide description for more infor...
HardStringTransitionMode
Select the model used for the transition from soft to hard string excitation.
std::bitset< 5 > FluidizableProcessesBitSet
TotalCrossSectionStrategy
Determine how total cross sections for collision finding should be computed.
Sampling
Possible methods of impact parameter sampling.
std::bitset< 4 > MultiParticleReactionsBitSet
Container for the n to m reactions in the code.
CalculationFrame
The calculation frame.
DerivativesMode
Modes of calculating the gradients.
CollisionCriterion
Criteria used to check collisions.
FieldDerivativesMode
Modes of calculating the field gradients: chain rule or direct.
SphereInitialCondition
Initial condition for a particle in a sphere.
PseudoResonance
Which pseudo-resonance fills the inelastic gap in the transition to string region of cross sections.
std::bitset< 11 > ReactionsBitSet
Container for the 2 to 2 reactions in the code.
DensityType
Allows to choose which kind of density to calculate.
OutputOnlyFinal
Whether and when only final state particles should be printed.
SpinInteractionType
Possible spin interaction types.
BoxInitialCondition
Initial condition for a particle in a box.
ExpansionMode
Defines properties of expansion for the metric (e.g.
LogLevel
Specification of the message severity.
Definition: einhard.hpp:109
constexpr int p
Proton.
Definition: action.h:24
std::string to_string(ThermodynamicQuantity quantity)
Convert a ThermodynamicQuantity enum value to its corresponding string.
Definition: stringify.cc:26