Hipace
|
Container for particles of 1 beam species. More...
#include <BeamParticleContainer.H>
Public Member Functions | |
BeamParticleContainer (std::string name) | |
void | ReadParameters () |
amrex::Real | InitData (const amrex::Geometry &geom) |
Allocate beam particle data and initialize particles with requested beam profile. More... | |
void | InitBeamFixedPPC3D () |
void | InitBeamFixedPPCSlice (const int islice, const int which_beam_slice) |
void | InitBeamFixedWeight3D () |
void | InitBeamFixedWeightSlice (const int islice, const int which_beam_slice) |
void | InitBeamFixedWeightPDF3D () |
void | InitBeamFixedWeightPDFSlice (int slice, int which_slice) |
void | InSituComputeDiags (int islice) |
void | InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry &geom) |
void | TagByLevel (const int current_N_level, amrex::Vector< amrex::Geometry > const &geom3D, const int which_slice) |
Store the finest level of every beam particle on which_slice in the cpu() attribute. More... | |
void | ReorderParticles (int beam_slice, int step, amrex::Geometry &slice_geom) |
Reorder beam particles to speed-up push and current deposition. More... | |
amrex::Real | GetCharge () const |
amrex::Real | GetMass () const |
std::string | get_name () const |
void | shiftBeamSlices () |
BeamTile & | getBeamSlice (int which_slice) |
const BeamTile & | getBeamSlice (int which_slice) const |
int | getNumParticles (int which_slice) const |
int | getNumParticlesIncludingSlipped (int which_slice) const |
void | resize (int which_slice, int num_particles, int num_slipped_particles) |
BeamTileInit & | getBeamInitSlice () |
void | intializeSlice (int slice, int which_slice) |
uint64_t | getTotalNumParticles () const |
int | numRealComponents () const |
int | numIntComponents () const |
bool | communicateIdCpuComponent () const |
bool | communicateRealComponent (int rcomp) const |
bool | communicateIntComponent (int icomp) const |
Public Attributes | |
amrex::Real | m_charge |
amrex::Real | m_mass |
bool | m_do_z_push {true} |
int | m_n_subcycles {10} |
bool | m_do_radiation_reaction {false} |
bool | m_do_salame = false |
bool | m_do_reset_id_init {false} |
bool | m_initialize_on_cpu {false} |
int | m_insitu_period {0} |
bool | m_use_external_fields = false |
amrex::GpuArray< amrex::ParserExecutor< 4 >, 6 > | m_external_fields |
amrex::Array< amrex::Parser, 6 > | m_external_fields_parser |
bool | m_do_spin_tracking = false |
Static Private Attributes | |
static constexpr int | m_insitu_nrp = 22 |
static constexpr int | m_insitu_nip = 1 |
Container for particles of 1 beam species.
|
inlineexplicit |
Constructor
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns elementary charge q_e (or -q_e for electrons).
|
inline |
Returns mass of physical species
|
inline |
void BeamParticleContainer::InitBeamFixedPPC3D | ( | ) |
Initialize a beam with a fixed number of particles per cell
void BeamParticleContainer::InitBeamFixedWeight3D | ( | ) |
Initialize a beam with a fixed number of particles, and fixed weight
void BeamParticleContainer::InitBeamFixedWeightPDF3D | ( | ) |
Initialize a beam with a fixed number of particles, and fixed weight using a probability density function (PDF)
void BeamParticleContainer::InitBeamFixedWeightSlice | ( | const int | islice, |
const int | which_beam_slice | ||
) |
amrex::Real BeamParticleContainer::InitData | ( | const amrex::Geometry & | geom | ) |
Allocate beam particle data and initialize particles with requested beam profile.
[in] | geom | Geometry object for the whole domain |
void BeamParticleContainer::InSituComputeDiags | ( | int | islice | ) |
Compute reduced beam diagnostics of current slice, store in member variable
[in] | islice | current slice, on which diags are computed. |
void BeamParticleContainer::InSituWriteToFile | ( | int | step, |
amrex::Real | time, | ||
const amrex::Geometry & | geom | ||
) |
Dump in-situ reduced diagnostics to file.
[in] | step | current time step |
[in] | time | physical time |
[in] | geom | Geometry object for the whole domain |
|
inline |
|
inline |
void BeamParticleContainer::ReadParameters | ( | ) |
Read parameters in the input file
void BeamParticleContainer::ReorderParticles | ( | int | beam_slice, |
int | step, | ||
amrex::Geometry & | slice_geom | ||
) |
Reorder beam particles to speed-up push and current deposition.
[in] | beam_slice | beam slice to reorder, WhichBeamSlice::This WhichBeamSlice::Next |
[in] | step | current time step |
[in] | slice_geom | Geometry object for one xy slice |
void BeamParticleContainer::resize | ( | int | which_slice, |
int | num_particles, | ||
int | num_slipped_particles | ||
) |
|
inline |
void BeamParticleContainer::TagByLevel | ( | const int | current_N_level, |
amrex::Vector< amrex::Geometry > const & | geom3D, | ||
const int | which_slice | ||
) |
Store the finest level of every beam particle on which_slice in the cpu() attribute.
[in] | current_N_level | number of MR levels active on the current slice |
[in] | geom3D | Geometry object for the whole domain |
[in] | which_slice | slice to mark |
|
private |
|
private |
amrex::Real BeamParticleContainer::m_charge |
charge of each particle of this species
|
private |
Peak density for fixed-weight Gaussian beam
|
private |
Density parser for fixed-ppc beam. Owns data for m_density_func
bool BeamParticleContainer::m_do_radiation_reaction {false} |
whether to calculate radiation losses
bool BeamParticleContainer::m_do_reset_id_init {false} |
Whether to reset the global ID incrementor to 1 before initializing this beam
bool BeamParticleContainer::m_do_salame = false |
Number of particles on upstream rank (required for IO) Whether this beam uses salame
bool BeamParticleContainer::m_do_spin_tracking = false |
If spin tracking is enabled for this beam
|
private |
Option to symmetrize the beam
bool BeamParticleContainer::m_do_z_push {true} |
Pushing beam particles in z direction
|
private |
relative energy spread per dzeta
amrex::GpuArray<amrex::ParserExecutor<4>, 6> BeamParticleContainer::m_external_fields |
External field functions for Ex Ey Ez Bx By Bz
amrex::Array<amrex::Parser, 6> BeamParticleContainer::m_external_fields_parser |
Owns data for m_external_fields
|
private |
Coordinates used in input file, are converted to Hipace Coordinates x y z respectively
|
private |
density profile of the beam
|
private |
momentum profile of the beam
|
private |
64 bit ID to initialize many particles without overflowing
|
private |
|
private |
bool BeamParticleContainer::m_initialize_on_cpu {false} |
|
private |
injection type, fixed_width or fixed_ppc
|
private |
Path to bean input file
|
private |
Prefix/path for the output files
|
private |
Per-slice int beam properties
|
staticconstexprprivate |
Number of int beam properties for in-situ per-slice reduced diagnostics.
|
staticconstexprprivate |
Number of real beam properties for in-situ per-slice reduced diagnostics.
int BeamParticleContainer::m_insitu_period {0} |
How often the insitu beam diagnostics should be computed and written Default is 0, meaning no output
|
private |
radius of the beam insitu diagnostics
|
private |
Per-slice real beam properties
|
private |
Sum of all per-slice int beam properties
|
private |
Sum of all per-slice real beam properties
amrex::Real BeamParticleContainer::m_mass |
mass of each particle of this species
|
private |
minimum density at which beam particles are generated
int BeamParticleContainer::m_n_subcycles {10} |
Number of sub-cycles in the beam pusher
|
private |
name of the species
|
private |
number of z slices of the domain
|
private |
the iteration of the openPMD beam
|
private |
Number of particles for fixed-weight Gaussian beam
|
private |
number of particles that need to be initialized per slice
|
private |
|
private |
|
private |
probability density function
|
private |
Owns data for all 11 Parser functions of fixed_weight_pdf
|
private |
functions for x_mean, y_mean, x_std, y_std
|
private |
number of subcycles per slice for the pdf evaluation
|
private |
functions for ux_mean, uy_mean, uz_mean, ux_std, uy_std, uz_std
|
private |
if the peak density is specified
|
private |
Density of plasma to convert from_file beam to normalized units
|
private |
Average x position of the fixed-weight beam depending on z
|
private |
Average x position of the fixed-weight beam depending on z
|
private |
|
private |
Average y position of the fixed-weight beam depending on z
|
private |
|
private |
mean position of the beam
|
private |
Width of the Gaussian beam. Only used for a fixed-weight beam
|
private |
Number of particles per cell in each direction
|
private |
Radius of the beam
|
private |
if the cell position is random in each direction
|
private |
2D reordering index type. 0: cell, 1: node, 2: both
|
private |
After how many slices the particles are reordered. 0: off
|
private |
|
private |
|
private |
the name of the particle species in the beam file
|
private |
Total beam charge for fixed-weight Gaussian beam
|
private |
|
private |
sum of the weights of all particles
bool BeamParticleContainer::m_use_external_fields = false |
Whether external fields should be used for this beam
|
private |
Array for the z position of all beam particles
|
private |
Distance at which the beam is focused, starting from its initial position
|
private |
Max longitudinal particle position of the beam
|
private |
Min longitudinal particle position of the beam