Hipace
|
Singleton class, that intialize, runs and finalizes the simulation. More...
#include <Hipace.H>
Public Member Functions | |
Hipace () | |
void | InitData () |
void | Evolve () |
void | MakeGeometry () |
void | WriteDiagnostics (int output_step, const OpenPMDWriterCallType call_type) |
Dump simulation data to file. More... | |
PhysConst | get_phys_const () |
Return a copy of member struct for physical constants. More... | |
void | SolveOneSlice (int islice, int step) |
Full evolve on 1 slice. More... | |
void | InitializeSxSyWithBeam (const int lev) |
Initialize Sx and Sy with the beam contributions. More... | |
void | ExplicitMGSolveBxBy (const int lev, const int which_slice) |
Knowing the sources Sx, Sy and chi, apply MG to solve for Bx, By. More... | |
void | ResetAllQuantities () |
Reset plasma and field slice quantities to initial value. More... | |
void | ResetLaser () |
reset all laser slices to 0 More... | |
void | doCoulombCollision () |
does Coulomb collisions between plasmas and beams More... | |
![]() | |
Hipace_early_init (Hipace *instance) | |
Static Public Member Functions | |
static Hipace & | GetInstance () |
static bool | HeadRank () |
Returns true on the head rank, otherwise false. More... | |
static std::string | Version () |
Static Public Attributes | |
static Hipace * | m_instance = nullptr |
static bool | m_normalized_units = false |
static int | m_numprocs = 0 |
static int | m_max_step = 0 |
static amrex::Real | m_max_time = std::numeric_limits<amrex::Real>::infinity() |
static amrex::Real | m_physical_time = 0.0 |
static amrex::Real | m_initial_time = 0.0 |
static int | m_verbose = 0 |
static amrex::Real | m_predcorr_B_error_tolerance = 4e-2 |
static int | m_predcorr_max_iterations = 30 |
static amrex::Real | m_predcorr_B_mixing_factor = 0.05 |
static bool | m_do_beam_jx_jy_deposition = true |
static bool | m_do_beam_jz_minus_rho = false |
static bool | m_deposit_rho = false |
static bool | m_deposit_rho_individual = false |
static bool | m_interpolate_neutralizing_background = false |
static bool | m_do_tiling = true |
static bool | m_explicit = true |
static amrex::Real | m_MG_tolerance_rel = 1.e-4 |
static amrex::Real | m_MG_tolerance_abs = std::numeric_limits<amrex::Real>::min() |
static int | m_MG_verbose = 0 |
static bool | m_use_amrex_mlmg = false |
static bool | m_use_laser = false |
static amrex::Real | m_background_density_SI = 0. |
static int | m_ncollisions = 0 |
![]() | |
static int | m_depos_order_xy = 2 |
static int | m_depos_order_z = 0 |
static int | m_depos_derivative_type = 2 |
static bool | m_outer_depos_loop = false |
Private Member Functions | |
void | InitDiagnostics (const int step) |
void | FillFieldDiagnostics (const int lev, int islice) |
void | FillBeamDiagnostics (const int step) |
void | WriteDiagnostics (const int step) |
void | FlushDiagnostics () |
amrex::Vector< std::string > & | getDiagBeamNames () |
get diagnostics Component names of Fields to output More... | |
void | PredictorCorrectorLoopToSolveBxBy (const int islice, const int current_N_level, const int step) |
Predictor-corrector loop to calculate Bx and By. More... | |
Private Attributes | |
amrex::Vector< std::unique_ptr< hpmg::MultiGrid > > | m_hpmg |
Diagnostic | m_diags |
std::vector< std::string > | m_collision_names |
amrex::Vector< CoulombCollision > | m_all_collisions |
Singleton class, that intialize, runs and finalizes the simulation.
Hipace::Hipace | ( | ) |
Ctor: read general input parameters, call constructors of main member variables and initialize longitudinal and transverse MPI communicators
Initialize the collision objects
void Hipace::doCoulombCollision | ( | ) |
does Coulomb collisions between plasmas and beams
void Hipace::Evolve | ( | ) |
Run the simulation. This function contains the loop over time steps
Knowing the sources Sx, Sy and chi, apply MG to solve for Bx, By.
[lev] | MR level | |
[in] | which_slice | defines if this or the salame slice is handled |
|
private |
|
private |
|
inline |
Return a copy of member struct for physical constants.
|
inlineprivate |
get diagnostics Component names of Fields to output
|
static |
Get singleton instance
|
inlinestatic |
Returns true on the head rank, otherwise false.
void Hipace::InitData | ( | ) |
Init AmrCore and allocate beam and plasma containers
|
private |
void Hipace::InitializeSxSyWithBeam | ( | const int | lev | ) |
Initialize Sx and Sy with the beam contributions.
[lev] | MR level |
void Hipace::MakeGeometry | ( | ) |
Make Geometry, DistributionMapping and BoxArray for all MR levels
|
private |
Predictor-corrector loop to calculate Bx and By.
This modifies component Bx and By, of slice 1 in m_fields.m_slices as well as the plasma particle force terms.
[in] | islice | longitudinal slice |
[in] | current_N_level | number of MR levels active on the current slice |
[in] | step | current time step |
void Hipace::ResetAllQuantities | ( | ) |
Reset plasma and field slice quantities to initial value.
Typically done at the beginning of each iteration.
void Hipace::ResetLaser | ( | ) |
reset all laser slices to 0
Full evolve on 1 slice.
[in] | islice | slice number |
[in] | step | current time step |
|
static |
Version of the HiPACE executable
|
private |
void Hipace::WriteDiagnostics | ( | int | output_step, |
const OpenPMDWriterCallType | call_type | ||
) |
Dump simulation data to file.
[in] | output_step | current iteration |
[in] | call_type | whether the beams or the fields should be written to file |
amrex::Vector<amrex::BoxArray> Hipace::m_3D_ba |
3D BoxArray, vector over MR levels. One box per rank
amrex::Vector<amrex::DistributionMapping> Hipace::m_3D_dm |
3D DistributionMapping. Does not represent the parallelization pipeline correctly
amrex::Vector<amrex::Geometry> Hipace::m_3D_geom |
3D Geometry, vector over MR levels
AdaptiveTimeStep Hipace::m_adaptive_time_step |
Adaptive time step instance
|
private |
Vector of binary collisions
|
inlinestatic |
Background plasma density in SI, used to compute collisions, ionization, or radiation reaction in normalized units
|
private |
User-input names of the binary collisions to be used
How many slices of beam particles can be received in advance
How many slices of beam particles can be stored before being sent
bool Hipace::m_comms_buffer_on_gpu = false |
Whether MPI communication buffers should be allocated in device memory
|
inlinestatic |
Whether to deposit rho (plasma) for diagnostics
|
inlinestatic |
Whether to deposit rho for every individual plasma for diagnostics
|
private |
Diagnostics
|
inlinestatic |
Whether the beams deposit Jx and Jy
|
inlinestatic |
Whether the jz-c*rho contribution of the beam is computed and used. If not, jz-c*rho=0 is assumed
|
inlinestatic |
Whether to use tiling for particle operations
amrex::Real Hipace::m_dt = 0.0 |
Time step for the beam evolution
|
inlinestatic |
Whether the explicit field solver is used
Fields Hipace::m_fields |
All field data (3D array, slices) and field methods
GridCurrent Hipace::m_grid_current |
GridCurrent instance
bool Hipace::m_has_last_step = false |
|
private |
hpmg solver for the explicit Bx and by solver
|
inlinestatic |
Physical time at the beginning of the simulation
|
inlinestatic |
Pointer to current (and only) instance of class Hipace
|
inlinestatic |
Whether to interpolate the neutralizing background to MR levels 1 and 2 instead of depositing it
|
inlinestatic |
Number of time iterations
|
inlinestatic |
Maximum simulation time
|
inlinestatic |
Absolute tolerance for the multigrid solver, when using the explicit solver
|
inlinestatic |
Relative tolerance for the multigrid solver, when using the explicit solver
|
inlinestatic |
Level of verbosity for the MG solver
MultiBeam Hipace::m_multi_beam |
Contains all beam species
MultiBuffer Hipace::m_multi_buffer |
MultiLaser Hipace::m_multi_laser |
Laser instance (soon to be multi laser container)
MultiPlasma Hipace::m_multi_plasma |
Contains all plasma species
|
inlinestatic |
Number of binary collisions
|
inlinestatic |
Whether to use normalized units
|
inlinestatic |
Number of processors in the longitudinal z direction
|
inlinestatic |
Physical time of the simulation. At the end of the time step, it is the physical time at which the fields have been calculated. The beam is one step ahead.
amrex::Real Hipace::m_predcorr_avg_B_error = 0. |
Average transverse B field error in the predictor corrector loop
amrex::Real Hipace::m_predcorr_avg_iterations = 0. |
Average number of iterations in the predictor corrector loop
|
inlinestatic |
Relative transverse B field error tolerance in the predictor corrector loop
|
inlinestatic |
Mixing factor between the transverse B field iterations in the predictor corrector loop
|
inlinestatic |
Maximum number of iterations in the predictor corrector loop
bool Hipace::m_salame_do_advance = true |
if the SALAME-only field should be computed exactly with plasma particles
int Hipace::m_salame_last_slice = -1 |
the slice index of the previous slice with SALAME
int Hipace::m_salame_n_iter = 3 |
the number of SALAME iterations to be done
bool Hipace::m_salame_overloaded = false |
if the SALAME beam was overloaded in the last slice
amrex::Parser Hipace::m_salame_parser |
Parser for m_salame_target_func
amrex::ParserExecutor<3> Hipace::m_salame_target_func |
Function to get the target Ez field for SALAME
amrex::Real Hipace::m_salame_zeta_initial = 0 |
the slice index of the previous slice with SALAME
amrex::Vector<amrex::BoxArray> Hipace::m_slice_ba |
xy slice BoxArray, vector over MR levels. Contains only one box
amrex::Vector<amrex::DistributionMapping> Hipace::m_slice_dm |
xy slice DistributionMapping, vector over MR levels
amrex::Vector<amrex::Geometry> Hipace::m_slice_geom |
xy slice Geometry, vector over MR levels
|
inlinestatic |
Whether to use amrex MLMG solver
|
inlinestatic |
Whether the simulation uses a laser pulse
|
inlinestatic |
Level of verbosity