WarpX
|
#include <WarpX.H>
Public Member Functions | |
~WarpX () override | |
WarpX (WarpX const &)=delete | |
WarpX & | operator= (WarpX const &)=delete |
WarpX (WarpX &&)=default | |
WarpX & | operator= (WarpX &&)=default |
int | Verbose () const |
void | InitData () |
void | Evolve (int numsteps=-1) |
void | EvolveImplicitPicardInit (int lev) |
void | SaveParticlesAtImplicitStepStart (WarpXParticleContainer &pc, int lev) |
void | FinishImplicitParticleUpdate (WarpXParticleContainer &pc, int lev) |
void | FinishImplicitFieldUpdate (amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > &Efield_fp, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > &Efield_n) |
MultiParticleContainer & | GetPartContainer () |
MultiFluidContainer & | GetFluidContainer () |
MacroscopicProperties & | GetMacroscopicProperties () |
HybridPICModel & | GetHybridPICModel () |
HybridPICModel * | get_pointer_HybridPICModel () const |
MultiDiagnostics & | GetMultiDiags () |
ParticleBoundaryBuffer & | GetParticleBoundaryBuffer () |
std::string | GetAuthors () const |
If an authors' string is specified in the inputfile, this method returns that string. Otherwise, it returns an empty string. More... | |
bool | isFieldInitialized (FieldType field_type, int lev, int direction=0) const |
Check if a field is initialized. More... | |
amrex::MultiFab * | getFieldPointer (FieldType field_type, int lev, int direction=0) const |
Get a pointer to the field data. More... | |
std::array< const amrex::MultiFab *const, 3 > | getFieldPointerArray (FieldType field_type, int lev) const |
For vector fields, get an array of three pointers to the field data. More... | |
const amrex::MultiFab & | getField (FieldType field_type, int lev, int direction=0) const |
Get a constant reference to the field data. More... | |
bool | DoPML () const |
bool | DoFluidSpecies () const |
const PML_RZ * | getPMLRZ () |
std::vector< bool > | getPMLdirections () const |
void | setLoadBalanceEfficiency (int lev, amrex::Real efficiency) |
amrex::Real | getLoadBalanceEfficiency (int lev) |
void | applyMirrors (amrex::Real time) |
void | ComputeDt () |
void | PrintMainPICparameters () |
void | WriteUsedInputsFile () const |
void | PrintDtDxDyDz () |
void | ComputeMaxStep () |
Compute the last time step of the simulation Calls computeMaxStepBoostAccelerator() if required. More... | |
void | computeMaxStepBoostAccelerator () |
int | MoveWindow (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 | UpdateInjectionPosition (amrex::Real dt) |
Update injection position for continuous injection of particles and lasers (loops over species and lasers). More... | |
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 | HybridPICEvolveFields () |
Hybrid-PIC field evolve function. This function contains the logic involved in evolving the electric and magnetic fields in the hybrid PIC algorithm. More... | |
void | HybridPICDepositInitialRhoAndJ () |
Hybrid-PIC initial deposition function. The hybrid-PIC algorithm uses the charge and current density from both the current and previous step when updating the fields. This function deposits the initial ion charge and current (before the first particle push), to be used in the HybridPICEvolveFields() function. More... | |
void | Hybrid_QED_Push (amrex::Vector< amrex::Real > dt) |
void | Hybrid_QED_Push (int lev, amrex::Real dt) |
void | Hybrid_QED_Push (int lev, PatchType patch_type, amrex::Real dt) |
void | CheckLoadBalance (int step) |
void | LoadBalance () |
perform load balance; compute and communicate new amrex::DistributionMapping More... | |
void | ResetCosts () |
resets costs to zero More... | |
void | RescaleCosts (int step) |
utils::parser::IntervalsParser | get_load_balance_intervals () const |
returns the load balance interval More... | |
void | DampFieldsInGuards (int lev, const std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, const 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. Vector version. More... | |
void | DampFieldsInGuards (int lev, std::unique_ptr< amrex::MultiFab > &mf) |
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. Scalar version. More... | |
void | ApplyInverseVolumeScalingToCurrentDensity (amrex::MultiFab *Jx, amrex::MultiFab *Jy, amrex::MultiFab *Jz, int lev) |
void | ApplyInverseVolumeScalingToChargeDensity (amrex::MultiFab *Rho, int lev) |
void | ApplyRhofieldBoundary (int lev, amrex::MultiFab *Rho, PatchType patch_type) |
If a PEC boundary conditions is used the charge density deposited in the guard cells have to be reflected back into the simulation domain. This function performs that logic. More... | |
void | ApplyJfieldBoundary (int lev, amrex::MultiFab *Jx, amrex::MultiFab *Jy, amrex::MultiFab *Jz, PatchType patch_type) |
If a PEC boundary conditions is used the current density deposited in the guard cells have to be reflected back into the simulation domain. This function performs that logic. More... | |
void | ApplyEfieldBoundary (int lev, PatchType patch_type) |
void | ApplyBfieldBoundary (int lev, PatchType patch_type, DtType dt_type) |
void | ApplyFieldBoundaryOnAxis (amrex::MultiFab *Er, amrex::MultiFab *Et, amrex::MultiFab *Ez, int lev) const |
void | ApplyElectronPressureBoundary (int lev, PatchType patch_type) |
When the Ohm's law solver is used, the electron pressure values on PEC boundaries are set to enforce a zero derivative Neumann condition, otherwise the E_perp values have large spikes (that grows as 1/dx). This has to be done since the E-field is algebraically calculated instead of evolved which means the 1/dx growth is not avoided by multiplication with dt as happens in the B-field evolve. More... | |
void | DampPML () |
void | DampPML (int lev) |
void | DampPML (int lev, PatchType patch_type) |
void | DampPML_Cartesian (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 () |
PML * | GetPML (int lev) |
PML_RZ * | GetPML_RZ (int lev) |
void | doFieldIonization () |
void | doFieldIonization (int lev) |
void | doQEDEvents () |
void | doQEDEvents (int lev) |
void | PushParticlesandDeposit (int lev, amrex::Real cur_time, DtType a_dt_type=DtType::Full, bool skip_current=false, PushType push_type=PushType::Explicit) |
void | PushParticlesandDeposit (amrex::Real cur_time, bool skip_current=false, PushType push_type=PushType::Explicit) |
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, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryE (amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryB_avg (amrex::IntVect ng) |
void | FillBoundaryE_avg (amrex::IntVect ng) |
void | FillBoundaryF (amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryG (amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryAux (amrex::IntVect ng) |
void | FillBoundaryE (int lev, amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryB (int lev, amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryE_avg (int lev, amrex::IntVect ng) |
void | FillBoundaryB_avg (int lev, amrex::IntVect ng) |
void | FillBoundaryF (int lev, amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryG (int lev, amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryAux (int lev, amrex::IntVect ng) |
void | SyncCurrentAndRho () |
Synchronize J and rho: filter (if used), exchange guard cells, interpolate across MR levels and apply boundary conditions. Contains separate calls to WarpX::SyncCurrent and WarpX::SyncRho. More... | |
void | SyncCurrent (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_cp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_buffer) |
Apply filter and sum guard cells across MR levels. If current centering is used, center the current from a nodal grid to a staggered grid. For each MR level beyond level 0, interpolate the fine-patch current onto the coarse-patch current at the same level. Then, for each MR level, including level 0, apply filter and sum guard cells across levels. More... | |
void | SyncRho () |
void | SyncRho (const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_fp, const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_cp, const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_buffer) |
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 |
bool | getis_synchronized () const |
int | maxStep () const |
void | updateMaxStep (const int new_max_step) |
amrex::Real | stopTime () const |
void | updateStopTime (const amrex::Real new_stop_time) |
void | AverageAndPackFields (amrex::Vector< std::string > &varnames, amrex::Vector< amrex::MultiFab > &mf_avg, amrex::IntVect ngrow) const |
void | prepareFields (int 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 | ComputeDivE (amrex::MultiFab &divE, int lev) |
amrex::IntVect | getngEB () const |
amrex::IntVect | getngF () const |
amrex::IntVect | getngUpdateAux () const |
amrex::IntVect | get_ng_depos_J () const |
amrex::IntVect | get_ng_depos_rho () const |
amrex::IntVect | get_ng_fieldgather () const |
amrex::IntVect | get_numprocs () const |
void | ComputeSpaceChargeField (bool reset_fields) |
void | AddBoundaryField () |
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 > beta={{0, 0, 0}}, amrex::Real required_precision=amrex::Real(1.e-11), amrex::Real absolute_tolerance=amrex::Real(0.0), int max_iters=200, int verbosity=2) const |
void | setPhiBC (amrex::Vector< std::unique_ptr< amrex::MultiFab > > &phi) 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 > 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 > beta={{0, 0, 0}}) const |
void | computePhiTriDiagonal (const amrex::Vector< std::unique_ptr< amrex::MultiFab > > &rho, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &phi) const |
void | ComputeMagnetostaticField () |
void | AddMagnetostaticFieldLabFrame () |
void | computeVectorPotential (const amrex::Vector< amrex::Array< std::unique_ptr< amrex::MultiFab >, 3 > > &curr, amrex::Vector< amrex::Array< std::unique_ptr< amrex::MultiFab >, 3 > > &A, amrex::Real required_precision=amrex::Real(1.e-11), amrex::Real absolute_tolerance=amrex::Real(0.0), int max_iters=200, int verbosity=2) const |
void | setVectorPotentialBC (amrex::Vector< amrex::Array< std::unique_ptr< amrex::MultiFab >, 3 > > &A) 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 &edge_lengths, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &face_areas, char field, int lev, PatchType patch_type) |
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 | LoadExternalFieldsFromFile (int lev) |
Load field values from a user-specified openPMD file, for the fields Ex, Ey, Ez, Bx, By, Bz. More... | |
void | ReadExternalFieldFromFile (const std::string &read_fields_from_path, amrex::MultiFab *mf, const std::string &F_name, const std::string &F_component) |
Load field values from a user-specified openPMD file for a specific field (specified by F_name ) More... | |
void | InitializeEBGridData (int lev) |
This function initializes and calculates grid quantities used along with EBs such as edge lengths, face areas, distance to EB, etc. It also appropriately communicates EB data to 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 | ErrorEst (int lev, amrex::TagBoxArray &tags, amrex::Real time, int) final |
Tagging cells for refinement. More... | |
const AcceleratorLattice & | get_accelerator_lattice (int lev) |
void | BuildBufferMasksInBox (amrex::Box tbx, amrex::IArrayBox &buffer_mask, const amrex::IArrayBox &guard_mask, int ng) |
Build buffer mask within given FArrayBox. More... | |
void | InitEB () |
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... | |
void | ApplyBCKCorrection (int idim) |
Whenever an unstable cell cannot be extended we increase its area to be the minimal for stability. This is the method Benkler-Chavannes-Kuster method and it is less accurate than the regular ECT but it still works better than staircasing. (see https://ieeexplore.ieee.org/document/1638381) More... | |
void | PSATDSubtractCurrentPartialSumsAvg () |
Subtract the average of the cumulative sums of the preliminary current D from the current J (computed from D according to the Vay deposition scheme) More... | |
SpectralSolverRZ & | get_spectral_solver_fp (int lev) |
FiniteDifferenceSolver * | get_pointer_fdtd_solver_fp (int lev) |
Public Member Functions inherited from amrex::AmrCore | |
AmrCore () | |
AmrCore (const RealBox *rb, int max_level_in, const Vector< int > &n_cell_in, int coord=-1, Vector< IntVect > ref_ratios=Vector< IntVect >(), const int *is_per=nullptr) | |
AmrCore (const RealBox &rb, int max_level_in, const Vector< int > &n_cell_in, int coord, Vector< IntVect > const &ref_ratios, Array< int, AMREX_SPACEDIM > const &is_per) | |
AmrCore (Geometry const &level_0_geom, AmrInfo const &amr_info) | |
AmrCore (AmrCore &&rhs) noexcept | |
AmrCore & | operator= (AmrCore &&rhs) noexcept |
AmrCore (const AmrCore &rhs)=delete | |
AmrCore & | operator= (const AmrCore &rhs)=delete |
~AmrCore () override | |
void | InitFromScratch (Real time) |
virtual void | regrid (int lbase, Real time, bool initial=false) |
void | printGridSummary (std::ostream &os, int min_lev, int max_lev) const noexcept |
Public Member Functions inherited from amrex::AmrMesh | |
AmrMesh () | |
AmrMesh (const RealBox *rb, int max_level_in, const Vector< int > &n_cell_in, int coord=-1, Vector< IntVect > refrat=Vector< IntVect >(), const int *is_per=nullptr) | |
AmrMesh (const RealBox &rb, int max_level_in, const Vector< int > &n_cell_in, int coord, Vector< IntVect > const &a_refrat, Array< int, AMREX_SPACEDIM > const &is_per) | |
AmrMesh (Geometry const &level_0_geom, AmrInfo const &amr_info) | |
AmrMesh (const AmrMesh &rhs)=delete | |
AmrMesh & | operator= (const AmrMesh &rhs)=delete |
AmrMesh (AmrMesh &&rhs)=default | |
AmrMesh & | operator= (AmrMesh &&rhs)=default |
virtual | ~AmrMesh ()=default |
int | Verbose () const noexcept |
int | maxLevel () const noexcept |
int | finestLevel () const noexcept |
IntVect | refRatio (int lev) const noexcept |
int | MaxRefRatio (int lev) const noexcept |
const Vector< IntVect > & | refRatio () const noexcept |
const Vector< Geometry > & | Geom () const noexcept |
const Vector< DistributionMapping > & | DistributionMap () const noexcept |
const Vector< BoxArray > & | boxArray () const noexcept |
const Geometry & | Geom (int lev) const noexcept |
const DistributionMapping & | DistributionMap (int lev) const noexcept |
const BoxArray & | boxArray (int lev) const noexcept |
Vector< Geometry > | Geom (int a_coarsest_lev, int a_finest_lev) const noexcept |
Vector< BoxArray > | boxArray (int a_coarsest_lev, int a_finest_lev) const noexcept |
Vector< DistributionMapping > | DistributionMap (int a_coarsest_lev, int a_finest_lev) const noexcept |
Vector< Geometry > & | Geom () noexcept |
Geometry & | Geom (int lev) noexcept |
void | SetMaxGridSize (int new_mgs) noexcept |
void | SetMaxGridSize (const IntVect &new_mgs) noexcept |
void | SetMaxGridSize (const Vector< int > &new_mgs) noexcept |
void | SetMaxGridSize (const Vector< IntVect > &new_mgs) noexcept |
void | SetBlockingFactor (int new_bf) noexcept |
void | SetBlockingFactor (const IntVect &new_bf) noexcept |
void | SetBlockingFactor (const Vector< int > &new_bf) noexcept |
void | SetBlockingFactor (const Vector< IntVect > &new_bf) noexcept |
void | SetGridEff (Real eff) noexcept |
void | SetNProper (int n) noexcept |
void | SetFinestLevel (int new_finest_level) noexcept |
void | SetDistributionMap (int lev, const DistributionMapping &dmap_in) noexcept |
void | SetBoxArray (int lev, const BoxArray &ba_in) noexcept |
void | SetGeometry (int lev, const Geometry &geom_in) noexcept |
int | GetLevel (Box const &domain) noexcept |
void | ClearDistributionMap (int lev) noexcept |
void | ClearBoxArray (int lev) noexcept |
int | nErrorBuf (int lev, int direction=0) const noexcept |
const IntVect & | nErrorBufVect (int lev) const noexcept |
Real | gridEff () const noexcept |
int | nProper () const noexcept |
const IntVect & | blockingFactor (int lev) const noexcept |
const IntVect & | maxGridSize (int lev) const noexcept |
bool | LevelDefined (int lev) noexcept |
bool | useFixedCoarseGrids () const noexcept |
int | useFixedUpToLevel () const noexcept |
void | ChopGrids (int lev, BoxArray &ba, int target_size) const |
BoxArray | MakeBaseGrids () const |
void | MakeNewGrids (int lbase, Real time, int &new_finest, Vector< BoxArray > &new_grids) |
void | MakeNewGrids (Real time=0.0) |
virtual void | ManualTagsPlacement (int, TagBoxArray &, const Vector< IntVect > &) |
virtual BoxArray | GetAreaNotToTag (int) |
long | CountCells (int lev) noexcept |
virtual DistributionMapping | MakeDistributionMap (int lev, BoxArray const &ba) |
Static Public Member Functions | |
static WarpX & | GetInstance () |
static void | ResetInstance () |
static void | Finalize () |
This method has to be called at the end of the simulation. It deletes the WarpX instance. More... | |
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, int lev, bool update_cost_flag, amrex::Real external_field=0.0, bool useparser=false, amrex::ParserExecutor< 3 > const &field_parser={}) |
static void | AllocInitMultiFab (std::unique_ptr< amrex::MultiFab > &mf, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm, int ncomp, const amrex::IntVect &ngrow, int level, const std::string &name, std::optional< const amrex::Real > initial_value={}) |
Allocate and optionally initialize the MultiFab. This also adds the MultiFab to the map of MultiFabs (used to ease the access to MultiFabs from the Python interface. More... | |
static void | AllocInitMultiFab (std::unique_ptr< amrex::iMultiFab > &mf, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm, int ncomp, const amrex::IntVect &ngrow, int level, const std::string &name, std::optional< const int > initial_value={}) |
Allocate and optionally initialize the iMultiFab. This also adds the iMultiFab to the map of MultiFabs (used to ease the access to MultiFabs from the Python interface. More... | |
static void | AliasInitMultiFab (std::unique_ptr< amrex::MultiFab > &mf, const amrex::MultiFab &mf_to_alias, int scomp, int ncomp, int level, const std::string &name, std::optional< const amrex::Real > initial_value) |
Create an alias of a MultiFab, adding the alias to the MultiFab map. More... | |
static void | AllocInitMultiFabFromModel (std::unique_ptr< amrex::MultiFab > &mf, amrex::MultiFab &mf_model, int level, const std::string &name, std::optional< const amrex::Real > initial_value={}) |
Allocate the MultiFab so that is like the specified MultiFab (same ba and dm) and optionally initialize it. This also adds the MultiFab to the map of MultiFabs (used to ease the access to MultiFabs from the Python interface. More... | |
static amrex::LayoutData< amrex::Real > * | getCosts (int lev) |
static bool | isAnyParticleBoundaryThermal () |
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, int lev, amrex::Real time_shift_delta) |
Return the lower corner of the box in real units. More... | |
static std::array< amrex::Real, 3 > | UpperCorner (const amrex::Box &bx, int lev, amrex::Real time_shift_delta) |
Return the upper corner of the box in real units. More... | |
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 dcomp, const std::array< const amrex::MultiFab *const, 3 > &B, const std::array< amrex::Real, 3 > &dx) |
static void | ComputeDivB (amrex::MultiFab &divB, int dcomp, const std::array< const amrex::MultiFab *const, 3 > &B, const std::array< amrex::Real, 3 > &dx, amrex::IntVect ngrow) |
static amrex::Vector< amrex::Real > | getFornbergStencilCoefficients (int n_order, short a_grid_type) |
Returns an array of coefficients (Fornberg coefficients), corresponding to the weight of each point in a finite-difference approximation of a derivative (up to order n_order ). More... | |
Static Public Attributes | |
static short | current_deposition_algo |
Integer that corresponds to the current deposition algorithm (Esirkepov, direct, Vay, Villasenor) More... | |
static short | charge_deposition_algo |
Integer that corresponds to the charge deposition algorithm (only standard deposition) More... | |
static short | field_gathering_algo |
Integer that corresponds to the field gathering algorithm (energy-conserving, momentum-conserving) More... | |
static short | particle_pusher_algo |
Integer that corresponds to the particle push algorithm (Boris, Vay, Higuera-Cary) More... | |
static short | electromagnetic_solver_id |
Integer that corresponds to the type of Maxwell solver (Yee, CKC, PSATD, ECT) More... | |
static short | evolve_scheme |
Integer that corresponds to the evolve scheme (explicit, implicit_picard, semi_implicit_picard) More... | |
static int | max_picard_iterations = 10 |
The maximum number of Picard iterations to do each time step. More... | |
static amrex::Real | picard_iteration_tolerance = 1.e-7 |
The tolerance for the Picard iteration convergence. More... | |
static bool | require_picard_convergence = true |
Flags whether the Picard iterations are required to converge. More... | |
static short | load_balance_costs_update_algo |
static int | em_solver_medium |
Integer that corresponds to electromagnetic Maxwell solver (vacuum - 0, macroscopic - 1) More... | |
static int | macroscopic_solver_algo |
static amrex::Vector< FieldBoundaryType > | field_boundary_lo |
static amrex::Vector< FieldBoundaryType > | field_boundary_hi |
static amrex::Vector< ParticleBoundaryType > | particle_boundary_lo |
static amrex::Vector< ParticleBoundaryType > | particle_boundary_hi |
static short | psatd_solution_type |
static short | J_in_time |
static short | rho_in_time |
static bool | do_current_centering = false |
static bool | do_single_precision_comms = false |
perform field communications in single precision More... | |
static bool | do_shared_mem_charge_deposition = false |
used shared memory algorithm for charge deposition More... | |
static bool | do_shared_mem_current_deposition = false |
use shared memory algorithm for current deposition More... | |
static int | shared_mem_current_tpb = 128 |
number of threads to use per block in shared deposition More... | |
static amrex::IntVect | shared_tilesize |
tileSize to use for shared current deposition operations More... | |
static amrex::IntVect | m_fill_guards_fields = amrex::IntVect(0) |
Whether to fill guard cells when computing inverse FFTs of fields. More... | |
static amrex::IntVect | m_fill_guards_current = amrex::IntVect(0) |
Whether to fill guard cells when computing inverse FFTs of currents. More... | |
static bool | do_dive_cleaning = false |
static bool | do_divb_cleaning = false |
Solve additional Maxwell equation for G in order to control errors in magnetic Gauss' law. More... | |
static int | nox = 0 |
Order of the particle shape factors (splines) along x. More... | |
static int | noy = 0 |
Order of the particle shape factors (splines) along y. More... | |
static int | noz = 0 |
Order of the particle shape factors (splines) along z. More... | |
static int | field_centering_nox = 2 |
Order of finite centering of fields (from staggered grid to nodal grid), along x. More... | |
static int | field_centering_noy = 2 |
Order of finite centering of fields (from staggered grid to nodal grid), along y. More... | |
static int | field_centering_noz = 2 |
Order of finite centering of fields (from staggered grid to nodal grid), along z. More... | |
static int | current_centering_nox = 2 |
Order of finite centering of currents (from nodal grid to staggered grid), along x. More... | |
static int | current_centering_noy = 2 |
Order of finite centering of currents (from nodal grid to staggered grid), along y. More... | |
static int | current_centering_noz = 2 |
Order of finite centering of currents (from nodal grid to staggered grid), along z. More... | |
static int | n_rz_azimuthal_modes = 1 |
Number of modes for the RZ multi-mode version. More... | |
static int | ncomps = 1 |
static bool | use_fdtd_nci_corr = false |
static bool | galerkin_interpolation = true |
static bool | verboncoeur_axis_correction = true |
static bool | use_filter = true |
If true, a bilinear filter is used to smooth charge and currents. More... | |
static bool | use_kspace_filter = true |
If true, the bilinear filtering of charge and currents is done in Fourier space. More... | |
static bool | use_filter_compensation = false |
If true, a compensation step is added to the bilinear filtering of charge and currents. More... | |
static bool | serialize_initial_conditions = false |
If true, the initial conditions from random number generators are serialized (useful for reproducible testing with OpenMP) More... | |
static amrex::Real | gamma_boost = 1._rt |
Lorentz factor of the boosted frame in which a boosted-frame simulation is run. More... | |
static amrex::Real | beta_boost = 0._rt |
Beta value corresponding to the Lorentz factor of the boosted frame of the simulation. More... | |
static amrex::Vector< int > | boost_direction = {0,0,0} |
Direction of the Lorentz transform that defines the boosted frame of the simulation. More... | |
static amrex::Real | zmax_plasma_to_compute_max_step = 0._rt |
static bool | do_compute_max_step_from_zmax = false |
static amrex::Real | zmin_domain_boost_step_0 = 0._rt |
static bool | compute_max_step_from_btd = false |
If true, the code will compute max_step from the back transformed diagnostics. More... | |
static bool | do_dynamic_scheduling = true |
static bool | refine_plasma = false |
static utils::parser::IntervalsParser | sort_intervals |
static amrex::IntVect | sort_bin_size |
static bool | sort_particles_for_deposition = false |
If true, particles will be sorted in the order x -> y -> z -> ppc for faster deposition. More... | |
static amrex::IntVect | sort_idx_type |
Specifies the type of grid used for the above sorting, i.e. cell-centered, nodal, or mixed. More... | |
static bool | do_subcycling = false |
static bool | do_multi_J = false |
static int | do_multi_J_n_depositions |
static bool | do_device_synchronize = false |
static bool | safe_guard_cells = false |
static int | n_field_gather_buffer = -1 |
static int | n_current_deposition_buffer = -1 |
static short | grid_type |
static std::map< std::string, amrex::MultiFab * > | multifab_map |
static std::map< std::string, amrex::iMultiFab * > | imultifab_map |
static amrex::IntVect | filter_npass_each_dir |
static int | num_mirrors = 0 |
static amrex::Real | quantum_xi_c2 = PhysConst::xi_c2 |
static int | electrostatic_solver_id |
static int | poisson_solver_id |
static amrex::Real | self_fields_required_precision = 1.e-11_rt |
static amrex::Real | self_fields_absolute_tolerance = 0.0_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 |
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_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_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... | |
void | PostProcessBaseGrids (amrex::BoxArray &ba0) const final |
void | MakeNewLevelFromScratch (int lev, amrex::Real time, const amrex::BoxArray &new_grids, const amrex::DistributionMapping &new_dmap) final |
void | MakeNewLevelFromCoarse (int, amrex::Real, const amrex::BoxArray &, const amrex::DistributionMapping &) final |
void | RemakeLevel (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) final |
void | ClearLevel (int lev) final |
Delete level data. Called by AmrCore::regrid. More... | |
Protected Member Functions inherited from amrex::AmrCore | |
void | ErrorEst (int lev, TagBoxArray &tags, Real time, int ngrow) override=0 |
void | MakeNewLevelFromScratch (int lev, Real time, const BoxArray &ba, const DistributionMapping &dm) override=0 |
virtual void | MakeNewLevelFromCoarse (int lev, Real time, const BoxArray &ba, const DistributionMapping &dm)=0 |
virtual void | RemakeLevel (int lev, Real time, const BoxArray &ba, const DistributionMapping &dm)=0 |
Protected Member Functions inherited from amrex::AmrMesh | |
void | checkInput () |
void | SetIterateToFalse () noexcept |
void | SetUseNewChop () noexcept |
Private Member Functions | |
WarpX () | |
WarpX constructor. This method should not be called directly, but rather through the static member function MakeWarpX(). MakeWarpX() is called by GetInstance () if an instance of the WarpX class does not currently exist. More... | |
void | HandleSignals () |
Complete the asynchronous broadcast of signal flags, and initiate a checkpoint if requested. More... | |
void | FillBoundaryB (int lev, PatchType patch_type, amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryE (int lev, PatchType patch_type, amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryF (int lev, PatchType patch_type, amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryG (int lev, PatchType patch_type, amrex::IntVect ng, std::optional< bool > nodal_sync=std::nullopt) |
void | FillBoundaryB_avg (int lev, PatchType patch_type, amrex::IntVect ng) |
void | FillBoundaryE_avg (int lev, PatchType patch_type, amrex::IntVect ng) |
void | AddExternalFields () |
void | OneStep_nosub (amrex::Real cur_time) |
void | OneStep_sub1 (amrex::Real cur_time) |
void | OneStep_ImplicitPicard (amrex::Real cur_time) |
void | OneStep_multiJ (amrex::Real cur_time) |
Perform one PIC iteration, with the multiple J deposition per time step. More... | |
void | RestrictCurrentFromFineToCoarsePatch (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_cp, 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 (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_cp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_buffer, int lev) |
void | StoreCurrent (int lev) |
void | RestoreCurrent (int lev) |
void | ApplyFilterJ (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> ¤t, int lev, int idim) |
void | ApplyFilterJ (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> ¤t, int lev) |
void | SumBoundaryJ (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> ¤t, int lev, int idim, const amrex::Periodicity &period) |
void | SumBoundaryJ (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> ¤t, int lev, const amrex::Periodicity &period) |
void | NodalSyncJ (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_cp, int lev, PatchType patch_type) |
void | RestrictRhoFromFineToCoarsePatch (const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_fp, const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_cp, int lev) |
void | ApplyFilterandSumBoundaryRho (const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_fp, const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_cp, int lev, PatchType patch_type, int icomp, int ncomp) |
void | AddRhoFromFineLevelandSumBoundary (const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_fp, const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_cp, const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_buffer, int lev, int icomp, int ncomp) |
void | NodalSyncRho (const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_fp, const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_cp, int lev, PatchType patch_type, int icomp, int ncomp) |
void | ReadParameters () |
void | BackwardCompatibility () |
void | InitFromScratch () |
void | AllocLevelData (int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) |
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 | CheckKnownIssues () |
Checks for known numerical issues involving different WarpX modules. More... | |
void | PerformanceHints () |
void | BuildBufferMasks () |
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, 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, int centering_nox, int centering_noy, int centering_noz, short a_grid_type) |
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 &ngEB, amrex::IntVect &ngJ, const amrex::IntVect &ngRho, const amrex::IntVect &ngF, const amrex::IntVect &ngG, bool aux_is_nodal) |
void | AllocLevelSpectralSolverRZ (amrex::Vector< std::unique_ptr< SpectralSolverRZ >> &spectral_solver, int lev, const amrex::BoxArray &realspace_ba, const amrex::DistributionMapping &dm, const std::array< amrex::Real, 3 > &dx) |
amrex::MultiFab * | getFieldPointerUnchecked (FieldType field_type, int lev, int direction=0) const |
Get a pointer to the field data. Does not check if the pointer is not nullptr. More... | |
amrex::FabFactory< amrex::FArrayBox > const & | fieldFactory (int lev) const noexcept |
bool | checkStopSimulation (amrex::Real cur_time) |
void | checkEarlyUnusedParams () |
void | HandleParticlesAtBoundaries (int step, amrex::Real cur_time, int num_moved) |
void | ScrapeParticles () |
void | ExplicitFillBoundaryEBUpdateAux () |
void | PushPSATD () |
void | PSATDForwardTransformEB (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &E_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &B_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &E_cp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &B_cp) |
Forward FFT of E,B on all mesh refinement levels. More... | |
void | PSATDBackwardTransformEB (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &E_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &B_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &E_cp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &B_cp) |
Backward FFT of E,B on all mesh refinement levels, with field damping in the guard cells (if needed) More... | |
void | PSATDBackwardTransformEBavg (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &E_avg_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &B_avg_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &E_avg_cp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &B_avg_cp) |
Backward FFT of averaged E,B on all mesh refinement levels. More... | |
void | PSATDForwardTransformJ (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_cp, bool apply_kspace_filter=true) |
Forward FFT of J on all mesh refinement levels, with k-space filtering (if needed) More... | |
void | PSATDBackwardTransformJ (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_fp, const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &J_cp) |
Backward FFT of J on all mesh refinement levels. More... | |
void | PSATDForwardTransformRho (const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_fp, const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &charge_cp, int icomp, int dcomp, bool apply_kspace_filter=true) |
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 (when rho is linear in time) 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 | PSATDCurrentCorrection () |
Correct current in Fourier space so that the continuity equation is satisfied. More... | |
void | PSATDVayDeposition () |
Vay deposition in Fourier space (https://doi.org/10.1016/j.jcp.2013.03.010) More... | |
void | PSATDPushSpectralFields () |
Update all necessary fields in spectral space. More... | |
void | PSATDScaleAverageFields (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... | |
Static Private Member Functions | |
static void | MakeWarpX () |
This method creates a new instance of the WarpX class. More... | |
Static Private Attributes | |
static WarpX * | m_instance = nullptr |
static int | do_similar_dm_pml = 1 |
static constexpr bool | sync_nodal_points = true |
Friends | |
class | PML |
Additional Inherited Members | |
Protected Attributes inherited from amrex::AmrMesh | |
int | finest_level |
Vector< Geometry > | geom |
Vector< DistributionMapping > | dmap |
Vector< BoxArray > | grids |
unsigned int | num_setdm |
unsigned int | num_setba |
Protected Attributes inherited from amrex::AmrInfo | |
int | verbose |
int | max_level |
Vector< IntVect > | ref_ratio |
Vector< IntVect > | blocking_factor |
Vector< IntVect > | max_grid_size |
Vector< IntVect > | n_error_buf |
Real | grid_eff |
int | n_proper |
int | use_fixed_upto_level |
bool | use_fixed_coarse_grids |
bool | refine_grid_layout |
IntVect | refine_grid_layout_dims |
bool | check_input |
bool | use_new_chop |
bool | iterate_on_new_grids |
|
override |
Destructor
|
delete |
Copy constructor
|
default |
Move constructor
|
private |
WarpX constructor. This method should not be called directly, but rather through the static member function MakeWarpX(). MakeWarpX() is called by GetInstance () if an instance of the WarpX class does not currently exist.
void WarpX::AddBoundaryField | ( | ) |
|
private |
|
private |
void WarpX::AddMagnetostaticFieldLabFrame | ( | ) |
|
private |
void WarpX::AddSpaceChargeField | ( | WarpXParticleContainer & | pc | ) |
void WarpX::AddSpaceChargeFieldLabFrame | ( | ) |
|
static |
Create an alias of a MultiFab, adding the alias to the MultiFab map.
[out] | mf | The MultiFab to create |
[in] | mf_to_alias | The MultiFab to alias |
[in] | scomp | The starting component to be aliased |
[in] | ncomp | The number of components to alias |
[in] | level | The refinement level |
[in] | name | The name of the MultiFab to use in the map |
[in] | initial_value | optional initial value for MultiFab |
|
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 |
[in] | a_grid_type | type of grid (collocated or not) |
|
static |
Allocate and optionally initialize the iMultiFab. This also adds the iMultiFab to the map of MultiFabs (used to ease the access to MultiFabs from the Python interface.
[out] | mf | The iMultiFab unique pointer to be allocated |
[in] | ba | The BoxArray describing the iMultiFab |
[in] | dm | The DistributionMapping describing the iMultiFab |
[in] | ncomp | The number of components in the iMultiFab |
[in] | ngrow | The number of guard cells in the iMultiFab |
[in] | level | The refinement level |
[in] | name | The name of the iMultiFab to use in the map |
[in] | initial_value | The optional initial value |
|
static |
Allocate and optionally initialize the MultiFab. This also adds the MultiFab to the map of MultiFabs (used to ease the access to MultiFabs from the Python interface.
[out] | mf | The MultiFab unique pointer to be allocated |
[in] | ba | The BoxArray describing the MultiFab |
[in] | dm | The DistributionMapping describing the MultiFab |
[in] | ncomp | The number of components in the MultiFab |
[in] | ngrow | The number of guard cells in the MultiFab |
[in] | level | The refinement level |
[in] | name | The name of the MultiFab to use in the map |
[in] | initial_value | The optional initial value |
|
static |
Allocate the MultiFab so that is like the specified MultiFab (same ba and dm) and optionally initialize it. This also adds the MultiFab to the map of MultiFabs (used to ease the access to MultiFabs from the Python interface.
mf[out] | The MultiFab unique pointer to be allocated |
mf_model[in] | The MultiFab to model |
name[in] | The name of the MultiFab to use in the map |
initial_value[in] | The optional initial value |
|
private |
|
private |
|
private |
void WarpX::ApplyBCKCorrection | ( | int | idim | ) |
Whenever an unstable cell cannot be extended we increase its area to be the minimal for stability. This is the method Benkler-Chavannes-Kuster method and it is less accurate than the regular ECT but it still works better than staircasing. (see https://ieeexplore.ieee.org/document/1638381)
idim | Integer indicating the dimension (x->0, y->1, z->2) for which the BCK correction is done |
When the Ohm's law solver is used, the electron pressure values on PEC boundaries are set to enforce a zero derivative Neumann condition, otherwise the E_perp values have large spikes (that grows as 1/dx). This has to be done since the E-field is algebraically calculated instead of evolved which means the 1/dx growth is not avoided by multiplication with dt as happens in the B-field evolve.
void WarpX::ApplyFieldBoundaryOnAxis | ( | amrex::MultiFab * | Er, |
amrex::MultiFab * | Et, | ||
amrex::MultiFab * | Ez, | ||
int | lev | ||
) | const |
|
private |
void WarpX::ApplyFilterandSumBoundaryRho | ( | int | lev, |
int | glev, | ||
amrex::MultiFab & | rho, | ||
int | icomp, | ||
int | ncomp | ||
) |
|
private |
|
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::ApplyJfieldBoundary | ( | int | lev, |
amrex::MultiFab * | Jx, | ||
amrex::MultiFab * | Jy, | ||
amrex::MultiFab * | Jz, | ||
PatchType | patch_type | ||
) |
If a PEC boundary conditions is used the current density deposited in the guard cells have to be reflected back into the simulation domain. This function performs that logic.
void WarpX::applyMirrors | ( | amrex::Real | time | ) |
void WarpX::ApplyRhofieldBoundary | ( | int | lev, |
amrex::MultiFab * | Rho, | ||
PatchType | patch_type | ||
) |
If a PEC boundary conditions is used the charge density deposited in the guard cells have to be reflected back into the simulation domain. This function performs that logic.
void WarpX::AverageAndPackFields | ( | amrex::Vector< std::string > & | varnames, |
amrex::Vector< amrex::MultiFab > & | mf_avg, | ||
amrex::IntVect | ngrow | ||
) | const |
|
private |
This function queries deprecated input parameters and abort the run if one of them is specified.
|
private |
void WarpX::BuildBufferMasksInBox | ( | amrex::Box | tbx, |
amrex::IArrayBox & | buffer_mask, | ||
const amrex::IArrayBox & | guard_mask, | ||
int | ng | ||
) |
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 |
Print Unused Parameter Warnings after Step 1
Instead of waiting for a simulation to end, we already do an early "unused parameter check" after step 1 to inform users early of potential issues with their simulation setup.
|
private |
Check that the number of guard cells is smaller than the number of valid cells, for all available MultiFabs, and abort otherwise.
|
private |
Checks for known numerical issues involving different WarpX modules.
void WarpX::CheckLoadBalance | ( | int | step | ) |
Check and potentially compute load balancing
|
private |
Stop the simulation at the end of the current step?
|
finalprotectedvirtual |
Delete level data. Called by AmrCore::regrid.
Implements amrex::AmrCore.
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 > | 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, |
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 > | beta = {{0,0,0}} |
||
) | const |
void WarpX::ComputeEightWaysExtensions | ( | ) |
Do the eight-ways extension.
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::ComputeMagnetostaticField | ( | ) |
void WarpX::ComputeMaxStep | ( | ) |
Compute the last time step of the simulation Calls computeMaxStepBoostAccelerator() if required.
void WarpX::computeMaxStepBoostAccelerator | ( | ) |
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 > | beta = {{0,0,0}} , |
||
amrex::Real | required_precision = amrex::Real(1.e-11) , |
||
amrex::Real | absolute_tolerance = amrex::Real(0.0) , |
||
int | max_iters = 200 , |
||
int | verbosity = 2 |
||
) | const |
void WarpX::computePhiTriDiagonal | ( | const amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | rho, |
amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | phi | ||
) | const |
|
private |
void WarpX::ComputeSpaceChargeField | ( | bool | reset_fields | ) |
void WarpX::computeVectorPotential | ( | const amrex::Vector< amrex::Array< std::unique_ptr< amrex::MultiFab >, 3 > > & | curr, |
amrex::Vector< amrex::Array< std::unique_ptr< amrex::MultiFab >, 3 > > & | A, | ||
amrex::Real | required_precision = amrex::Real(1.e-11) , |
||
amrex::Real | absolute_tolerance = amrex::Real(0.0) , |
||
int | max_iters = 200 , |
||
int | verbosity = 2 |
||
) | const |
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.
void WarpX::DampFieldsInGuards | ( | int | lev, |
const std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, | ||
const 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. Vector version.
void WarpX::DampFieldsInGuards | ( | int | lev, |
std::unique_ptr< amrex::MultiFab > & | mf | ||
) |
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. Scalar version.
void WarpX::DampJPML | ( | ) |
void WarpX::DampJPML | ( | int | lev | ) |
void WarpX::DampPML | ( | ) |
void WarpX::DampPML | ( | int | lev | ) |
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 |
|
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 |
|
final |
Tagging cells for refinement.
void WarpX::Evolve | ( | int | numsteps = -1 | ) |
reduced diags
void WarpX::EvolveB | ( | amrex::Real | dt, |
DtType | dt_type | ||
) |
void WarpX::EvolveE | ( | amrex::Real | dt | ) |
void WarpX::EvolveE | ( | int | lev, |
amrex::Real | dt | ||
) |
void WarpX::EvolveF | ( | amrex::Real | dt, |
DtType | dt_type | ||
) |
void WarpX::EvolveG | ( | amrex::Real | dt, |
DtType | dt_type | ||
) |
void WarpX::EvolveImplicitPicardInit | ( | int | lev | ) |
|
private |
Update the E and B fields in the explicit em PIC scheme.
At the beginning, we have B^{n} and E^{n}. Particles have p^{n} and x^{n}.
|
inlineprivatenoexcept |
void WarpX::FillBoundaryAux | ( | amrex::IntVect | ng | ) |
void WarpX::FillBoundaryAux | ( | int | lev, |
amrex::IntVect | ng | ||
) |
void WarpX::FillBoundaryB | ( | amrex::IntVect | ng, |
std::optional< bool > | nodal_sync = std::nullopt |
||
) |
void WarpX::FillBoundaryB | ( | int | lev, |
amrex::IntVect | ng, | ||
std::optional< bool > | nodal_sync = std::nullopt |
||
) |
|
private |
void WarpX::FillBoundaryB_avg | ( | amrex::IntVect | ng | ) |
void WarpX::FillBoundaryB_avg | ( | int | lev, |
amrex::IntVect | ng | ||
) |
|
private |
void WarpX::FillBoundaryE | ( | amrex::IntVect | ng, |
std::optional< bool > | nodal_sync = std::nullopt |
||
) |
void WarpX::FillBoundaryE | ( | int | lev, |
amrex::IntVect | ng, | ||
std::optional< bool > | nodal_sync = std::nullopt |
||
) |
|
private |
void WarpX::FillBoundaryE_avg | ( | amrex::IntVect | ng | ) |
void WarpX::FillBoundaryE_avg | ( | int | lev, |
amrex::IntVect | ng | ||
) |
|
private |
void WarpX::FillBoundaryF | ( | amrex::IntVect | ng, |
std::optional< bool > | nodal_sync = std::nullopt |
||
) |
void WarpX::FillBoundaryF | ( | int | lev, |
amrex::IntVect | ng, | ||
std::optional< bool > | nodal_sync = std::nullopt |
||
) |
|
private |
void WarpX::FillBoundaryG | ( | amrex::IntVect | ng, |
std::optional< bool > | nodal_sync = std::nullopt |
||
) |
void WarpX::FillBoundaryG | ( | int | lev, |
amrex::IntVect | ng, | ||
std::optional< bool > | nodal_sync = std::nullopt |
||
) |
|
private |
|
static |
This method has to be called at the end of the simulation. It deletes the WarpX instance.
void WarpX::FinishImplicitFieldUpdate | ( | amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > & | Efield_fp, |
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > & | Efield_n | ||
) |
void WarpX::FinishImplicitParticleUpdate | ( | WarpXParticleContainer & | pc, |
int | lev | ||
) |
|
inline |
|
inline |
returns the load balance interval
|
inline |
|
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 |
If an authors' string is specified in the inputfile, this method returns that string. Otherwise, it returns an empty string.
|
static |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
const amrex::MultiFab & WarpX::getField | ( | FieldType | field_type, |
int | lev, | ||
int | direction = 0 |
||
) | const |
Get a constant reference to the field data.
field_type[in] | the field type |
lev[in] | the mesh refinement level |
direction[in] | the field component (0 by default) |
amrex::MultiFab * WarpX::getFieldPointer | ( | FieldType | field_type, |
int | lev, | ||
int | direction = 0 |
||
) | const |
Get a pointer to the field data.
field_type[in] | the field type |
lev[in] | the mesh refinement level |
direction[in] | the field component (0 by default) |
std::array< const amrex::MultiFab *const, 3 > WarpX::getFieldPointerArray | ( | FieldType | field_type, |
int | lev | ||
) | const |
For vector fields, get an array of three pointers to the field data.
field_type[in] | the field type |
lev[in] | the mesh refinement level |
|
private |
Get a pointer to the field data. Does not check if the pointer is not nullptr.
field_type[in] | the field type |
lev[in] | the mesh refinement level |
direction[in] | the field component (0 by default) |
|
inline |
|
static |
Returns an array of coefficients (Fornberg coefficients), corresponding to the weight of each point in a finite-difference approximation of a derivative (up to order n_order
).
[in] | n_order | order of the finite-difference approximation |
[in] | a_grid_type | type of grid (collocated or not) |
|
inlineprivate |
|
inline |
|
static |
|
inline |
|
inline |
amrex::Real WarpX::getLoadBalanceEfficiency | ( | int | lev | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::vector< bool > WarpX::getPMLdirections | ( | ) | const |
get low-high-low-high-... vector for each direction indicating if mother grid PMLs are enabled
|
inline |
|
static |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
Perform essential particle house keeping at boundaries
Inject, communicate, scrape and sort particles.
step | current step |
cur_time | current time |
num_moved | number of cells the moving window moved |
|
private |
Complete the asynchronous broadcast of signal flags, and initiate a checkpoint if requested.
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 |
apply QED correction on electric field for level lev and patch type patch_type
lev | mesh refinement level |
patch_type | which MR patch: PatchType::fine or PatchType::coarse |
dt | time step |
void WarpX::HybridPICDepositInitialRhoAndJ | ( | ) |
Hybrid-PIC initial deposition function. The hybrid-PIC algorithm uses the charge and current density from both the current and previous step when updating the fields. This function deposits the initial ion charge and current (before the first particle push), to be used in the HybridPICEvolveFields()
function.
void WarpX::HybridPICEvolveFields | ( | ) |
Hybrid-PIC field evolve function. This function contains the logic involved in evolving the electric and magnetic fields in the hybrid PIC algorithm.
void WarpX::InitBorrowing | ( | ) |
Initialize the memory for the FaceInfoBoxes.
void WarpX::InitData | ( | ) |
|
private |
void WarpX::InitEB | ( | ) |
|
private |
|
private |
|
private |
void WarpX::InitializeEBGridData | ( | int | lev | ) |
This function initializes and calculates grid quantities used along with EBs such as edge lengths, face areas, distance to EB, etc. It also appropriately communicates EB data to guard cells.
[in] | lev | level of the Multifabs that is initialized |
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 & | edge_lengths, | ||
std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | face_areas, | ||
char | field, | ||
int | lev, | ||
PatchType | patch_type | ||
) |
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] | edge_lengths | edge lengths information |
[in] | face_areas | face areas information |
[in] | field | flag indicating which field is being initialized ('E' for electric, 'B' for magnetic) |
[in] | lev | level of the Multifabs that is initialized |
[in] | patch_type | PatchType on which the field is initialized (fine or coarse) |
|
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_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_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 | ( | ) |
|
static |
True if any of the particle boundary condition type is Thermal
Check if a field is initialized.
field_type[in] | the field type |
lev[in] | the mesh refinement level |
direction[in] | the field component (0 by default) |
void WarpX::LoadBalance | ( | ) |
perform load balance; compute and communicate new amrex::DistributionMapping
void WarpX::LoadExternalFieldsFromFile | ( | int | lev | ) |
Load field values from a user-specified openPMD file, for the fields Ex, Ey, Ez, Bx, By, Bz.
|
static |
Return the lower corner of the box in real units.
bx | The box |
lev | The refinement level of the box |
time_shift_delta | The time relative to the current time at which to calculate the position (when v_galilean is not zero) |
void WarpX::MacroscopicEvolveE | ( | amrex::Real | dt | ) |
void WarpX::MacroscopicEvolveE | ( | int | lev, |
amrex::Real | dt | ||
) |
|
finalprotected |
Make a new level using provided BoxArray and DistributionMapping and fill with interpolated coarse level data. Called by AmrCore::regrid.
|
finalprotected |
Make a new level from scratch using provided BoxArray and DistributionMapping. Only used during initialization. Called by AmrCoreInitFromScratch.
|
staticprivate |
This method creates a new instance of the WarpX class.
|
inline |
Move the moving window.
step | Time step |
move_j | whether the current (and the charge, if allocated) is shifted or not |
Returns true if the moving window is active for the provided step
step | time step |
|
private |
|
private |
|
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.
create object for reduced diagnostics
Reimplemented from amrex::AmrMesh.
|
private |
void WarpX::prepareFields | ( | int | 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
void WarpX::PrintMainPICparameters | ( | ) |
Print main PIC parameters to stdout
|
private |
Backward FFT of E,B on all mesh refinement levels, with field damping in the guard cells (if needed)
E_fp | Vector of three-dimensional arrays (for each level) storing the fine patch electric field to be transformed |
B_fp | Vector of three-dimensional arrays (for each level) storing the fine patch magnetic field to be transformed |
E_cp | Vector of three-dimensional arrays (for each level) storing the coarse patch electric field to be transformed |
B_cp | Vector of three-dimensional arrays (for each level) storing the coarse patch magnetic field to be transformed |
|
private |
Backward FFT of averaged E,B on all mesh refinement levels.
E_avg_fp | Vector of three-dimensional arrays (for each level) storing the fine patch averaged electric field to be transformed |
B_avg_fp | Vector of three-dimensional arrays (for each level) storing the fine patch averaged magnetic field to be transformed |
E_avg_cp | Vector of three-dimensional arrays (for each level) storing the coarse patch averaged electric field to be transformed |
B_avg_cp | Vector of three-dimensional arrays (for each level) storing the coarse patch averaged magnetic field to be transformed |
|
private |
Backward FFT of F on all mesh refinement levels.
|
private |
Backward FFT of G on all mesh refinement levels.
|
private |
Backward FFT of J on all mesh refinement levels.
J_fp | Vector of three-dimensional arrays (for each level) storing the fine patch current to be transformed |
J_cp | Vector of three-dimensional arrays (for each level) storing the coarse patch current to be transformed |
|
private |
Correct current in Fourier space so that the continuity equation is satisfied.
|
private |
Set averaged E,B fields to zero before new iteration.
|
private |
Forward FFT of E,B on all mesh refinement levels.
E_fp | Vector of three-dimensional arrays (for each level) storing the fine patch electric field to be transformed |
B_fp | Vector of three-dimensional arrays (for each level) storing the fine patch magnetic field to be transformed |
E_cp | Vector of three-dimensional arrays (for each level) storing the coarse patch electric field to be transformed |
B_cp | Vector of three-dimensional arrays (for each level) storing the coarse patch magnetic field to be transformed |
|
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)
J_fp | Vector of three-dimensional arrays (for each level) storing the fine patch current to be transformed | |
J_cp | Vector of three-dimensional arrays (for each level) storing the coarse patch current to be transformed | |
[in] | apply_kspace_filter | Control whether to apply filtering (only used in RZ geometry to avoid double filtering) |
|
private |
Forward FFT of rho on all mesh refinement levels, with k-space filtering (if needed)
charge_fp | Vector (for each level) storing the fine patch charge to be transformed | |
charge_cp | Vector (for each level) storing the coarse patch charge to be transformed | |
[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) |
[in] | apply_kspace_filter | Control whether to apply filtering (only used in RZ geometry to avoid double filtering) |
|
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 (when rho is linear in time)
|
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::PSATDSubtractCurrentPartialSumsAvg | ( | ) |
Subtract the average of the cumulative sums of the preliminary current D from the current J (computed from D according to the Vay deposition scheme)
|
private |
Vay deposition in Fourier space (https://doi.org/10.1016/j.jcp.2013.03.010)
void WarpX::PushParticlesandDeposit | ( | amrex::Real | cur_time, |
bool | skip_current = false , |
||
PushType | push_type = PushType::Explicit |
||
) |
void WarpX::PushParticlesandDeposit | ( | int | lev, |
amrex::Real | cur_time, | ||
DtType | a_dt_type = DtType::Full , |
||
bool | skip_current = false , |
||
PushType | push_type = PushType::Explicit |
||
) |
|
private |
void WarpX::ReadExternalFieldFromFile | ( | const std::string & | read_fields_from_path, |
amrex::MultiFab * | mf, | ||
const std::string & | F_name, | ||
const std::string & | F_component | ||
) |
Load field values from a user-specified openPMD file for a specific field (specified by F_name
)
|
private |
|
finalprotected |
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::RescaleCosts | ( | int | step | ) |
Perform running average of the LB costs
Only needed for timers cost update, heuristic load balance considers the instantaneous costs. This gives more importance to most recent costs.
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::SaveParticlesAtImplicitStepStart | ( | WarpXParticleContainer & | pc, |
int | lev | ||
) |
|
private |
void WarpX::setLoadBalanceEfficiency | ( | int | lev, |
amrex::Real | efficiency | ||
) |
void WarpX::setPhiBC | ( | amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | phi | ) | const |
|
inline |
void WarpX::setVectorPotentialBC | ( | amrex::Vector< amrex::Array< std::unique_ptr< amrex::MultiFab >, 3 > > & | A | ) | const |
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 |
|
private |
|
private |
void WarpX::SyncCurrent | ( | const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> & | J_fp, |
const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> & | J_cp, | ||
const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> & | J_buffer | ||
) |
Apply filter and sum guard cells across MR levels. If current centering is used, center the current from a nodal grid to a staggered grid. For each MR level beyond level 0, interpolate the fine-patch current onto the coarse-patch current at the same level. Then, for each MR level, including level 0, apply filter and sum guard cells across levels.
[in,out] | J_fp | reference to fine-patch current MultiFab (all MR levels) |
[in,out] | J_cp | reference to coarse-patch current MultiFab (all MR levels) |
[in,out] | J_buffer | reference to buffer current MultiFab (all MR levels) |
void WarpX::SyncCurrentAndRho | ( | ) |
Synchronize J and rho: filter (if used), exchange guard cells, interpolate across MR levels and apply boundary conditions. Contains separate calls to WarpX::SyncCurrent and WarpX::SyncRho.
void WarpX::SyncRho | ( | ) |
void WarpX::SyncRho | ( | const amrex::Vector< std::unique_ptr< amrex::MultiFab >> & | charge_fp, |
const amrex::Vector< std::unique_ptr< amrex::MultiFab >> & | charge_cp, | ||
const amrex::Vector< std::unique_ptr< amrex::MultiFab >> & | charge_buffer | ||
) |
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::UpdateInjectionPosition | ( | amrex::Real | dt | ) |
Update injection position for continuous injection of particles and lasers (loops over species and lasers).
|
inline |
|
inline |
|
static |
Return the upper corner of the box in real units.
bx | The box |
lev | The refinement level of the box |
time_shift_delta | The time relative to the current time at which to calculate the position (when v_galilean is not zero) |
|
inline |
|
static |
Version of WarpX executable.
void WarpX::WriteUsedInputsFile | ( | ) | const |
Write a file that record all inputs: inputs file + command line options
|
friend |
|
static |
Beta value corresponding to the Lorentz factor of the boosted frame of the simulation.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
BilinearFilter WarpX::bilinear_filter |
|
static |
Direction of the Lorentz transform that defines the boosted frame of the simulation.
|
private |
|
private |
|
static |
Integer that corresponds to the charge deposition algorithm (only standard deposition)
|
static |
If true, the code will compute max_step from the back transformed diagnostics.
|
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 |
Order of finite centering of currents (from nodal grid to staggered grid), along x.
|
static |
Order of finite centering of currents (from nodal grid to staggered grid), along y.
|
static |
Order of finite centering of currents (from nodal grid to staggered grid), along z.
bool WarpX::current_correction |
If true, a correction is applied to the current in Fourier space,.
|
private |
|
static |
Integer that corresponds to the current deposition algorithm (Esirkepov, direct, Vay, Villasenor)
|
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 |
Set to true if zmax_plasma_to_compute_max_step is specified, in which case the maximum number of iterations is computed automatically so that the lower end of the simulation domain along z reaches zmax_plasma_to_compute_max_step in the boosted frame
|
static |
If true, the current is deposited on a nodal grid and then centered onto a staggered grid using finite centering of order given by current_centering_nox, current_centering_noy, and current_centering_noz
|
static |
|
static |
Solve additional Maxwell equation for G in order to control errors in magnetic Gauss' law.
|
static |
Solve additional Maxwell equation for F in order to control errors in Gauss' law (useful when using current deposition algorithms that are not charge-conserving)
|
static |
|
private |
|
static |
|
static |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
used shared memory algorithm for charge deposition
|
static |
use shared memory algorithm for current deposition
|
private |
|
staticprivate |
|
static |
perform field communications in single precision
|
static |
|
private |
|
private |
ECTRhofield is needed only by the ect solver and it contains the electromotive force density for every mesh face. The name ECTRhofield has been used to comply with the notation of the paper https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4463918 (page 9, equation 4 and below). Although it's called rho it has nothing to do with the charge density! This is only used for the ECT solver.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
Integer that corresponds to the type of Maxwell solver (Yee, CKC, PSATD, ECT)
|
static |
|
static |
Integer that corresponds to electromagnetic Maxwell solver (vacuum - 0, macroscopic - 1)
|
static |
|
static |
Integer that corresponds to the evolve scheme (explicit, implicit_picard, semi_implicit_picard)
|
private |
|
private |
|
private |
|
static |
|
private |
|
static |
|
static |
|
static |
Order of finite centering of fields (from staggered grid to nodal grid), along x.
|
static |
Order of finite centering of fields (from staggered grid to nodal grid), along y.
|
static |
Order of finite centering of fields (from staggered grid to nodal grid), along z.
|
static |
Integer that corresponds to the field gathering algorithm (energy-conserving, momentum-conserving)
|
private |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
If true (Galerkin method): The fields are interpolated directly from the staggered grid to the particle positions (with reduced interpolation order in the parallel direction). This scheme is energy conserving in the limit of infinitely small time steps. Otherwise, "momentum conserving" (in the same limit): The fields are first interpolated from the staggered grid points to the corners of each cell, and then from the cell corners to the particle position (with the same order of interpolation in all directions). This scheme is momentum conserving in the limit of infinitely small time steps.
|
static |
Lorentz factor of the boosted frame in which a boosted-frame simulation is run.
|
private |
|
static |
Integer that corresponds to the type of grid used in the simulation (collocated, staggered, hybrid)
|
private |
|
static |
|
private |
|
private |
|
private |
|
static |
Integers that correspond to the time dependency of J (constant, linear) and rho (linear, quadratic) for the PSATD algorithm
|
static |
Records a number corresponding to the load balance cost update strategy being used (0 or 1 corresponding to timers or heuristic).
|
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 |
EB: m_area_mod contains the modified areas of the mesh faces, i.e. if a face is enlarged it contains the area of the enlarged face This is only used for the ECT solver.
|
private |
Author of an input file / simulation setup.
|
private |
EB: m_borrowing contains the info about the enlarged cells, i.e. for every enlarged cell it contains the info of which neighbors are being intruded (and the amount of borrowed area). This is only used for the ECT solver.
bool WarpX::m_boundary_potential_specified = false |
|
private |
|
private |
|
private |
EB: Lengths of the mesh edges.
|
private |
Stop the simulation at the end of the current step due to a received Unix signal?
|
private |
EB: Areas of the mesh faces.
|
private |
|
private |
|
private |
|
static |
Whether to fill guard cells when computing inverse FFTs of currents.
|
static |
Whether to fill guard cells when computing inverse FFTs of fields.
|
private |
EB: for every mesh face face flag_ext_face contains a:
|
private |
EB: for every mesh face flag_info_face contains a:
amrex::Array<amrex::Real,3> WarpX::m_galilean_shift = {{0}} |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
particle buffer for scraped particles on the boundaries
ElectrostaticSolver::PoissonBoundaryHandler WarpX::m_poisson_boundary_handler |
amrex::IntVect WarpX::m_rho_nodal_flag |
amrex::Vector<amrex::Real> WarpX::m_v_comoving = amrex::Vector<amrex::Real>(3, amrex::Real(0.)) |
amrex::Vector<amrex::Real> WarpX::m_v_galilean = amrex::Vector<amrex::Real>(3, amrex::Real(0.)) |
MagnetostaticSolver::VectorPoissonBoundaryHandler WarpX::m_vector_poisson_boundary_handler |
|
static |
Integer that correspond to macroscopic Maxwell solver algorithm (BackwardEuler - 0, Lax-Wendroff - 1)
|
static |
The maximum number of Picard iterations to do each time step.
int WarpX::maxlevel_extEMfield_init |
Maximum level up to which the externally defined electric and magnetic fields are initialized. The default value is set to the max levels in the simulation. if lev > maxlevel_extEMfield_init, the fields on those levels will have a default value of 0
|
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 |
|
static |
|
private |
|
private |
|
static |
With mesh refinement, particles located inside a refinement patch, but within n_current_deposition_buffer cells of the edge of the patch, will deposit their charge and current onto the lower refinement level instead of the refinement patch itself
|
static |
With mesh refinement, particles located inside a refinement patch, but within n_field_gather_buffer cells of the edge of the patch, will gather the fields from the lower refinement level instead of the refinement patch itself
|
static |
Number of modes for the RZ multi-mode version.
amrex::Vector< std::unique_ptr<NCIGodfreyFilter> > WarpX::nci_godfrey_filter_bxbyez |
amrex::Vector< std::unique_ptr<NCIGodfreyFilter> > WarpX::nci_godfrey_filter_exeybz |
|
static |
Number of MultiFab components (with the RZ multi-mode version, each mode has a real and imaginary component, except mode 0 which is purely real: component 0 is mode 0, odd components are the real parts, even components are the imaginary parts)
|
static |
Order of the particle shape factors (splines) along x.
|
private |
|
static |
Order of the particle shape factors (splines) along y.
|
private |
|
static |
Order of the particle shape factors (splines) along z.
|
private |
|
private |
|
private |
|
static |
|
private |
Domain decomposition on Level 0.
|
private |
|
static |
Integers that correspond to boundary condition applied to particles at the upper domain boundaries (0 to 4 correspond to Absorbing, Open, Reflecting, Periodic, Thermal)
|
static |
Integers that correspond to boundary condition applied to particles at the lower domain boundaries (0 to 4 correspond to Absorbing, Open, Reflecting, Periodic, Thermal)
|
private |
|
static |
Integer that corresponds to the particle push algorithm (Boris, Vay, Higuera-Cary)
|
private |
|
static |
The tolerance for the Picard iteration convergence.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
Integer that corresponds to the order of the PSATD solution (whether the PSATD equations are derived from first-order or second-order solution)
|
static |
std::unique_ptr<MultiReducedDiags> WarpX::reduced_diags |
object with all reduced diagnostics, similar to MultiParticleContainer for species.
|
private |
User-defined parser to define refinement patches.
|
static |
|
private |
|
static |
Flags whether the Picard iterations are required to converge.
|
private |
|
private |
|
private |
|
static |
|
private |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
If true, the initial conditions from random number generators are serialized (useful for reproducible testing with OpenMP)
|
static |
number of threads to use per block in shared deposition
|
static |
tileSize to use for shared current deposition operations
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
Specifies the type of grid used for the above sorting, i.e. cell-centered, nodal, or mixed.
|
static |
|
static |
If true, particles will be sorted in the order x -> y -> z -> ppc for faster deposition.
|
private |
|
private |
|
static |
|
private |
|
staticconstexprprivate |
|
private |
|
private |
amrex::Real WarpX::time_of_last_gal_shift = 0 |
bool WarpX::update_with_rho = false |
If true, the PSATD update equation for E contains both J and rho (default is false for standard PSATD and true for Galilean PSATD)
|
static |
If true, a Numerical Cherenkov Instability (NCI) corrector is applied (for simulations using the FDTD Maxwell solver)
|
static |
If true, a bilinear filter is used to smooth charge and currents.
|
static |
If true, a compensation step is added to the bilinear filtering of charge and currents.
|
private |
|
static |
If true, the bilinear filtering of charge and currents is done in Fourier space.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Venl contains the electromotive force for every mesh face, i.e. every entry is the corresponding entry in ECTRhofield multiplied by the total area (possibly with enlargement) This is only used for the ECT solver.
|
static |
Flag whether the Verboncoeur correction is applied to the current and charge density on the axis when using RZ.
|
private |
|
private |
|
private |
When true
, write the diagnostics after restart at the time of the restart.
|
static |
If specified, the maximum number of iterations is computed automatically so that the lower end of the simulation domain along z reaches zmax_plasma_to_compute_max_step in the boosted frame
|
static |
store initial value of zmin_domain_boost because WarpX::computeMaxStepBoostAccelerator needs the initial value of zmin_domain_boost, even if restarting from a checkpoint file