Hipace
|
#include <MultiPlasma.H>
Public Member Functions | |
MultiPlasma () | |
~MultiPlasma () | |
void | InitData (amrex::Vector< amrex::BoxArray > slice_ba, amrex::Vector< amrex::DistributionMapping > slice_dm, amrex::Vector< amrex::Geometry > slice_gm, amrex::Vector< amrex::Geometry > gm) |
Loop over plasma species and initialize them. More... | |
void | DepositCurrent (Fields &fields, const MultiLaser &multi_laser, int which_slice, bool deposit_jx_jy, bool deposit_jz, bool deposit_rho, bool deposit_chi, bool deposit_rhomjz, amrex::Vector< amrex::Geometry > const &gm, int const lev) |
void | ExplicitDeposition (Fields &fields, const MultiLaser &multi_laser, amrex::Vector< amrex::Geometry > const &gm, int const lev) |
amrex::Real | maxDensity (amrex::Real z) |
Return max density, to compute the adaptive time step. More... | |
void | AdvanceParticles (const Fields &fields, const MultiLaser &multi_laser, amrex::Vector< amrex::Geometry > const &gm, bool temp_slice, int lev) |
Gather field values and push particles. More... | |
void | DepositNeutralizingBackground (Fields &fields, const MultiLaser &multi_laser, int which_slice, amrex::Vector< amrex::Geometry > const &gm, int const lev) |
Loop over plasma species and deposit their neutralizing background, if needed. More... | |
void | DoFieldIonization (const int lev, const amrex::Geometry &geom, const Fields &fields) |
bool | IonizationOn () const |
bool | AnySpeciesNeutralizeBackground () const |
whether any plasma species uses a neutralizing background, e.g. no ion motion More... | |
void | TileSort (amrex::Box bx, amrex::Geometry geom) |
sort particles of all containers by tile logically, and store results in m_all_bins More... | |
const amrex::Vector< std::string > & | GetNames () const |
int | GetNPlasmas () const |
void | ReorderParticles (const int islice) |
void | TagByLevel (const int current_N_level, amrex::Vector< amrex::Geometry > const &geom3D, const bool to_prev=false) |
Store the finest level of every plasma particle in the cpu() attribute. More... | |
void | InSituComputeDiags (int step, int islice, int max_step, amrex::Real physical_time, amrex::Real max_time) |
void | InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry &geom, int max_step, amrex::Real max_time) |
Public Attributes | |
int | m_sort_bin_size {32} |
amrex::Vector< PlasmaParticleContainer > | m_all_plasmas |
int | m_nplasmas = 0 |
amrex::Vector< PlasmaBins > | m_all_bins |
amrex::Vector< std::string > | m_names {"no_plasma"} |
Private Attributes | |
amrex::Real | m_adaptive_density = 0. |
MultiPlasma::MultiPlasma | ( | ) |
Constructor
|
inline |
Destructor
void MultiPlasma::AdvanceParticles | ( | const Fields & | fields, |
const MultiLaser & | multi_laser, | ||
amrex::Vector< amrex::Geometry > const & | gm, | ||
bool | temp_slice, | ||
int | lev | ||
) |
Gather field values and push particles.
[in,out] | fields | the general field class, modified by this function |
[in] | multi_laser | Lasers that affects the plasma during the deposition |
[in] | gm | Geometry of the simulation, to get the cell size etc. |
[in] | temp_slice | if true, the temporary data (x_temp, ...) will be used |
[in] | lev | MR level |
bool MultiPlasma::AnySpeciesNeutralizeBackground | ( | ) | const |
whether any plasma species uses a neutralizing background, e.g. no ion motion
void MultiPlasma::DepositCurrent | ( | Fields & | fields, |
const MultiLaser & | multi_laser, | ||
int | which_slice, | ||
bool | deposit_jx_jy, | ||
bool | deposit_jz, | ||
bool | deposit_rho, | ||
bool | deposit_chi, | ||
bool | deposit_rhomjz, | ||
amrex::Vector< amrex::Geometry > const & | gm, | ||
int const | lev | ||
) |
Loop over plasma species and depose their currents into the current 2D slice in fields
[in,out] | fields | the general field class, modified by this function |
[in] | multi_laser | Lasers that affects the plasma during the deposition |
[in] | which_slice | defines if this or the next slice is handled |
[in] | deposit_jx_jy | if true, deposit to jx and jy |
[in] | deposit_jz | if true, deposit to jz |
[in] | deposit_rho | if true, deposit to rho |
[in] | deposit_chi | if true, deposit chi |
[in] | deposit_rhomjz | if true, deposit rhomjz |
[in] | gm | Geometry of the simulation, to get the cell size etc. |
[in] | lev | MR level |
void MultiPlasma::DepositNeutralizingBackground | ( | Fields & | fields, |
const MultiLaser & | multi_laser, | ||
int | which_slice, | ||
amrex::Vector< amrex::Geometry > const & | gm, | ||
int const | lev | ||
) |
Loop over plasma species and deposit their neutralizing background, if needed.
[in,out] | fields | the general field class, modified by this function |
[in] | multi_laser | that affects the plasma during the deposition |
[in] | which_slice | slice in which the densities are deposited |
[in] | gm | Geometry of the simulation, to get the cell size etc. |
[in] | lev | MR level |
void MultiPlasma::DoFieldIonization | ( | const int | lev, |
const amrex::Geometry & | geom, | ||
const Fields & | fields | ||
) |
Calculates Ionization Probability and makes new Plasma Particles
[in] | lev | MR level |
[in] | geom | Geometry of the simulation, to get the cell size |
[in] | fields | the general field class |
void MultiPlasma::ExplicitDeposition | ( | Fields & | fields, |
const MultiLaser & | multi_laser, | ||
amrex::Vector< amrex::Geometry > const & | gm, | ||
int const | lev | ||
) |
Loop over plasma species and depose Sx and Sy into the current 2D slice in fields
[in,out] | fields | the general field class, modified by this function |
[in] | multi_laser | Lasers that affects the plasma during the deposition |
[in] | gm | Geometry of the simulation, to get the cell size etc. |
[in] | lev | MR level |
|
inline |
returns a Vector of names of the plasmas
|
inline |
returns number of plasma species
void MultiPlasma::InitData | ( | amrex::Vector< amrex::BoxArray > | slice_ba, |
amrex::Vector< amrex::DistributionMapping > | slice_dm, | ||
amrex::Vector< amrex::Geometry > | slice_gm, | ||
amrex::Vector< amrex::Geometry > | gm | ||
) |
Loop over plasma species and initialize them.
[in] | slice_ba | slice boxarray, on which plasma particles are defined |
[in] | slice_dm | DistributionMapping of the transverse slice domain |
[in] | slice_gm | slice geometry |
[in] | gm | Geometry of the simulation, to get the cell size |
void MultiPlasma::InSituComputeDiags | ( | int | step, |
int | islice, | ||
int | max_step, | ||
amrex::Real | physical_time, | ||
amrex::Real | max_time | ||
) |
Compute reduced plasma diagnostics of current slice, store in member variable.
[in] | step | time step of simulation |
[in] | islice | current slice, on which diags are computed. |
[in] | max_step | maximum time step of simulation |
[in] | physical_time | physical time at the given step |
[in] | max_time | maximum time of simulation |
void MultiPlasma::InSituWriteToFile | ( | int | step, |
amrex::Real | time, | ||
const amrex::Geometry & | geom, | ||
int | max_step, | ||
amrex::Real | max_time | ||
) |
Write reduced beam diagnostics to file
[in] | step | time step of simulation |
[in] | time | physical time at the given step |
[in] | geom | Simulation geometry |
[in] | max_step | maximum time step of simulation |
[in] | max_time | maximum time of simulation |
bool MultiPlasma::IonizationOn | ( | ) | const |
amrex::Real MultiPlasma::maxDensity | ( | amrex::Real | z | ) |
Return max density, to compute the adaptive time step.
the max is taken across species AND include m_adaptive_density, giving a way to specify a density to the adaptive time step calculator even with no plasma species.
void MultiPlasma::ReorderParticles | ( | const int | islice | ) |
Reorder particles to speed-up current deposition
[in] | islice | zeta slice index |
void MultiPlasma::TagByLevel | ( | const int | current_N_level, |
amrex::Vector< amrex::Geometry > const & | geom3D, | ||
const bool | to_prev = false |
||
) |
Store the finest level of every plasma particle 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] | to_prev | if particles should be tagged to x_prev and y_prev |
void MultiPlasma::TileSort | ( | amrex::Box | bx, |
amrex::Geometry | geom | ||
) |
sort particles of all containers by tile logically, and store results in m_all_bins
[in] | bx | transverse box on which the particles are sorted |
[in] | geom | Geometry object |
|
private |
Background (hypothetical) density, used to compute the adaptive time step
amrex::Vector<PlasmaBins> MultiPlasma::m_all_bins |
Logical tile bins for all plasma containers
amrex::Vector<PlasmaParticleContainer> MultiPlasma::m_all_plasmas |
contains all plasma containers
amrex::Vector<std::string> MultiPlasma::m_names {"no_plasma"} |
names of all plasma containers
int MultiPlasma::m_nplasmas = 0 |
number of plasma containers
int MultiPlasma::m_sort_bin_size {32} |
Tile size to sort plasma particles