|
WarpX
|
Top-level class for the electromagnetic finite-difference solver. More...
#include <FiniteDifferenceSolver.H>
Public Member Functions | |
| FiniteDifferenceSolver (int fdtd_algo, std::array< amrex::Real, 3 > cell_size, short grid_type) | |
| Initialize the finite-difference Maxwell solver (for a given refinement level) More... | |
| void | EvolveB (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Bfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Efield, std::unique_ptr< amrex::MultiFab > const &Gfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &face_areas, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &area_mod, std::array< std::unique_ptr< amrex::MultiFab >, 3 > &ECTRhofield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Venl, std::array< std::unique_ptr< amrex::iMultiFab >, 3 > &flag_info_cell, std::array< std::unique_ptr< amrex::LayoutData< FaceInfoBox > >, 3 > &borrowing, int lev, amrex::Real dt) |
| Update the B field, over one timestep. More... | |
| void | EvolveE (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Jfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &face_areas, std::array< std::unique_ptr< amrex::MultiFab >, 3 > &ECTRhofield, std::unique_ptr< amrex::MultiFab > const &Ffield, int lev, amrex::Real dt) |
| Update the E field, over one timestep. More... | |
| void | EvolveF (std::unique_ptr< amrex::MultiFab > &Ffield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Efield, std::unique_ptr< amrex::MultiFab > const &rhofield, int rhocomp, amrex::Real dt) |
| Update the F field, over one timestep. More... | |
| void | EvolveG (std::unique_ptr< amrex::MultiFab > &Gfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, amrex::Real dt) |
| void | EvolveECTRho (std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Efield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &face_areas, std::array< std::unique_ptr< amrex::MultiFab >, 3 > &ECTRhofield, int lev) |
| Update the B field, over one timestep. More... | |
| void | ApplySilverMuellerBoundary (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Bfield, amrex::Box domain_box, amrex::Real dt, amrex::Vector< int > field_boundary_lo, amrex::Vector< int > field_boundary_hi) |
| Update the B field at the boundary, using the Silver-Mueller condition. More... | |
| void | ComputeDivE (const std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, amrex::MultiFab &divE) |
| Update the F field, over one timestep. More... | |
| void | MacroscopicEvolveE (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Jfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, amrex::Real dt, std::unique_ptr< MacroscopicProperties > const ¯oscopic_properties) |
| Macroscopic E-update for non-vacuum medium using the user-selected finite-difference algorithm and macroscopic sigma-method defined in WarpXAlgorithmSelection.H. More... | |
| void | EvolveBPML (std::array< amrex::MultiFab *, 3 > Bfield, std::array< amrex::MultiFab *, 3 > Efield, amrex::Real dt, bool dive_cleaning) |
| Update the B field, over one timestep. More... | |
| void | EvolveEPML (std::array< amrex::MultiFab *, 3 > Efield, std::array< amrex::MultiFab *, 3 > Bfield, std::array< amrex::MultiFab *, 3 > Jfield, std::array< amrex::MultiFab *, 3 > edge_lengths, amrex::MultiFab *Ffield, MultiSigmaBox const &sigba, amrex::Real dt, bool pml_has_particles) |
| Update the E field, over one timestep. More... | |
| void | EvolveFPML (amrex::MultiFab *Ffield, std::array< amrex::MultiFab *, 3 > Efield, amrex::Real dt) |
| Update the E field, over one timestep. More... | |
| void | HybridPICSolveE (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Jfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Jifield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, std::unique_ptr< amrex::MultiFab > const &rhofield, std::unique_ptr< amrex::MultiFab > const &Pefield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, int lev, HybridPICModel const *hybrid_pic_model, bool include_resistivity_term) |
| E-update in the hybrid PIC algorithm as described in Winske et al. (2003) Eq. 10. https://link.springer.com/chapter/10.1007/3-540-36530-3_8. More... | |
| void | CalculateCurrentAmpere (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Jfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, int lev) |
| Calculation of total current using Ampere's law (without displacement current): J = (curl x B) / mu0. More... | |
| template<typename T_Algo > | |
| void | EvolveBCylindrical (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Bfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Efield, int lev, amrex::Real dt) |
| template<typename T_Algo > | |
| void | EvolveECylindrical (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Jfield, std::unique_ptr< amrex::MultiFab > const &Ffield, int lev, amrex::Real dt) |
| template<typename T_Algo > | |
| void | EvolveFCylindrical (std::unique_ptr< amrex::MultiFab > &Ffield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Efield, std::unique_ptr< amrex::MultiFab > const &rhofield, int rhocomp, amrex::Real dt) |
| template<typename T_Algo > | |
| void | ComputeDivECylindrical (const std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, amrex::MultiFab &divE) |
| template<typename T_Algo > | |
| void | HybridPICSolveECylindrical (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Jfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Jifield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, std::unique_ptr< amrex::MultiFab > const &rhofield, std::unique_ptr< amrex::MultiFab > const &Pefield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, int lev, HybridPICModel const *hybrid_pic_model, bool include_resistivity_term) |
| template<typename T_Algo > | |
| void | CalculateCurrentAmpereCylindrical (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Jfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, int lev) |
Private Attributes | |
| int | m_fdtd_algo |
| short | m_grid_type |
| amrex::Real | m_dr |
| amrex::Real | m_rmin |
| int | m_nmodes |
| amrex::Vector< amrex::Real > | m_h_stencil_coefs_r |
| amrex::Vector< amrex::Real > | m_h_stencil_coefs_z |
| amrex::Gpu::DeviceVector< amrex::Real > | m_stencil_coefs_r |
| amrex::Gpu::DeviceVector< amrex::Real > | m_stencil_coefs_z |
Top-level class for the electromagnetic finite-difference solver.
Stores the coefficients of the finite-difference stencils, and has member functions to update fields over one time step.
| FiniteDifferenceSolver::FiniteDifferenceSolver | ( | int | fdtd_algo, |
| std::array< amrex::Real, 3 > | cell_size, | ||
| short | grid_type | ||
| ) |
Initialize the finite-difference Maxwell solver (for a given refinement level)
This function initializes the stencil coefficients for the chosen finite-difference algorithm
| fdtd_algo | Identifies the chosen algorithm, as defined in WarpXAlgorithmSelection.H |
| cell_size | Cell size along each dimension, for the chosen refinement level |
| grid_type | Whether the solver is applied to a collocated or staggered grid |
| void FiniteDifferenceSolver::ApplySilverMuellerBoundary | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Bfield, | ||
| amrex::Box | domain_box, | ||
| amrex::Real | dt, | ||
| amrex::Vector< int > | field_boundary_lo, | ||
| amrex::Vector< int > | field_boundary_hi | ||
| ) |
Update the B field at the boundary, using the Silver-Mueller condition.
| void FiniteDifferenceSolver::CalculateCurrentAmpere | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Jfield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, | ||
| int | lev | ||
| ) |
Calculation of total current using Ampere's law (without displacement current): J = (curl x B) / mu0.
| [out] | Jfield | vector of current MultiFabs at a given level |
| [in] | Bfield | vector of magnetic field MultiFabs at a given level |
| [in] | edge_lengths | length of edges along embedded boundaries |
| [in] | lev | level number for the calculation |
| void FiniteDifferenceSolver::CalculateCurrentAmpereCylindrical | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Jfield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, | ||
| int | lev | ||
| ) |
| void FiniteDifferenceSolver::ComputeDivE | ( | const std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
| amrex::MultiFab & | divE | ||
| ) |
Update the F field, over one timestep.
| void FiniteDifferenceSolver::ComputeDivECylindrical | ( | const std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
| amrex::MultiFab & | divE | ||
| ) |
| void FiniteDifferenceSolver::EvolveB | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Bfield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Efield, | ||
| std::unique_ptr< amrex::MultiFab > const & | Gfield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | face_areas, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | area_mod, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | ECTRhofield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Venl, | ||
| std::array< std::unique_ptr< amrex::iMultiFab >, 3 > & | flag_info_cell, | ||
| std::array< std::unique_ptr< amrex::LayoutData< FaceInfoBox > >, 3 > & | borrowing, | ||
| int | lev, | ||
| amrex::Real | dt | ||
| ) |
Update the B field, over one timestep.
| void FiniteDifferenceSolver::EvolveBCylindrical | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Bfield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Efield, | ||
| int | lev, | ||
| amrex::Real | dt | ||
| ) |
| void FiniteDifferenceSolver::EvolveBPML | ( | std::array< amrex::MultiFab *, 3 > | Bfield, |
| std::array< amrex::MultiFab *, 3 > | Efield, | ||
| amrex::Real | dt, | ||
| bool | dive_cleaning | ||
| ) |
Update the B field, over one timestep.
| void FiniteDifferenceSolver::EvolveE | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Jfield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | face_areas, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | ECTRhofield, | ||
| std::unique_ptr< amrex::MultiFab > const & | Ffield, | ||
| int | lev, | ||
| amrex::Real | dt | ||
| ) |
Update the E field, over one timestep.
| void FiniteDifferenceSolver::EvolveECTRho | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Efield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | face_areas, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | ECTRhofield, | ||
| int | lev | ||
| ) |
Update the B field, over one timestep.
| void FiniteDifferenceSolver::EvolveECylindrical | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Jfield, | ||
| std::unique_ptr< amrex::MultiFab > const & | Ffield, | ||
| int | lev, | ||
| amrex::Real | dt | ||
| ) |
| void FiniteDifferenceSolver::EvolveEPML | ( | std::array< amrex::MultiFab *, 3 > | Efield, |
| std::array< amrex::MultiFab *, 3 > | Bfield, | ||
| std::array< amrex::MultiFab *, 3 > | Jfield, | ||
| std::array< amrex::MultiFab *, 3 > | edge_lengths, | ||
| amrex::MultiFab * | Ffield, | ||
| MultiSigmaBox const & | sigba, | ||
| amrex::Real | dt, | ||
| bool | pml_has_particles | ||
| ) |
Update the E field, over one timestep.
| void FiniteDifferenceSolver::EvolveF | ( | std::unique_ptr< amrex::MultiFab > & | Ffield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Efield, | ||
| std::unique_ptr< amrex::MultiFab > const & | rhofield, | ||
| int | rhocomp, | ||
| amrex::Real | dt | ||
| ) |
Update the F field, over one timestep.
| void FiniteDifferenceSolver::EvolveFCylindrical | ( | std::unique_ptr< amrex::MultiFab > & | Ffield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Efield, | ||
| std::unique_ptr< amrex::MultiFab > const & | rhofield, | ||
| int | rhocomp, | ||
| amrex::Real | dt | ||
| ) |
| void FiniteDifferenceSolver::EvolveFPML | ( | amrex::MultiFab * | Ffield, |
| std::array< amrex::MultiFab *, 3 > | Efield, | ||
| amrex::Real | dt | ||
| ) |
Update the E field, over one timestep.
| void FiniteDifferenceSolver::EvolveG | ( | std::unique_ptr< amrex::MultiFab > & | Gfield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, | ||
| amrex::Real | dt | ||
| ) |
| void FiniteDifferenceSolver::HybridPICSolveE | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Jfield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Jifield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, | ||
| std::unique_ptr< amrex::MultiFab > const & | rhofield, | ||
| std::unique_ptr< amrex::MultiFab > const & | Pefield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, | ||
| int | lev, | ||
| HybridPICModel const * | hybrid_pic_model, | ||
| bool | include_resistivity_term | ||
| ) |
E-update in the hybrid PIC algorithm as described in Winske et al. (2003) Eq. 10. https://link.springer.com/chapter/10.1007/3-540-36530-3_8.
| [out] | Efield | vector of electric field MultiFabs updated at a given level |
| [in] | Jfield | vector of total current MultiFabs at a given level |
| [in] | Jifield | vector of ion current density MultiFabs at a given level |
| [in] | Bfield | vector of magnetic field MultiFabs at a given level |
| [in] | rhofield | scalar ion charge density Multifab at a given level |
| [in] | Pefield | scalar electron pressure MultiFab at a given level |
| [in] | edge_lengths | length of edges along embedded boundaries |
| [in] | lev | level number for the calculation |
| [in] | hybrid_pic_model | instance of the hybrid-PIC model |
| [in] | include_resistivity_term | boolean flag for whether to include resistivity |
| void FiniteDifferenceSolver::HybridPICSolveECylindrical | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Jfield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Jifield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, | ||
| std::unique_ptr< amrex::MultiFab > const & | rhofield, | ||
| std::unique_ptr< amrex::MultiFab > const & | Pefield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, | ||
| int | lev, | ||
| HybridPICModel const * | hybrid_pic_model, | ||
| bool | include_resistivity_term | ||
| ) |
| void FiniteDifferenceSolver::MacroscopicEvolveE | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Jfield, | ||
| std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, | ||
| amrex::Real | dt, | ||
| std::unique_ptr< MacroscopicProperties > const & | macroscopic_properties | ||
| ) |
Macroscopic E-update for non-vacuum medium using the user-selected finite-difference algorithm and macroscopic sigma-method defined in WarpXAlgorithmSelection.H.
| [out] | Efield | vector of electric field MultiFabs updated at a given level |
| [in] | Bfield | vector of magnetic field MultiFabs at a given level |
| [in] | Jfield | vector of current density MultiFabs at a given level |
| [in] | edge_lengths | length of edges along embedded boundaries |
| [in] | dt | timestep of the simulation |
| [in] | macroscopic_properties | contains user-defined properties of the medium. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |