Sapphire++
 v1.3.0-121-g2682132
Loading...
Searching...
No Matches
vfp-flags.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// Copyright (C) 2023 by the Sapphire++ authors
4//
5// This file is part of Sapphire++.
6//
7// Sapphire++ is free software: you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License as published by the Free
9// Software Foundation, either version 3 of the License, or (at your option) any
10// later version.
11//
12// Sapphire++ is distributed in the hope that it will be useful, but WITHOUT ANY
13// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14// A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15// details.
16//
17// You should have received a copy of the GNU Lesser General Public License
18// along with Sapphire++. If not, see <https://www.gnu.org/licenses/>.
19//
20// -----------------------------------------------------------------------------
21
29
30#ifndef VFP_VFPFLAGS_H
31#define VFP_VFPFLAGS_H
32
33#include <cstdint>
34
35namespace sapphirepp
36{
37
42 namespace VFP
43 {
44
74 enum class VFPFlags : std::uint16_t
75 {
76 none = 0,
82
88
93 collision = 1 << 2,
94
100 rotation = 1 << 3,
101
110
116 momentum = 1 << 5,
117
122 linear_p = 1 << 6,
123
128 source = 1 << 7,
129
138
146
153
167 };
168
169
170
178 constexpr VFPFlags
180 {
181 return static_cast<VFPFlags>(static_cast<int>(f1) | static_cast<int>(f2));
182 }
183
184
185
193 constexpr VFPFlags
195 {
196 return static_cast<VFPFlags>(static_cast<int>(f1) & static_cast<int>(f2));
197 }
198
199
200
209 template <typename StreamType>
210 inline StreamType &
211 operator<<(StreamType &os, VFPFlags f)
212 {
213 os << "VFP flags: \n";
214 if ((f & VFPFlags::time_evolution) != VFPFlags::none)
215 os << " - Time evolution term\n";
216 if ((f & VFPFlags::spatial_advection) != VFPFlags::none)
217 os << " - Spatial Advection\n";
218 if ((f & VFPFlags::collision) != VFPFlags::none)
219 os << " - Collision\n";
220 if ((f & VFPFlags::rotation) != VFPFlags::none)
221 os << " - Rotation\n";
222 if ((f & VFPFlags::time_independent_fields) != VFPFlags::none)
223 os << " - Time Independent Fields\n";
224 else
225 os << " - Time Dependent Fields\n";
226 if ((f & VFPFlags::momentum) != VFPFlags::none)
227 {
228 os << " - Momentum";
229 if ((f & VFPFlags::linear_p) != VFPFlags::none)
230 os << " (linear)\n";
231 else
232 os << " (logarithmic)\n";
233 }
234 if ((f & VFPFlags::source) != VFPFlags::none)
235 {
236 os << " - Source";
237 if ((f & VFPFlags::time_independent_source) != VFPFlags::none)
238 os << " (time independent)\n";
239 else
240 os << " (time dependent)\n";
241 }
242 if ((f & VFPFlags::scaled_distribution_function) != VFPFlags::none)
243 os << " - Scaled distribution function\n";
244 if ((f & VFPFlags::local_lax_friedrichs_flux) != VFPFlags::none)
245 os << " - Local Lax-Friedrichs Flux\n";
246 else
247 os << " - Upwind Flux\n";
248 if ((f & VFPFlags::radiation_reaction) != VFPFlags::none)
249 os << " - Radiation reaction term\n";
250
251 return os;
252 }
253
254
255
259 enum class BoundaryConditions : std::uint8_t
260 {
266
271
276
281
287 };
288
289
290
294 enum class TimeSteppingMethod : std::uint8_t
295 {
300
305
310
315
320 };
321
322
323
327 enum class GridType : std::uint8_t
328 {
333
338
343 };
344 } // namespace VFP
345} // namespace sapphirepp
346#endif
Namespace for the Vlasov-Fokker-Planck module.
Definition config.h:123
constexpr VFPFlags operator|(VFPFlags f1, VFPFlags f2)
Implement the bitwise OR operator for the VFPFlags.
Definition vfp-flags.h:179
GridType
Grid generation types for the VFP equation.
Definition vfp-flags.h:328
@ file
Definition vfp-flags.h:342
@ hypercube
Definition vfp-flags.h:332
@ shock
Definition vfp-flags.h:337
TimeSteppingMethod
Time stepping methods for the VFP equation.
Definition vfp-flags.h:295
@ forward_euler
Definition vfp-flags.h:304
@ crank_nicolson
Definition vfp-flags.h:299
@ erk4
Definition vfp-flags.h:314
@ backward_euler
Definition vfp-flags.h:309
@ lserk4
Definition vfp-flags.h:319
VFPFlags
Flags to activate the different terms of the VFP equation.
Definition vfp-flags.h:75
@ time_independent_fields
Definition vfp-flags.h:109
@ source
Definition vfp-flags.h:128
@ momentum
Definition vfp-flags.h:116
@ time_evolution
Definition vfp-flags.h:81
@ linear_p
Definition vfp-flags.h:122
@ time_independent_source
Definition vfp-flags.h:137
@ rotation
Definition vfp-flags.h:100
@ collision
Definition vfp-flags.h:93
@ spatial_advection
Definition vfp-flags.h:87
@ radiation_reaction
Definition vfp-flags.h:166
@ scaled_distribution_function
Definition vfp-flags.h:145
@ local_lax_friedrichs_flux
Definition vfp-flags.h:152
BoundaryConditions
Boundary conditions for the VFP equation.
Definition vfp-flags.h:260
@ reflective
Definition vfp-flags.h:275
@ zero_inflow
Definition vfp-flags.h:270
@ continuous
Definition vfp-flags.h:265
@ inflow
Definition vfp-flags.h:280
@ periodic
Definition vfp-flags.h:286
StreamType & operator<<(StreamType &os, const ReferenceValues &reference_values)
Output reference values to a stream.
Definition reference-values.h:158
constexpr VFPFlags operator&(VFPFlags f1, VFPFlags f2)
Implement the bitwise AND operator for the VFPFlags.
Definition vfp-flags.h:194
Namespace for Sapphire+⁠+.
Definition config.h:51