WarpX
Toggle main menu visibility
Loading...
Searching...
No Matches
Source
Particles
ParticleThermalizer
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
17
class
MultiParticleContainer
;
18
class
WarpXParticleContainer
;
19
20
class
ParticleThermalizer
{
21
public
:
22
23
// Construct and read parameters from inputs under the `particle_thermalizer` block.
24
ParticleThermalizer
();
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.
31
void
applyThermalizer
(
MultiParticleContainer
&mpc)
const
;
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
37
private
:
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
47
amrex::Real
m_start
;
48
amrex::Real
m_end
;
49
50
// The threshold for each momentum component above which particles are thermalized in normalized units (i.e. u = gamma*beta)
51
amrex::Array<amrex::Real, 3>
m_momentum_threshold
;
52
53
// dimensionless temperature theta = kB*T/(m*c^2) used to sample thermal momentum distribution
54
amrex::Real
m_theta
;
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
AMReX_Array.H
AMReX_REAL.H
MultiParticleContainer
Definition
MultiParticleContainer.H:69
ParticleThermalizer::ParticleThermalizer
ParticleThermalizer()
Definition
ParticleThermalizer.cpp:26
ParticleThermalizer::m_species_names
std::vector< std::string > m_species_names
Definition
ParticleThermalizer.H:57
ParticleThermalizer::m_start
amrex::Real m_start
Definition
ParticleThermalizer.H:47
ParticleThermalizer::applyThermalizer
void applyThermalizer(MultiParticleContainer &mpc) const
Definition
ParticleThermalizer.cpp:113
ParticleThermalizer::m_theta
amrex::Real m_theta
Definition
ParticleThermalizer.H:54
ParticleThermalizer::m_defined
bool m_defined
Definition
ParticleThermalizer.H:38
ParticleThermalizer::m_momentum_threshold
amrex::Array< amrex::Real, 3 > m_momentum_threshold
Definition
ParticleThermalizer.H:51
ParticleThermalizer::m_end
amrex::Real m_end
Definition
ParticleThermalizer.H:48
ParticleThermalizer::defined
bool defined() const
Definition
ParticleThermalizer.cpp:109
ParticleThermalizer::m_normal
int m_normal
Definition
ParticleThermalizer.H:44
WarpXParticleContainer
Definition
WarpXParticleContainer.H:195
amrex::Real
amrex_real Real
amrex::Array
std::array< T, N > Array
Generated by
1.17.0