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#include <AMReX_REAL.H>
13
14// Forward declaration to avoid heavy includes in the header
17
19public:
20
21 // Construct and read parameters from inputs under the `particle_thermalizer` block.
23
24 // Returns true if the particle_thermalizer parameters were provided
25 // and the thermalizer is therefore on.
26 [[nodiscard]] bool defined () const;
27
28 // Apply the thermalizer to particles in the provided MultiParticleContainer.
30
31 // Per-species overload; operates on a single WarpXParticleContainer.
32 // Should be protected, but can't be because it has an extended __device__ lambda
33 void applyThermalizer (WarpXParticleContainer &pcont) const;
34
35private:
36 bool m_defined{false};
37
38 // The normal direction as an integer USING THE AMREX CONVENTION (0, 1, or 2)
39 // in 1D, "z" is 0
40 // in 2D, "x" is 0, "z" is 1
41 // in 3D, "x" is 0, "y" is 1, "z" is 2
42 int m_normal{-1};
43
44 // The start and end positions of the thermalizer region along the normal direction
47
48 // The momentum threshold above which particles are thermalized in normalized units (i.e. u = gamma*beta)
50
51 // dimensionless temperature theta = kB*T/(m*c^2) used to sample thermal momentum distribution
53
54 // If non-empty, only these species are thermalized; if empty, all species are thermalized.
55 std::vector<std::string> m_species_names;
56};
57
58#endif // WARPX_PARTICLETHERMALIZER_H
Definition MultiParticleContainer.H:69
ParticleThermalizer()
Definition ParticleThermalizer.cpp:22
std::vector< std::string > m_species_names
Definition ParticleThermalizer.H:55
amrex::Real m_start
Definition ParticleThermalizer.H:45
void applyThermalizer(MultiParticleContainer &mpc) const
Definition ParticleThermalizer.cpp:94
amrex::Real m_theta
Definition ParticleThermalizer.H:52
bool m_defined
Definition ParticleThermalizer.H:36
amrex::Real m_end
Definition ParticleThermalizer.H:46
bool defined() const
Definition ParticleThermalizer.cpp:90
amrex::Real m_momentum_threshold
Definition ParticleThermalizer.H:49
int m_normal
Definition ParticleThermalizer.H:42
Definition WarpXParticleContainer.H:195
amrex_real Real