WarpX
Loading...
Searching...
No Matches
ParticleThermalizer.H
Go to the documentation of this file.
1/* Copyright 2026 Andrew Myers
2 *
3 * This file is part of WarpX.
4 *
5 * License: BSD-3-Clause-LBNL
6 */
7#ifndef WARPX_PARTICLETHERMALIZER_H
8#define WARPX_PARTICLETHERMALIZER_H
9
10#include <string>
11#include <vector>
12
13#include <AMReX_Array.H>
14#include <AMReX_REAL.H>
15
16// Forward declaration to avoid heavy includes in the header
19
21public:
22
23 // Construct and read parameters from inputs under the `particle_thermalizer` block.
25
26 // Returns true if the particle_thermalizer parameters were provided
27 // and the thermalizer is therefore on.
28 [[nodiscard]] bool defined () const;
29
30 // Apply the thermalizer to particles in the provided MultiParticleContainer.
32
33 // Per-species overload; operates on a single WarpXParticleContainer.
34 // Should be protected, but can't be because it has an extended __device__ lambda
35 void applyThermalizer (WarpXParticleContainer &pcont) const;
36
37private:
38 bool m_defined{false};
39
40 // The normal direction as an integer USING THE AMREX CONVENTION (0, 1, or 2)
41 // in 1D, "z" is 0
42 // in 2D, "x" is 0, "z" is 1
43 // in 3D, "x" is 0, "y" is 1, "z" is 2
44 int m_normal{-1};
45
46 // The start and end positions of the thermalizer region along the normal direction
49
50 // The threshold for each momentum component above which particles are thermalized in normalized units (i.e. u = gamma*beta)
52
53 // dimensionless temperature theta = kB*T/(m*c^2) used to sample thermal momentum distribution
55
56 // If non-empty, only these species are thermalized; if empty, all species are thermalized.
57 std::vector<std::string> m_species_names;
58};
59
60#endif // WARPX_PARTICLETHERMALIZER_H
Definition MultiParticleContainer.H:69
ParticleThermalizer()
Definition ParticleThermalizer.cpp:26
std::vector< std::string > m_species_names
Definition ParticleThermalizer.H:57
amrex::Real m_start
Definition ParticleThermalizer.H:47
void applyThermalizer(MultiParticleContainer &mpc) const
Definition ParticleThermalizer.cpp:113
amrex::Real m_theta
Definition ParticleThermalizer.H:54
bool m_defined
Definition ParticleThermalizer.H:38
amrex::Array< amrex::Real, 3 > m_momentum_threshold
Definition ParticleThermalizer.H:51
amrex::Real m_end
Definition ParticleThermalizer.H:48
bool defined() const
Definition ParticleThermalizer.cpp:109
int m_normal
Definition ParticleThermalizer.H:44
Definition WarpXParticleContainer.H:195
amrex_real Real
std::array< T, N > Array