|
WarpX
|
#include <WarpX.H>
Public Member Functions | |
| WarpX () | |
| ~WarpX () | |
| int | Verbose () const |
| void | InitData () |
| void | Evolve (int numsteps=-1) |
| MultiParticleContainer & | GetPartContainer () |
| ParticleBoundaryBuffer & | GetParticleBoundaryBuffer () |
| std::array< const amrex::MultiFab *const, 3 > | get_array_Bfield_aux (const int lev) const |
| std::array< const amrex::MultiFab *const, 3 > | get_array_Efield_aux (const int lev) const |
| amrex::MultiFab * | get_pointer_Efield_aux (int lev, int direction) const |
| amrex::MultiFab * | get_pointer_Bfield_aux (int lev, int direction) const |
| amrex::MultiFab * | get_pointer_Efield_fp (int lev, int direction) const |
| amrex::MultiFab * | get_pointer_Bfield_fp (int lev, int direction) const |
| amrex::MultiFab * | get_pointer_current_fp (int lev, int direction) const |
| amrex::MultiFab * | get_pointer_rho_fp (int lev) const |
| amrex::MultiFab * | get_pointer_F_fp (int lev) const |
| amrex::MultiFab * | get_pointer_G_fp (int lev) const |
| amrex::MultiFab * | get_pointer_phi_fp (int lev) const |
| amrex::MultiFab * | get_pointer_Efield_cp (int lev, int direction) const |
| amrex::MultiFab * | get_pointer_Bfield_cp (int lev, int direction) const |
| amrex::MultiFab * | get_pointer_current_cp (int lev, int direction) const |
| amrex::MultiFab * | get_pointer_rho_cp (int lev) const |
| amrex::MultiFab * | get_pointer_F_cp (int lev) const |
| amrex::MultiFab * | get_pointer_G_cp (int lev) const |
| const amrex::MultiFab & | getcurrent (int lev, int direction) |
| const amrex::MultiFab & | getEfield (int lev, int direction) |
| const amrex::MultiFab & | getBfield (int lev, int direction) |
| const amrex::MultiFab & | getcurrent_cp (int lev, int direction) |
| const amrex::MultiFab & | getEfield_cp (int lev, int direction) |
| const amrex::MultiFab & | getBfield_cp (int lev, int direction) |
| const amrex::MultiFab & | getrho_cp (int lev) |
| const amrex::MultiFab & | getcurrent_fp (int lev, int direction) |
| const amrex::MultiFab & | getEfield_fp (int lev, int direction) |
| const amrex::MultiFab & | getBfield_fp (int lev, int direction) |
| const amrex::MultiFab & | getrho_fp (int lev) |
| const amrex::MultiFab & | getphi_fp (int lev) |
| const amrex::MultiFab & | getF_fp (int lev) |
| const amrex::MultiFab & | getG_fp (int lev) |
| const amrex::MultiFab & | getEfield_avg_fp (int lev, int direction) |
| const amrex::MultiFab & | getBfield_avg_fp (int lev, int direction) |
| const amrex::MultiFab & | getEfield_avg_cp (int lev, int direction) |
| const amrex::MultiFab & | getBfield_avg_cp (int lev, int direction) |
| bool | DoPML () const |
| std::vector< bool > | getPMLdirections () const |
| void | setLoadBalanceEfficiency (const int lev, const amrex::Real efficiency) |
| amrex::Real | getLoadBalanceEfficiency (const int lev) |
| void | applyMirrors (amrex::Real time) |
| void | ComputeDt () |
| void | PrintDtDxDyDz () |
| void | ComputeMaxStep () |
| Compute the last timestep of the simulation and make max_step and stop_time self-consistent. Calls computeMaxStepBoostAccelerator() if required. More... | |
| void | computeMaxStepBoostAccelerator (const amrex::Geometry &geom) |
| int | MoveWindow (const int step, bool move_j) |
| Move the moving window. More... | |
| void | ShiftGalileanBoundary () |
| This function shifts the boundary of the grid by 'm_v_galilean*dt'. In doding so, only positions attributes are changed while fields remain unchanged. More... | |
| void | UpdatePlasmaInjectionPosition (amrex::Real dt) |
| void | ResetProbDomain (const amrex::RealBox &rb) |
| void | EvolveE (amrex::Real dt) |
| void | EvolveE (int lev, amrex::Real dt) |
| void | EvolveB (amrex::Real dt, DtType dt_type) |
| void | EvolveB (int lev, amrex::Real dt, DtType dt_type) |
| void | EvolveF (amrex::Real dt, DtType dt_type) |
| void | EvolveF (int lev, amrex::Real dt, DtType dt_type) |
| void | EvolveG (amrex::Real dt, DtType dt_type) |
| void | EvolveG (int lev, amrex::Real dt, DtType dt_type) |
| void | EvolveB (int lev, PatchType patch_type, amrex::Real dt, DtType dt_type) |
| void | EvolveE (int lev, PatchType patch_type, amrex::Real dt) |
| void | EvolveF (int lev, PatchType patch_type, amrex::Real dt, DtType dt_type) |
| void | EvolveG (int lev, PatchType patch_type, amrex::Real dt, DtType dt_type) |
| void | MacroscopicEvolveE (amrex::Real dt) |
| void | MacroscopicEvolveE (int lev, amrex::Real dt) |
| void | MacroscopicEvolveE (int lev, PatchType patch_type, amrex::Real dt) |
| void | Hybrid_QED_Push (amrex::Vector< amrex::Real > dt) |
| apply QED correction on electric field More... | |
| void | Hybrid_QED_Push (int lev, amrex::Real dt) |
| apply QED correction on electric field for level lev More... | |
| void | Hybrid_QED_Push (int lev, PatchType patch_type, amrex::Real dt) |
| apply QED correction on electric field for level lev and patch type patch_type More... | |
| void | LoadBalance () |
perform load balance; compute and communicate new amrex::DistributionMapping More... | |
| void | ResetCosts () |
| resets costs to zero More... | |
| IntervalsParser | get_load_balance_intervals () const |
| returns the load balance interval More... | |
| void | DampFieldsInGuards (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Bfield) |
| Private function for spectral solver Applies a damping factor in the guards cells that extend beyond the extent of the domain, reducing fluctuations that can appear in parallel simulations. This will be called when FieldBoundaryType is set to damped. More... | |
| void | ApplyInverseVolumeScalingToCurrentDensity (amrex::MultiFab *Jx, amrex::MultiFab *Jy, amrex::MultiFab *Jz, int lev) |
| void | ApplyInverseVolumeScalingToChargeDensity (amrex::MultiFab *Rho, int lev) |
| void | ApplyEfieldBoundary (const int lev, PatchType patch_type) |
| void | ApplyBfieldBoundary (const int lev, PatchType patch_type, DtType dt_type) |
| void | DampPML () |
| void | DampPML (int lev) |
| void | DampPML (int lev, PatchType patch_type) |
| void | DampJPML () |
| void | DampJPML (int lev) |
| void | DampJPML (int lev, PatchType patch_type) |
| void | CopyJPML () |
| Copy the current J from the regular grid to the PML. More... | |
| bool | isAnyBoundaryPML () |
| void | NodalSyncPML () |
| Synchronize the nodal points of the PML MultiFabs. More... | |
| void | NodalSyncPML (int lev) |
| Synchronize the nodal points of the PML MultiFabs for given MR level. More... | |
| void | NodalSyncPML (int lev, PatchType patch_type) |
| Synchronize the nodal points of the PML MultiFabs for given MR level and patch. More... | |
| PML * | GetPML (int lev) |
| void | doFieldIonization () |
| void | doFieldIonization (int lev) |
| void | doQEDEvents () |
| void | doQEDEvents (int lev) |
| void | PushParticlesandDepose (int lev, amrex::Real cur_time, DtType a_dt_type=DtType::Full, bool skip_current=false) |
| void | PushParticlesandDepose (amrex::Real cur_time, bool skip_current=false) |
| void | UpdateAuxilaryData () |
| void | UpdateAuxilaryDataStagToNodal () |
| void | UpdateAuxilaryDataSameType () |
| void | UpdateCurrentNodalToStag (amrex::MultiFab &dst, amrex::MultiFab const &src) |
This function is called if warpx.do_current_centering = 1 and it centers the currents from a nodal grid to a staggered grid (Yee) using finite-order interpolation based on the Fornberg coefficients. More... | |
| void | FillBoundaryB (amrex::IntVect ng) |
| void | FillBoundaryE (amrex::IntVect ng) |
| void | FillBoundaryB_avg (amrex::IntVect ng) |
| void | FillBoundaryE_avg (amrex::IntVect ng) |
| void | FillBoundaryF (amrex::IntVect ng) |
| void | FillBoundaryG (amrex::IntVect ng) |
| void | FillBoundaryAux (amrex::IntVect ng) |
| void | FillBoundaryE (int lev, amrex::IntVect ng) |
| void | FillBoundaryB (int lev, amrex::IntVect ng) |
| void | FillBoundaryE_avg (int lev, amrex::IntVect ng) |
| void | FillBoundaryB_avg (int lev, amrex::IntVect ng) |
| void | FillBoundaryF (int lev, amrex::IntVect ng) |
| void | FillBoundaryG (int lev, amrex::IntVect ng) |
| void | FillBoundaryAux (int lev, amrex::IntVect ng) |
| void | SyncCurrent () |
| void | SyncRho () |
| amrex::Vector< int > | getnsubsteps () const |
| int | getnsubsteps (int lev) const |
| amrex::Vector< int > | getistep () const |
| int | getistep (int lev) const |
| void | setistep (int lev, int ii) |
| amrex::Vector< amrex::Real > | gett_old () const |
| amrex::Real | gett_old (int lev) const |
| amrex::Vector< amrex::Real > | gett_new () const |
| amrex::Real | gett_new (int lev) const |
| void | sett_new (int lev, amrex::Real time) |
| amrex::Vector< amrex::Real > | getdt () const |
| amrex::Real | getdt (int lev) const |
| int | getdo_moving_window () const |
| amrex::Real | getmoving_window_x () const |
| amrex::Real | getcurrent_injection_position () const |
| bool | getis_synchronized () const |
| int | maxStep () const |
| amrex::Real | stopTime () const |
| void | AverageAndPackFields (amrex::Vector< std::string > &varnames, amrex::Vector< amrex::MultiFab > &mf_avg, const amrex::IntVect ngrow) const |
| void | prepareFields (int const step, amrex::Vector< std::string > &varnames, amrex::Vector< amrex::MultiFab > &mf_avg, amrex::Vector< const amrex::MultiFab *> &output_mf, amrex::Vector< amrex::Geometry > &output_geom) const |
| std::array< amrex::Real, 3 > | LowerCornerWithGalilean (const amrex::Box &bx, const amrex::Array< amrex::Real, 3 > &v_galilean, int lev) |
| amrex::RealBox | getSliceRealBox () const |
| void | ComputeDivE (amrex::MultiFab &divE, const int lev) |
| const amrex::IntVect | getngE () const |
| const amrex::IntVect | getngF () const |
| const amrex::IntVect | getngUpdateAux () const |
| const amrex::IntVect | get_ng_depos_J () const |
| const amrex::IntVect | get_ng_depos_rho () const |
| const amrex::IntVect | get_numprocs () const |
| void | ComputeSpaceChargeField (bool const reset_fields) |
| void | AddSpaceChargeField (WarpXParticleContainer &pc) |
| void | AddSpaceChargeFieldLabFrame () |
| void | computePhi (const amrex::Vector< std::unique_ptr< amrex::MultiFab > > &rho, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &phi, std::array< amrex::Real, 3 > const beta={{0, 0, 0}}, amrex::Real const required_precision=amrex::Real(1.e-11), const int max_iters=200, const int verbosity=2) const |
| void | computePhiRZ (const amrex::Vector< std::unique_ptr< amrex::MultiFab > > &rho, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &phi, std::array< amrex::Real, 3 > const beta, amrex::Real const required_precision, int const max_iters, int const verbosity) const |
| void | computePhiCartesian (const amrex::Vector< std::unique_ptr< amrex::MultiFab > > &rho, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &phi, std::array< amrex::Real, 3 > const beta, amrex::Real const required_precision, int const max_iters, int const verbosity) const |
| void | setPhiBC (amrex::Vector< std::unique_ptr< amrex::MultiFab > > &phi, std::array< bool, AMREX_SPACEDIM > dirichlet_flag, amrex::Array< amrex::Real, AMREX_SPACEDIM > phi_bc_values_lo, amrex::Array< amrex::Real, AMREX_SPACEDIM > phi_bc_values_hi) const |
| void | getPhiBC (const int idim, amrex::Real &pot_lo, amrex::Real &pot_hi) const |
| void | computeE (amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > &E, const amrex::Vector< std::unique_ptr< amrex::MultiFab > > &phi, std::array< amrex::Real, 3 > const beta={{0, 0, 0}}) const |
| void | computeB (amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > &B, const amrex::Vector< std::unique_ptr< amrex::MultiFab > > &phi, std::array< amrex::Real, 3 > const beta={{0, 0, 0}}) const |
| void | InitializeExternalFieldsOnGridUsingParser (amrex::MultiFab *mfx, amrex::MultiFab *mfy, amrex::MultiFab *mfz, amrex::ParserExecutor< 3 > const &xfield_parser, amrex::ParserExecutor< 3 > const &yfield_parser, amrex::ParserExecutor< 3 > const &zfield_parser, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &geom_data, const int lev) |
| This function initializes the E and B fields on each level using the parser and the user-defined function for the external fields. The subroutine will parse the x_/y_z_external_grid_function and then, the field multifab is initialized based on the (x,y,z) position on the staggered yee-grid or cell-centered grid, in the interior cells and guard cells. More... | |
| void | ComputeCostsHeuristic (amrex::Vector< std::unique_ptr< amrex::LayoutData< amrex::Real > > > &costs) |
adds particle and cell contributions in cells to compute heuristic cost in each box on each level, and records in costs More... | |
| void | ApplyFilterandSumBoundaryRho (int lev, int glev, amrex::MultiFab &rho, int icomp, int ncomp) |
| void | InitEB () |
| void | ComputeEdgeLengths () |
| Compute the length of the mesh edges. Here the length is a value in [0, 1]. An edge of length 0 is fully covered. More... | |
| void | ComputeFaceAreas () |
| Compute the area of the mesh faces. Here the area is a value in [0, 1]. An edge of area 0 is fully covered. More... | |
| void | ScaleEdges () |
| Scale the edges lengths by the mesh width to obtain the real lengths. More... | |
| void | ScaleAreas () |
| Scale the edges areas by the mesh width to obtain the real areas. More... | |
| void | MarkCells () |
| Initialize information for cell extensions. The flags convention for m_flag_info_face is as follows. More... | |
| void | ComputeDistanceToEB () |
| Compute the level set function used for particle-boundary interaction. More... | |
| amrex::Array1D< int, 0, 2 > | CountExtFaces () |
| Auxiliary function to count the amount of faces which still need to be extended. More... | |
| void | ComputeFaceExtensions () |
| Main function computing the cell extension. Where possible it computes one-way extensions and, when this is not possible, it does eight-ways extensions. More... | |
| void | InitBorrowing () |
| Initialize the memory for the FaceInfoBoxes. More... | |
| void | ShrinkBorrowing () |
| Shrink the vectors in the FaceInfoBoxes. More... | |
| void | ComputeOneWayExtensions () |
| Do the one-way extension. More... | |
| void | ComputeEightWaysExtensions () |
| Do the eight-ways extension. More... | |
| SpectralSolverRZ & | get_spectral_solver_fp (int lev) |
Static Public Member Functions | |
| static WarpX & | GetInstance () |
| static void | ResetInstance () |
| static std::string | Version () |
| Version of WarpX executable. More... | |
| static std::string | PicsarVersion () |
| Version of PICSAR dependency. More... | |
| static void | shiftMF (amrex::MultiFab &mf, const amrex::Geometry &geom, int num_shift, int dir, amrex::Real external_field=0.0, bool useparser=false, amrex::ParserExecutor< 3 > const &field_parser={}) |
| static void | GotoNextLine (std::istream &is) |
| static amrex::LayoutData< amrex::Real > * | getCosts (int lev) |
| static std::array< amrex::Real, 3 > | CellSize (int lev) |
| static amrex::RealBox | getRealBox (const amrex::Box &bx, int lev) |
| static std::array< amrex::Real, 3 > | LowerCorner (const amrex::Box &bx, std::array< amrex::Real, 3 > galilean_shift, int lev) |
| static std::array< amrex::Real, 3 > | UpperCorner (const amrex::Box &bx, int lev) |
| static amrex::IntVect | RefRatio (int lev) |
| static const amrex::iMultiFab * | CurrentBufferMasks (int lev) |
| static const amrex::iMultiFab * | GatherBufferMasks (int lev) |
| static int | moving_window_active (int const step) |
| static void | ComputeDivB (amrex::MultiFab &divB, int const dcomp, const std::array< const amrex::MultiFab *const, 3 > &B, const std::array< amrex::Real, 3 > &dx) |
| static void | ComputeDivB (amrex::MultiFab &divB, int const dcomp, const std::array< const amrex::MultiFab *const, 3 > &B, const std::array< amrex::Real, 3 > &dx, amrex::IntVect const ngrow) |
Public Attributes | |
| std::unique_ptr< amrex::Parser > | Bxfield_parser |
| std::unique_ptr< amrex::Parser > | Byfield_parser |
| std::unique_ptr< amrex::Parser > | Bzfield_parser |
| std::unique_ptr< amrex::Parser > | Exfield_parser |
| std::unique_ptr< amrex::Parser > | Eyfield_parser |
| std::unique_ptr< amrex::Parser > | Ezfield_parser |
| bool | current_correction = false |
| bool | update_with_rho = false |
| BilinearFilter | bilinear_filter |
| amrex::Vector< std::unique_ptr< NCIGodfreyFilter > > | nci_godfrey_filter_exeybz |
| amrex::Vector< std::unique_ptr< NCIGodfreyFilter > > | nci_godfrey_filter_bxbyez |
| amrex::Real | time_of_last_gal_shift = 0 |
| amrex::Array< amrex::Real, 3 > | m_v_galilean = {{0}} |
| amrex::Array< amrex::Real, 3 > | m_galilean_shift = {{0}} |
| amrex::Array< amrex::Real, 3 > | m_v_comoving = {{0.}} |
| amrex::Vector< amrex::Real > | mirror_z |
| amrex::Vector< amrex::Real > | mirror_z_width |
| amrex::Vector< int > | mirror_z_npoints |
| MultiReducedDiags * | reduced_diags |
| object with all reduced diagnotics, similar to MultiParticleContainer for species. More... | |
| ElectrostaticSolver::BoundaryValueHandler | field_boundary_value_handler |
| amrex::Gpu::DeviceVector< amrex::Real > | device_field_centering_stencil_coeffs_x |
| amrex::Gpu::DeviceVector< amrex::Real > | device_field_centering_stencil_coeffs_y |
| amrex::Gpu::DeviceVector< amrex::Real > | device_field_centering_stencil_coeffs_z |
| amrex::Gpu::DeviceVector< amrex::Real > | device_current_centering_stencil_coeffs_x |
| amrex::Gpu::DeviceVector< amrex::Real > | device_current_centering_stencil_coeffs_y |
| amrex::Gpu::DeviceVector< amrex::Real > | device_current_centering_stencil_coeffs_z |
Static Public Attributes | |
| static std::string | authors = "" |
| Author of an input file / simulation setup. More... | |
| static amrex::Vector< amrex::Real > | E_external_grid |
| static amrex::Vector< amrex::Real > | B_external_grid |
| static std::string | B_ext_grid_s = "default" |
| static std::string | E_ext_grid_s = "default" |
| static std::string | str_Bx_ext_grid_function |
| static std::string | str_By_ext_grid_function |
| static std::string | str_Bz_ext_grid_function |
| static std::string | str_Ex_ext_grid_function |
| static std::string | str_Ey_ext_grid_function |
| static std::string | str_Ez_ext_grid_function |
| static long | current_deposition_algo |
| static long | charge_deposition_algo |
| static long | field_gathering_algo |
| static long | particle_pusher_algo |
| static int | maxwell_solver_id |
| static long | load_balance_costs_update_algo |
| static int | em_solver_medium |
| static int | macroscopic_solver_algo |
| static amrex::Vector< int > | field_boundary_lo |
| static amrex::Vector< int > | field_boundary_hi |
| static amrex::Vector< ParticleBoundaryType > | particle_boundary_lo |
| static amrex::Vector< ParticleBoundaryType > | particle_boundary_hi |
| static bool | do_current_centering = false |
| static amrex::IntVect | fill_guards = amrex::IntVect(0) |
| static bool | do_dive_cleaning = 0 |
| static bool | do_divb_cleaning = 0 |
| static int | nox = 0 |
| static int | noy = 0 |
| static int | noz = 0 |
| static int | field_centering_nox = 2 |
| static int | field_centering_noy = 2 |
| static int | field_centering_noz = 2 |
| static int | current_centering_nox = 2 |
| static int | current_centering_noy = 2 |
| static int | current_centering_noz = 2 |
| static int | n_rz_azimuthal_modes = 1 |
| static int | ncomps = 1 |
| static bool | use_fdtd_nci_corr = false |
| static bool | galerkin_interpolation = true |
| static bool | use_filter = true |
| static bool | use_kspace_filter = true |
| static bool | use_filter_compensation = false |
| static bool | serialize_ics = false |
| static bool | do_back_transformed_diagnostics = false |
| static std::string | lab_data_directory = "lab_frame_data" |
| static int | num_snapshots_lab = std::numeric_limits<int>::lowest() |
| static amrex::Real | dt_snapshots_lab = std::numeric_limits<Real>::lowest() |
| static bool | do_back_transformed_fields = true |
| static bool | do_back_transformed_particles = true |
| static amrex::Real | gamma_boost = 1._rt |
| static amrex::Real | beta_boost = 0._rt |
| static amrex::Vector< int > | boost_direction = {0,0,0} |
| static amrex::Real | zmax_plasma_to_compute_max_step = 0._rt |
| static int | do_compute_max_step_from_zmax = 0 |
| static bool | do_dynamic_scheduling = true |
| static bool | refine_plasma = false |
| static IntervalsParser | sort_intervals |
| static amrex::IntVect | sort_bin_size |
| static int | do_subcycling = 0 |
| static int | do_multi_J = 0 |
| static int | do_multi_J_n_depositions |
| static int | J_linear_in_time = 0 |
| static bool | do_device_synchronize_before_profile = false |
| static bool | safe_guard_cells = 0 |
| static int | n_field_gather_buffer = -1 |
| static int | n_current_deposition_buffer = -1 |
| in number of cells from the edge (identical for each dimension) More... | |
| static int | do_nodal = false |
| in number of cells from the edge (identical for each dimension) More... | |
| static amrex::IntVect | filter_npass_each_dir |
| static int | num_mirrors = 0 |
| static amrex::Real | quantum_xi_c2 = PhysConst::xi_c2 |
| static int | do_electrostatic |
| static amrex::Real | self_fields_required_precision = 1.e-11_rt |
| static int | self_fields_max_iters = 200 |
| static int | self_fields_verbosity = 2 |
| static int | do_moving_window = 0 |
| static int | start_moving_window_step = 0 |
| static int | end_moving_window_step = -1 |
| static int | moving_window_dir = -1 |
| static amrex::Real | moving_window_v = std::numeric_limits<amrex::Real>::max() |
| static bool | fft_do_time_averaging = false |
| static int | num_slice_snapshots_lab = 0 |
| static amrex::Real | dt_slice_snapshots_lab |
| static amrex::Real | particle_slice_width_lab = 0.0_rt |
Protected Member Functions | |
| void | InitLevelData (int lev, amrex::Real time) |
| This function initializes E, B, rho, and F, at all the levels of the multifab. rho and F are initialized with 0. The E and B fields are initialized using user-defined inputs. The initialization type is set using "B_ext_grid_init_style" and "E_ext_grid_init_style". The initialization style is set to "default" if not explicitly defined by the user, and the E and B fields are initialized with E_external_grid and B_external_grid, respectively, each with a default value of 0. If the initialization type for the E and B field is "constant", then, the E and B fields at all the levels are initialized with user-defined values for E_external_grid and B_external_grid. If the initialization type for B-field is set to "parse_B_ext_grid_function", then, the parser is used to read Bx_external_grid_function(x,y,z), By_external_grid_function(x,y,z), and Bz_external_grid_function(x,y,z). Similarly, if the E-field initialization type is set to "parse_E_ext_grid_function", then, the parser is used to read Ex_external_grid_function(x,y,z), Ey_external_grid_function(x,y,z), and Ex_external_grid_function(x,y,z). The parser for the E and B initialization assumes that the function has three independent variables, at max, namely, x, y, z. However, any number of constants can be used in the function used to define the E and B fields on the grid. More... | |
| virtual void | ErrorEst (int lev, amrex::TagBoxArray &tags, amrex::Real time, int) final |
| Tagging cells for refinement. More... | |
| virtual void | PostProcessBaseGrids (amrex::BoxArray &ba0) const final |
| virtual void | MakeNewLevelFromScratch (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) final |
| virtual void | MakeNewLevelFromCoarse (int, amrex::Real, const amrex::BoxArray &, const amrex::DistributionMapping &) final |
| virtual void | RemakeLevel (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) final |
| virtual void | ClearLevel (int lev) final |
| Delete level data. Called by AmrCore::regrid. More... | |
Private Member Functions | |
| void | EvolveEM (int numsteps) |
| void | FillBoundaryB (int lev, PatchType patch_type, amrex::IntVect ng) |
| void | FillBoundaryE (int lev, PatchType patch_type, amrex::IntVect ng) |
| void | FillBoundaryF (int lev, PatchType patch_type, amrex::IntVect ng) |
| void | FillBoundaryG (int lev, PatchType patch_type, amrex::IntVect ng) |
| void | FillBoundaryB_avg (int lev, PatchType patch_type, amrex::IntVect ng) |
| void | FillBoundaryE_avg (int lev, PatchType patch_type, amrex::IntVect ng) |
| void | NodalSyncE () |
| Synchronize the nodal points of the electric field MultiFabs. More... | |
| void | NodalSyncE (int lev) |
| Synchronize the nodal points of the electric field MultiFabs for given MR level. More... | |
| void | NodalSyncE (int lev, PatchType patch_type) |
| Synchronize the nodal points of the electric field MultiFabs for given MR level and patch. More... | |
| void | NodalSyncB () |
| Synchronize the nodal points of the magnetic field MultiFabs. More... | |
| void | NodalSyncB (int lev) |
| Synchronize the nodal points of the magnetic field MultiFabs for given MR level. More... | |
| void | NodalSyncB (int lev, PatchType patch_type) |
| Synchronize the nodal points of the magnetic field MultiFabs for given MR level and patch. More... | |
| void | OneStep_nosub (amrex::Real t) |
| void | OneStep_sub1 (amrex::Real t) |
| void | OneStep_multiJ (const amrex::Real t) |
| Perform one PIC iteration, with the multiple J deposition per time step. More... | |
| void | RestrictCurrentFromFineToCoarsePatch (int lev) |
| Fills the values of the current on the coarse patch by averaging the values of the current of the fine patch (on the same level). More... | |
| void | AddCurrentFromFineLevelandSumBoundary (int lev) |
| void | StoreCurrent (int lev) |
| void | RestoreCurrent (int lev) |
| void | ApplyFilterandSumBoundaryJ (int lev, PatchType patch_type) |
| void | NodalSyncJ (int lev, PatchType patch_type) |
| void | RestrictRhoFromFineToCoarsePatch (int lev) |
| void | ApplyFilterandSumBoundaryRho (int lev, PatchType patch_type, int icomp, int ncomp) |
| void | AddRhoFromFineLevelandSumBoundary (int lev, int icomp, int ncomp) |
| void | NodalSyncRho (int lev, PatchType patch_type, int icomp, int ncomp) |
| void | CurrentCorrection () |
Private function for current correction in Fourier space (equation (19) of https://doi.org/10.1016/j.jcp.2013.03.010): loops over the MR levels and applies the correction on the fine and coarse patches (calls the virtual method CurrentCorrection of the spectral algorithm in use, via the public interface defined in the class SpectralSolver). More... | |
| void | VayDeposition () |
Private function for Vay deposition in Fourier space (equations (20)-(24) of https://doi.org/10.1016/j.jcp.2013.03.010): loops over the MR levels and applies the correction on the fine and coarse patches (calls the virtual method VayDeposition of the spectral algorithm in use, via the public interface defined in the class SpectralSolver). More... | |
| void | ReadParameters () |
| void | BackwardCompatibility () |
| void | InitFromScratch () |
| void | AllocLevelData (int lev, const amrex::BoxArray &new_grids, const amrex::DistributionMapping &new_dmap) |
| amrex::DistributionMapping | GetRestartDMap (const std::string &chkfile, const amrex::BoxArray &ba, int lev) const |
| void | InitFromCheckpoint () |
| void | PostRestart () |
| void | InitPML () |
| void | ComputePMLFactors () |
| void | InitFilter () |
| void | InitDiagnostics () |
| void | InitNCICorrector () |
| void | CheckGuardCells () |
| Check that the number of guard cells is smaller than the number of valid cells, for all available MultiFabs, and abort otherwise. More... | |
| void | CheckGuardCells (amrex::MultiFab const &mf) |
| Check that the number of guard cells is smaller than the number of valid cells, for a given MultiFab, and abort otherwise. More... | |
| void | PerformanceHints () |
| std::unique_ptr< amrex::MultiFab > | GetCellCenteredData () |
| void | BuildBufferMasks () |
| void | BuildBufferMasksInBox (const amrex::Box tbx, amrex::IArrayBox &buffer_mask, const amrex::IArrayBox &guard_mask, const int ng) |
| Build buffer mask within given FArrayBox. More... | |
| const amrex::iMultiFab * | getCurrentBufferMasks (int lev) const |
| const amrex::iMultiFab * | getGatherBufferMasks (int lev) const |
| void | ReorderFornbergCoefficients (amrex::Vector< amrex::Real > &ordered_coeffs, amrex::Vector< amrex::Real > &unordered_coeffs, const int order) |
Re-orders the Fornberg coefficients so that they can be used more conveniently for finite-order centering operations. For example, for finite-order centering of order 6, the Fornberg coefficients (c_0,c_1,c_2) are re-ordered as (c_2,c_1,c_0,c_0,c_1,c_2). More... | |
| void | AllocateCenteringCoefficients (amrex::Gpu::DeviceVector< amrex::Real > &device_centering_stencil_coeffs_x, amrex::Gpu::DeviceVector< amrex::Real > &device_centering_stencil_coeffs_y, amrex::Gpu::DeviceVector< amrex::Real > &device_centering_stencil_coeffs_z, const int centering_nox, const int centering_noy, const int centering_noz) |
| Allocates and initializes the stencil coefficients used for the finite-order centering of fields and currents, and stores them in the given device vectors. More... | |
| void | AllocLevelMFs (int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm, const amrex::IntVect &ngE, const amrex::IntVect &ngJ, const amrex::IntVect &ngRho, const amrex::IntVect &ngF, const amrex::IntVect &ngG, const bool aux_is_nodal) |
| void | AllocLevelSpectralSolverRZ (amrex::Vector< std::unique_ptr< SpectralSolverRZ >> &spectral_solver, const int lev, const amrex::BoxArray &realspace_ba, const amrex::DistributionMapping &dm, const std::array< amrex::Real, 3 > &dx) |
| amrex::FabFactory< amrex::FArrayBox > const & | fieldFactory (int lev) const noexcept |
| void | ScrapeParticles () |
| void | PushPSATD () |
| void | PSATDForwardTransformEB () |
| Forward FFT of E,B on all mesh refinement levels. More... | |
| void | PSATDBackwardTransformEB () |
| Backward FFT of E,B on all mesh refinement levels, with field damping in the guard cells (if needed) More... | |
| void | PSATDBackwardTransformEBavg () |
| Backward FFT of averaged E,B on all mesh refinement levels. More... | |
| void | PSATDForwardTransformJ () |
| Forward FFT of J on all mesh refinement levels, with k-space filtering (if needed) More... | |
| void | PSATDForwardTransformRho (const int icomp, const int dcomp) |
| Forward FFT of rho on all mesh refinement levels, with k-space filtering (if needed) More... | |
| void | PSATDMoveRhoNewToRhoOld () |
| Copy rho_new to rho_old in spectral space. More... | |
| void | PSATDMoveJNewToJOld () |
| Copy J_new to J_old in spectral space (when J is linear in time) More... | |
| void | PSATDForwardTransformF () |
| Forward FFT of F on all mesh refinement levels. More... | |
| void | PSATDBackwardTransformF () |
| Backward FFT of F on all mesh refinement levels. More... | |
| void | PSATDForwardTransformG () |
| Forward FFT of G on all mesh refinement levels. More... | |
| void | PSATDBackwardTransformG () |
| Backward FFT of G on all mesh refinement levels. More... | |
| void | PSATDPushSpectralFields () |
| Update all necessary fields in spectral space. More... | |
| void | PSATDScaleAverageFields (const amrex::Real scale_factor) |
| Scale averaged E,B fields to account for time integration. More... | |
| void | PSATDEraseAverageFields () |
| Set averaged E,B fields to zero before new iteration. More... | |
Private Attributes | |
| amrex::Vector< int > | istep |
| amrex::Vector< int > | nsubsteps |
| amrex::Vector< amrex::Real > | t_new |
| amrex::Vector< amrex::Real > | t_old |
| amrex::Vector< amrex::Real > | dt |
| std::unique_ptr< MultiParticleContainer > | mypc |
| std::unique_ptr< MultiDiagnostics > | multi_diags |
| std::unique_ptr< BackTransformedDiagnostic > | myBFD |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Efield_aux |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Bfield_aux |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | F_fp |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | G_fp |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | rho_fp |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | phi_fp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | current_fp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Efield_fp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Bfield_fp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Efield_avg_fp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Bfield_avg_fp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Venl |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | m_edge_lengths |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | m_face_areas |
| amrex::Vector< std::array< std::unique_ptr< amrex::iMultiFab >, 3 > > | m_flag_info_face |
| amrex::Vector< std::array< std::unique_ptr< amrex::iMultiFab >, 3 > > | m_flag_ext_face |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | m_area_mod |
| amrex::Vector< std::array< std::unique_ptr< amrex::LayoutData< FaceInfoBox > >, 3 > > | m_borrowing |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | ECTRhofield |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | m_distance_to_eb |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | current_store |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | current_fp_nodal |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | F_cp |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | G_cp |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | rho_cp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | current_cp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Efield_cp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Bfield_cp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Efield_avg_cp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Bfield_avg_cp |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Efield_cax |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Bfield_cax |
| amrex::Vector< std::unique_ptr< amrex::iMultiFab > > | current_buffer_masks |
| amrex::Vector< std::unique_ptr< amrex::iMultiFab > > | gather_buffer_masks |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | current_buf |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | charge_buf |
| int | do_pml = 0 |
| int | do_silver_mueller = 0 |
| int | pml_ncell = 10 |
| int | pml_delta = 10 |
| int | pml_has_particles = 0 |
| int | do_pml_j_damping = 0 |
| int | do_pml_in_domain = 0 |
| bool | do_pml_dive_cleaning |
| bool | do_pml_divb_cleaning |
| amrex::IntVect | do_pml_Lo = amrex::IntVect::TheZeroVector() |
| amrex::IntVect | do_pml_Hi = amrex::IntVect::TheZeroVector() |
| amrex::Vector< std::unique_ptr< PML > > | pml |
| amrex::Real | moving_window_x = std::numeric_limits<amrex::Real>::max() |
| amrex::Real | current_injection_position = 0 |
| int | warpx_do_continuous_injection = 0 |
| int | num_injected_species = -1 |
| amrex::Vector< int > | injected_plasma_species |
| amrex::Real | const_dt = amrex::Real(0.5e-11) |
| std::unique_ptr< MacroscopicProperties > | m_macroscopic_properties |
| IntervalsParser | load_balance_intervals |
| amrex::Vector< std::unique_ptr< amrex::LayoutData< amrex::Real > > > | costs |
| int | load_balance_with_sfc = 0 |
| amrex::Real | load_balance_knapsack_factor = amrex::Real(1.24) |
| amrex::Real | load_balance_efficiency_ratio_threshold = amrex::Real(1.1) |
| amrex::Vector< amrex::Real > | load_balance_efficiency |
| amrex::Real | costs_heuristic_cells_wt = amrex::Real(-1) |
| amrex::Real | costs_heuristic_particles_wt = amrex::Real(-1) |
| IntervalsParser | override_sync_intervals |
| int | verbose = 1 |
| bool | use_hybrid_QED = 0 |
| int | max_step = std::numeric_limits<int>::max() |
| amrex::Real | stop_time = std::numeric_limits<amrex::Real>::max() |
| int | regrid_int = -1 |
| amrex::Real | cfl = amrex::Real(0.7) |
| std::string | restart_chkfile |
| amrex::VisMF::Header::Version | plotfile_headerversion = amrex::VisMF::Header::Version_v1 |
| amrex::VisMF::Header::Version | slice_plotfile_headerversion = amrex::VisMF::Header::Version_v1 |
| bool | use_single_read = true |
| bool | use_single_write = true |
| int | mffile_nstreams = 4 |
| int | field_io_nfiles = 1024 |
| int | particle_io_nfiles = 1024 |
| amrex::RealVect | fine_tag_lo |
| amrex::RealVect | fine_tag_hi |
| bool | is_synchronized = true |
| guardCellManager | guard_cells |
| int | slice_max_grid_size |
| int | slice_plot_int = -1 |
| amrex::RealBox | slice_realbox |
| amrex::IntVect | slice_cr_ratio |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | F_slice |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | G_slice |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | rho_slice |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | current_slice |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Efield_slice |
| amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > | Bfield_slice |
| bool | fft_periodic_single_box = false |
| int | nox_fft = 16 |
| int | noy_fft = 16 |
| int | noz_fft = 16 |
| amrex::IntVect | numprocs {0} |
| Domain decomposition on Level 0. More... | |
| std::unique_ptr< ParticleBoundaryBuffer > | m_particle_boundary_buffer |
| particle buffer for scraped particles on the boundaries More... | |
| amrex::Vector< std::unique_ptr< amrex::FabFactory< amrex::FArrayBox > > > | m_field_factory |
| int | fftw_plan_measure = 1 |
| amrex::Vector< std::unique_ptr< SpectralSolverRZ > > | spectral_solver_fp |
| amrex::Vector< std::unique_ptr< SpectralSolverRZ > > | spectral_solver_cp |
| amrex::Vector< std::unique_ptr< FiniteDifferenceSolver > > | m_fdtd_solver_fp |
| amrex::Vector< std::unique_ptr< FiniteDifferenceSolver > > | m_fdtd_solver_cp |
Static Private Attributes | |
| static WarpX * | m_instance = nullptr |
Friends | |
| class | PML |
| WarpX::WarpX | ( | ) |
create object for reduced diagnostics
| WarpX::~WarpX | ( | ) |
|
private |
|
private |
| void WarpX::AddSpaceChargeField | ( | WarpXParticleContainer & | pc | ) |
| void WarpX::AddSpaceChargeFieldLabFrame | ( | ) |
|
private |
Allocates and initializes the stencil coefficients used for the finite-order centering of fields and currents, and stores them in the given device vectors.
| [in,out] | device_centering_stencil_coeffs_x | device vector where the stencil coefficients along x will be stored |
| [in,out] | device_centering_stencil_coeffs_y | device vector where the stencil coefficients along y will be stored |
| [in,out] | device_centering_stencil_coeffs_z | device vector where the stencil coefficients along z will be stored |
| [in] | centering_nox | order of the finite-order centering along x |
| [in] | centering_noy | order of the finite-order centering along y |
| [in] | centering_noz | order of the finite-order centering along z |
|
private |
|
private |
|
private |
| void WarpX::ApplyEfieldBoundary | ( | const int | lev, |
| PatchType | patch_type | ||
| ) |
|
private |
| void WarpX::ApplyFilterandSumBoundaryRho | ( | int | lev, |
| int | glev, | ||
| amrex::MultiFab & | rho, | ||
| int | icomp, | ||
| int | ncomp | ||
| ) |
|
private |
| void WarpX::ApplyInverseVolumeScalingToChargeDensity | ( | amrex::MultiFab * | Rho, |
| int | lev | ||
| ) |
| void WarpX::ApplyInverseVolumeScalingToCurrentDensity | ( | amrex::MultiFab * | Jx, |
| amrex::MultiFab * | Jy, | ||
| amrex::MultiFab * | Jz, | ||
| int | lev | ||
| ) |
| void WarpX::applyMirrors | ( | amrex::Real | time | ) |
| void WarpX::AverageAndPackFields | ( | amrex::Vector< std::string > & | varnames, |
| amrex::Vector< amrex::MultiFab > & | mf_avg, | ||
| const amrex::IntVect | ngrow | ||
| ) | const |
|
private |
This function queries deprecated input parameters and abort the run if one of them is specified.
|
private |
|
private |
Build buffer mask within given FArrayBox.
| tbx | Current FArrayBox |
| buffer_mask | Buffer mask to be set |
| guard_mask | Guard mask used to set buffer_mask |
| ng | Number of guard cells |
|
static |
|
private |
Check that the number of guard cells is smaller than the number of valid cells, for all available MultiFabs, and abort otherwise.
|
private |
Check that the number of guard cells is smaller than the number of valid cells, for a given MultiFab, and abort otherwise.
|
finalprotectedvirtual |
Delete level data. Called by AmrCore::regrid.
| void WarpX::computeB | ( | amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > & | B, |
| const amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | phi, | ||
| std::array< amrex::Real, 3 > const | beta = {{0,0,0}} |
||
| ) | const |
| void WarpX::ComputeCostsHeuristic | ( | amrex::Vector< std::unique_ptr< amrex::LayoutData< amrex::Real > > > & | costs | ) |
adds particle and cell contributions in cells to compute heuristic cost in each box on each level, and records in costs
| [in] | costs | vector of (unique_ptr to) vectors; expected to be initialized to correct number of boxes and boxes per level |
| void WarpX::ComputeDistanceToEB | ( | ) |
Compute the level set function used for particle-boundary interaction.
|
static |
|
static |
| void WarpX::ComputeDivE | ( | amrex::MultiFab & | divE, |
| const int | lev | ||
| ) |
| void WarpX::ComputeDt | ( | ) |
Determine the timestep of the simulation.
| void WarpX::computeE | ( | amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > & | E, |
| const amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | phi, | ||
| std::array< amrex::Real, 3 > const | beta = {{0,0,0}} |
||
| ) | const |
| void WarpX::ComputeEdgeLengths | ( | ) |
Compute the length of the mesh edges. Here the length is a value in [0, 1]. An edge of length 0 is fully covered.
| void WarpX::ComputeEightWaysExtensions | ( | ) |
Do the eight-ways extension.
| void WarpX::ComputeFaceAreas | ( | ) |
Compute the area of the mesh faces. Here the area is a value in [0, 1]. An edge of area 0 is fully covered.
| void WarpX::ComputeFaceExtensions | ( | ) |
Main function computing the cell extension. Where possible it computes one-way extensions and, when this is not possible, it does eight-ways extensions.
| void WarpX::ComputeMaxStep | ( | ) |
Compute the last timestep of the simulation and make max_step and stop_time self-consistent. Calls computeMaxStepBoostAccelerator() if required.
| void WarpX::computeMaxStepBoostAccelerator | ( | const amrex::Geometry & | geom | ) |
| void WarpX::ComputeOneWayExtensions | ( | ) |
Do the one-way extension.
| void WarpX::computePhi | ( | const amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | rho, |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | phi, | ||
| std::array< amrex::Real, 3 > const | beta = {{0,0,0}}, |
||
| amrex::Real const | required_precision = amrex::Real(1.e-11), |
||
| const int | max_iters = 200, |
||
| const int | verbosity = 2 |
||
| ) | const |
| void WarpX::computePhiCartesian | ( | const amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | rho, |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | phi, | ||
| std::array< amrex::Real, 3 > const | beta, | ||
| amrex::Real const | required_precision, | ||
| int const | max_iters, | ||
| int const | verbosity | ||
| ) | const |
| void WarpX::computePhiRZ | ( | const amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | rho, |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | phi, | ||
| std::array< amrex::Real, 3 > const | beta, | ||
| amrex::Real const | required_precision, | ||
| int const | max_iters, | ||
| int const | verbosity | ||
| ) | const |
|
private |
| void WarpX::ComputeSpaceChargeField | ( | bool const | reset_fields | ) |
| void WarpX::CopyJPML | ( | ) |
Copy the current J from the regular grid to the PML.
| amrex::Array1D< int, 0, 2 > WarpX::CountExtFaces | ( | ) |
Auxiliary function to count the amount of faces which still need to be extended.
|
static |
|
private |
Private function for current correction in Fourier space (equation (19) of https://doi.org/10.1016/j.jcp.2013.03.010): loops over the MR levels and applies the correction on the fine and coarse patches (calls the virtual method CurrentCorrection of the spectral algorithm in use, via the public interface defined in the class SpectralSolver).
| void WarpX::DampFieldsInGuards | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Bfield | ||
| ) |
Private function for spectral solver Applies a damping factor in the guards cells that extend beyond the extent of the domain, reducing fluctuations that can appear in parallel simulations. This will be called when FieldBoundaryType is set to damped.
| void WarpX::DampJPML | ( | ) |
| void WarpX::DampJPML | ( | int | lev | ) |
| void WarpX::DampJPML | ( | int | lev, |
| PatchType | patch_type | ||
| ) |
| void WarpX::DampPML | ( | ) |
| void WarpX::DampPML | ( | int | lev | ) |
| void WarpX::DampPML | ( | int | lev, |
| PatchType | patch_type | ||
| ) |
| void WarpX::doFieldIonization | ( | ) |
Run the ionization module on all species
| void WarpX::doFieldIonization | ( | int | lev | ) |
Run the ionization module on all species at level lev
| lev | level |
|
inline |
| void WarpX::doQEDEvents | ( | ) |
Run the QED module on all species
| void WarpX::doQEDEvents | ( | int | lev | ) |
Run the QED module on all species at level lev
| lev | level |
|
finalprotectedvirtual |
Tagging cells for refinement.
| void WarpX::Evolve | ( | int | numsteps = -1 | ) |
reduced diags
| void WarpX::EvolveB | ( | amrex::Real | dt, |
| DtType | dt_type | ||
| ) |
| void WarpX::EvolveB | ( | int | lev, |
| amrex::Real | dt, | ||
| DtType | dt_type | ||
| ) |
| void WarpX::EvolveE | ( | amrex::Real | dt | ) |
| void WarpX::EvolveE | ( | int | lev, |
| amrex::Real | dt | ||
| ) |
| void WarpX::EvolveE | ( | int | lev, |
| PatchType | patch_type, | ||
| amrex::Real | dt | ||
| ) |
|
private |
Advance the simulation by numsteps steps, electromagnetic case.
| void WarpX::EvolveF | ( | amrex::Real | dt, |
| DtType | dt_type | ||
| ) |
| void WarpX::EvolveF | ( | int | lev, |
| amrex::Real | dt, | ||
| DtType | dt_type | ||
| ) |
| void WarpX::EvolveG | ( | amrex::Real | dt, |
| DtType | dt_type | ||
| ) |
| void WarpX::EvolveG | ( | int | lev, |
| amrex::Real | dt, | ||
| DtType | dt_type | ||
| ) |
|
inlineprivatenoexcept |
| void WarpX::FillBoundaryAux | ( | amrex::IntVect | ng | ) |
| void WarpX::FillBoundaryAux | ( | int | lev, |
| amrex::IntVect | ng | ||
| ) |
| void WarpX::FillBoundaryB | ( | amrex::IntVect | ng | ) |
| void WarpX::FillBoundaryB | ( | int | lev, |
| amrex::IntVect | ng | ||
| ) |
|
private |
| void WarpX::FillBoundaryB_avg | ( | amrex::IntVect | ng | ) |
| void WarpX::FillBoundaryB_avg | ( | int | lev, |
| amrex::IntVect | ng | ||
| ) |
|
private |
| void WarpX::FillBoundaryE | ( | amrex::IntVect | ng | ) |
| void WarpX::FillBoundaryE | ( | int | lev, |
| amrex::IntVect | ng | ||
| ) |
|
private |
| void WarpX::FillBoundaryE_avg | ( | amrex::IntVect | ng | ) |
| void WarpX::FillBoundaryE_avg | ( | int | lev, |
| amrex::IntVect | ng | ||
| ) |
|
private |
| void WarpX::FillBoundaryF | ( | amrex::IntVect | ng | ) |
| void WarpX::FillBoundaryF | ( | int | lev, |
| amrex::IntVect | ng | ||
| ) |
|
private |
| void WarpX::FillBoundaryG | ( | amrex::IntVect | ng | ) |
| void WarpX::FillBoundaryG | ( | int | lev, |
| amrex::IntVect | ng | ||
| ) |
|
private |
|
static |
|
inline |
|
inline |
|
inline |
returns the load balance interval
|
inline |
|
inline |
|
inline |
Coarsest-level Domain Decomposition
If specified, the domain will be chopped into the exact number of pieces in each dimension as specified by this parameter.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void WarpX::getPhiBC | ( | const int | idim, |
| amrex::Real & | pot_lo, | ||
| amrex::Real & | pot_hi | ||
| ) | const |
| PML * WarpX::GetPML | ( | int | lev | ) |
| std::vector< bool > WarpX::getPMLdirections | ( | ) | const |
get low-high-low-high-... vector for each direction indicating if mother grid PMLs are enabled
|
static |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
| void WarpX::Hybrid_QED_Push | ( | amrex::Vector< amrex::Real > | dt | ) |
apply QED correction on electric field
| dt | vector of time steps (for all levels) |
| void WarpX::Hybrid_QED_Push | ( | int | lev, |
| amrex::Real | dt | ||
| ) |
apply QED correction on electric field for level lev
| lev | mesh refinement level |
| dt | time step |
| void WarpX::Hybrid_QED_Push | ( | int | lev, |
| PatchType | patch_type, | ||
| amrex::Real | dt | ||
| ) |
apply QED correction on electric field for level lev and patch type patch_type
| lev | mesh refinement level |
| dt | patch_type which MR patch: PatchType::fine or PatchType::coarse |
| dt | time step |
| void WarpX::InitBorrowing | ( | ) |
Initialize the memory for the FaceInfoBoxes.
| void WarpX::InitData | ( | ) |
|
private |
| void WarpX::InitEB | ( | ) |
|
private |
|
private |
|
private |
| void WarpX::InitializeExternalFieldsOnGridUsingParser | ( | amrex::MultiFab * | mfx, |
| amrex::MultiFab * | mfy, | ||
| amrex::MultiFab * | mfz, | ||
| amrex::ParserExecutor< 3 > const & | xfield_parser, | ||
| amrex::ParserExecutor< 3 > const & | yfield_parser, | ||
| amrex::ParserExecutor< 3 > const & | zfield_parser, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | geom_data, | ||
| const int | lev | ||
| ) |
This function initializes the E and B fields on each level using the parser and the user-defined function for the external fields. The subroutine will parse the x_/y_z_external_grid_function and then, the field multifab is initialized based on the (x,y,z) position on the staggered yee-grid or cell-centered grid, in the interior cells and guard cells.
| [in] | mfx,x-component | of the field to be initialized |
| [in] | mfy,y-component | of the field to be initialized |
| [in] | mfz,z-component | of the field to be initialized |
| [in] | xfield_parser,parser | function to initialize x-field |
| [in] | yfield_parser,parser | function to initialize y-field |
| [in] | zfield_parser,parser | function to initialize z-field |
| [in] | geom_data,geometric | data, can be m_edge_lengths or m_face_areass |
| [in] | lev,level | of the Multifabs that is initialized |
|
protected |
This function initializes E, B, rho, and F, at all the levels of the multifab. rho and F are initialized with 0. The E and B fields are initialized using user-defined inputs. The initialization type is set using "B_ext_grid_init_style" and "E_ext_grid_init_style". The initialization style is set to "default" if not explicitly defined by the user, and the E and B fields are initialized with E_external_grid and B_external_grid, respectively, each with a default value of 0. If the initialization type for the E and B field is "constant", then, the E and B fields at all the levels are initialized with user-defined values for E_external_grid and B_external_grid. If the initialization type for B-field is set to "parse_B_ext_grid_function", then, the parser is used to read Bx_external_grid_function(x,y,z), By_external_grid_function(x,y,z), and Bz_external_grid_function(x,y,z). Similarly, if the E-field initialization type is set to "parse_E_ext_grid_function", then, the parser is used to read Ex_external_grid_function(x,y,z), Ey_external_grid_function(x,y,z), and Ex_external_grid_function(x,y,z). The parser for the E and B initialization assumes that the function has three independent variables, at max, namely, x, y, z. However, any number of constants can be used in the function used to define the E and B fields on the grid.
|
private |
|
private |
| bool WarpX::isAnyBoundaryPML | ( | ) |
| void WarpX::LoadBalance | ( | ) |
perform load balance; compute and communicate new amrex::DistributionMapping
|
static |
| std::array< Real, 3 > WarpX::LowerCornerWithGalilean | ( | const amrex::Box & | bx, |
| const amrex::Array< amrex::Real, 3 > & | v_galilean, | ||
| int | lev | ||
| ) |
| void WarpX::MacroscopicEvolveE | ( | amrex::Real | dt | ) |
| void WarpX::MacroscopicEvolveE | ( | int | lev, |
| amrex::Real | dt | ||
| ) |
| void WarpX::MacroscopicEvolveE | ( | int | lev, |
| PatchType | patch_type, | ||
| amrex::Real | dt | ||
| ) |
|
inlinefinalprotectedvirtual |
Make a new level using provided BoxArray and DistributionMapping and fill with interpolated coarse level data. Called by AmrCore::regrid.
|
finalprotectedvirtual |
Make a new level from scratch using provided BoxArray and DistributionMapping. Only used during initialization. Called by AmrCoreInitFromScratch.
| void WarpX::MarkCells | ( | ) |
Initialize information for cell extensions. The flags convention for m_flag_info_face is as follows.
|
inline |
| int WarpX::MoveWindow | ( | const int | step, |
| bool | move_j | ||
| ) |
Move the moving window.
| step | Time step |
| move_j | whether the current is shifted or not |
|
inlinestatic |
Returns true if the moving window is active for the provided step
| step | time step |
|
private |
Synchronize the nodal points of the magnetic field MultiFabs.
|
private |
Synchronize the nodal points of the magnetic field MultiFabs for given MR level.
|
private |
Synchronize the nodal points of the magnetic field MultiFabs for given MR level and patch.
|
private |
Synchronize the nodal points of the electric field MultiFabs.
|
private |
Synchronize the nodal points of the electric field MultiFabs for given MR level.
|
private |
Synchronize the nodal points of the electric field MultiFabs for given MR level and patch.
|
private |
| void WarpX::NodalSyncPML | ( | ) |
Synchronize the nodal points of the PML MultiFabs.
| void WarpX::NodalSyncPML | ( | int | lev | ) |
Synchronize the nodal points of the PML MultiFabs for given MR level.
| void WarpX::NodalSyncPML | ( | int | lev, |
| PatchType | patch_type | ||
| ) |
Synchronize the nodal points of the PML MultiFabs for given MR level and patch.
|
private |
|
private |
Perform one PIC iteration, with the multiple J deposition per time step.
|
private |
|
private |
|
private |
Check the requested resources and write performance hints
|
static |
Version of PICSAR dependency.
|
finalprotectedvirtual |
Use this function to override the Level 0 grids made by AMReX. This function is called in amrex::AmrCore::InitFromScratch.
|
private |
| void WarpX::prepareFields | ( | int const | step, |
| amrex::Vector< std::string > & | varnames, | ||
| amrex::Vector< amrex::MultiFab > & | mf_avg, | ||
| amrex::Vector< const amrex::MultiFab *> & | output_mf, | ||
| amrex::Vector< amrex::Geometry > & | output_geom | ||
| ) | const |
| void WarpX::PrintDtDxDyDz | ( | ) |
Print dt and dx,dy,dz
|
private |
Backward FFT of E,B on all mesh refinement levels, with field damping in the guard cells (if needed)
|
private |
Backward FFT of averaged E,B on all mesh refinement levels.
|
private |
Backward FFT of F on all mesh refinement levels.
|
private |
Backward FFT of G on all mesh refinement levels.
|
private |
Set averaged E,B fields to zero before new iteration.
|
private |
Forward FFT of E,B on all mesh refinement levels.
|
private |
Forward FFT of F on all mesh refinement levels.
|
private |
Forward FFT of G on all mesh refinement levels.
|
private |
Forward FFT of J on all mesh refinement levels, with k-space filtering (if needed)
|
private |
Forward FFT of rho on all mesh refinement levels, with k-space filtering (if needed)
| [in] | icomp | index of fourth component (0 for rho_old, 1 for rho_new) |
| [in] | dcomp | index of spectral component (0 for rho_old, 1 for rho_new) |
|
private |
Copy J_new to J_old in spectral space (when J is linear in time)
|
private |
Copy rho_new to rho_old in spectral space.
|
private |
Update all necessary fields in spectral space.
|
private |
Scale averaged E,B fields to account for time integration.
| [in] | scale_factor | scalar to multiply each field component by |
| void WarpX::PushParticlesandDepose | ( | int | lev, |
| amrex::Real | cur_time, | ||
| DtType | a_dt_type = DtType::Full, |
||
| bool | skip_current = false |
||
| ) |
| void WarpX::PushParticlesandDepose | ( | amrex::Real | cur_time, |
| bool | skip_current = false |
||
| ) |
|
private |
|
private |
|
static |
|
finalprotectedvirtual |
Remake an existing level using provided BoxArray and DistributionMapping and fill with existing fine and coarse data. Called by AmrCore::regrid.
|
private |
Re-orders the Fornberg coefficients so that they can be used more conveniently for finite-order centering operations. For example, for finite-order centering of order 6, the Fornberg coefficients (c_0,c_1,c_2) are re-ordered as (c_2,c_1,c_0,c_0,c_1,c_2).
| [in,out] | ordered_coeffs | host vector where the re-ordered Fornberg coefficients will be stored |
| [in] | unordered_coeffs | host vector storing the original sequence of Fornberg coefficients |
| [in] | order | order of the finite-order centering along a given direction |
| void WarpX::ResetCosts | ( | ) |
resets costs to zero
|
static |
| void WarpX::ResetProbDomain | ( | const amrex::RealBox & | rb | ) |
|
private |
|
private |
Fills the values of the current on the coarse patch by averaging the values of the current of the fine patch (on the same level).
|
private |
| void WarpX::ScaleAreas | ( | ) |
Scale the edges areas by the mesh width to obtain the real areas.
| void WarpX::ScaleEdges | ( | ) |
Scale the edges lengths by the mesh width to obtain the real lengths.
|
private |
|
inline |
|
inline |
| void WarpX::setPhiBC | ( | amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | phi, |
| std::array< bool, AMREX_SPACEDIM > | dirichlet_flag, | ||
| amrex::Array< amrex::Real, AMREX_SPACEDIM > | phi_bc_values_lo, | ||
| amrex::Array< amrex::Real, AMREX_SPACEDIM > | phi_bc_values_hi | ||
| ) | const |
|
inline |
| void WarpX::ShiftGalileanBoundary | ( | ) |
This function shifts the boundary of the grid by 'm_v_galilean*dt'. In doding so, only positions attributes are changed while fields remain unchanged.
|
static |
| void WarpX::ShrinkBorrowing | ( | ) |
Shrink the vectors in the FaceInfoBoxes.
|
inline |
|
private |
| void WarpX::SyncCurrent | ( | ) |
| void WarpX::SyncRho | ( | ) |
| void WarpX::UpdateAuxilaryData | ( | ) |
| void WarpX::UpdateAuxilaryDataSameType | ( | ) |
| void WarpX::UpdateAuxilaryDataStagToNodal | ( | ) |
| void WarpX::UpdateCurrentNodalToStag | ( | amrex::MultiFab & | dst, |
| amrex::MultiFab const & | src | ||
| ) |
This function is called if warpx.do_current_centering = 1 and it centers the currents from a nodal grid to a staggered grid (Yee) using finite-order interpolation based on the Fornberg coefficients.
| [in,out] | dst | destination MultiFab where the results of the finite-order centering are stored |
| [in] | src | source MultiFab that contains the values of the nodal current to be centered |
| void WarpX::UpdatePlasmaInjectionPosition | ( | amrex::Real | dt | ) |
|
static |
|
private |
Private function for Vay deposition in Fourier space (equations (20)-(24) of https://doi.org/10.1016/j.jcp.2013.03.010): loops over the MR levels and applies the correction on the fine and coarse patches (calls the virtual method VayDeposition of the spectral algorithm in use, via the public interface defined in the class SpectralSolver).
|
inline |
|
static |
Version of WarpX executable.
|
friend |
|
static |
Author of an input file / simulation setup.
|
static |
|
static |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| BilinearFilter WarpX::bilinear_filter |
|
static |
| std::unique_ptr<amrex::Parser> WarpX::Bxfield_parser |
| std::unique_ptr<amrex::Parser> WarpX::Byfield_parser |
| std::unique_ptr<amrex::Parser> WarpX::Bzfield_parser |
|
private |
|
private |
|
static |
|
private |
|
private |
Collection of LayoutData to keep track of weights used in load balancing routines. Contains timer-based or heuristic-based costs depending on input option
|
private |
Weight factor for cells in Heuristic costs update. Default values on GPU are determined from single-GPU tests on Summit. The problem setup for these tests is an empty (i.e. no particles) domain of size 256 by 256 by 256 cells, from which the average time per iteration per cell is computed.
|
private |
Weight factor for particles in Heuristic costs update. Default values on GPU are determined from single-GPU tests on Summit. The problem setup for these tests is a high-ppc (27 particles per cell) uniform plasma on a domain of size 128 by 128 by 128, from which the approximate time per iteration per particle is computed.
|
private |
|
private |
|
static |
|
static |
|
static |
| bool WarpX::current_correction = false |
|
private |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
| amrex::Gpu::DeviceVector<amrex::Real> WarpX::device_current_centering_stencil_coeffs_x |
| amrex::Gpu::DeviceVector<amrex::Real> WarpX::device_current_centering_stencil_coeffs_y |
| amrex::Gpu::DeviceVector<amrex::Real> WarpX::device_current_centering_stencil_coeffs_z |
| amrex::Gpu::DeviceVector<amrex::Real> WarpX::device_field_centering_stencil_coeffs_x |
| amrex::Gpu::DeviceVector<amrex::Real> WarpX::device_field_centering_stencil_coeffs_y |
| amrex::Gpu::DeviceVector<amrex::Real> WarpX::device_field_centering_stencil_coeffs_z |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
in number of cells from the edge (identical for each dimension)
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
private |
|
static |
|
static |
|
static |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
| std::unique_ptr<amrex::Parser> WarpX::Exfield_parser |
| std::unique_ptr<amrex::Parser> WarpX::Eyfield_parser |
| std::unique_ptr<amrex::Parser> WarpX::Ezfield_parser |
|
private |
|
private |
|
private |
|
static |
|
private |
|
private |
|
static |
|
static |
| ElectrostaticSolver::BoundaryValueHandler WarpX::field_boundary_value_handler |
|
static |
|
static |
|
static |
|
static |
|
private |
|
static |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
|
static |
|
private |
Current load balance efficiency for each level.
|
private |
Threshold value that controls whether to adopt the proposed distribution mapping during load balancing. The new distribution mapping is adopted if the ratio of proposed distribution mapping efficiency to current distribution mapping efficiency is larger than the threshold; 'efficiency' here means the average cost per MPI rank.
|
private |
Load balancing intervals that reads the "load_balance_intervals" string int the input file for getting steps at which load balancing is performed
|
private |
Controls the maximum number of boxes that can be assigned to a rank during load balance via the 'knapsack' strategy; e.g., if there are 4 boxes per rank, load_balance_knapsack_factor=2 limits the maximum number of boxes that can be assigned to a rank to 8.
|
private |
Load balance with 'space filling curve' strategy.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| amrex::Array<amrex::Real,3> WarpX::m_galilean_shift = {{0}} |
|
staticprivate |
|
private |
|
private |
particle buffer for scraped particles on the boundaries
| amrex::Array<amrex::Real,3> WarpX::m_v_comoving = {{0.}} |
| amrex::Array<amrex::Real,3> WarpX::m_v_galilean = {{0}} |
|
static |
|
private |
|
static |
|
private |
| amrex::Vector<amrex::Real> WarpX::mirror_z |
| amrex::Vector<int> WarpX::mirror_z_npoints |
| amrex::Vector<amrex::Real> WarpX::mirror_z_width |
|
static |
|
static |
|
private |
|
private |
|
private |
|
private |
|
static |
in number of cells from the edge (identical for each dimension)
|
static |
|
static |
| amrex::Vector< std::unique_ptr<NCIGodfreyFilter> > WarpX::nci_godfrey_filter_bxbyez |
| amrex::Vector< std::unique_ptr<NCIGodfreyFilter> > WarpX::nci_godfrey_filter_exeybz |
|
static |
|
static |
|
private |
|
static |
|
private |
|
static |
|
private |
|
private |
|
private |
|
static |
|
static |
|
static |
|
private |
Domain decomposition on Level 0.
|
private |
|
static |
|
static |
|
private |
|
static |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
| MultiReducedDiags* WarpX::reduced_diags |
object with all reduced diagnotics, similar to MultiParticleContainer for species.
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
|
static |
|
static |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
|
private |
|
private |
|
static |
|
private |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
private |
|
private |
| amrex::Real WarpX::time_of_last_gal_shift = 0 |
| bool WarpX::update_with_rho = false |
|
static |
|
static |
|
static |
|
private |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
1.8.13