AmrSystemCoupler< System, RhsAssembler, Elliptic > Class Template ReferenceΒΆ

adc_cpp: pops::AmrSystemCoupler< System, RhsAssembler, Elliptic > Class Template Reference
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
pops::AmrSystemCoupler< System, RhsAssembler, Elliptic > Class Template Reference

Multi-species system coupler on AMR. More...

#include <amr_system_coupler.hpp>

+ Collaboration diagram for pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >:

Public Member Functions

 AmrSystemCoupler (System system, const Geometry &geom, const BoxArray &ba_coarse, const BCRec &bcPhi, RhsAssembler rhs_assembler, std::vector< std::vector< AmrLevelMP > > block_levels, Periodicity base_per=Periodicity{true, true}, bool replicated_coarse=true, PoissonCadence cadence=PoissonCadence::OncePerStep, std::function< bool(Real, Real)> active={}, std::function< Real(Real, Real)> bz={})
 
void set_bz (std::function< Real(Real, Real)> bz)
 
Systemsystem ()
 
const Systemsystem () const
 
MultiFabphi ()
 
int nlev () const
 
const MultiFabaux (int k) const
 
MultiFabaux (int k)
 
int aux_ncomp () const
 
std::vector< AmrLevelMP > & levels (std::size_t b)
 
MultiFabcoarse (std::size_t b)
 
const MultiFabcoarse (std::size_t b) const
 
int solve_count () const
 
void solve_fields ()
 Solves the fields: average_down per block, coarse system Poisson (RHS = Sum_s q_s n_s), coarse aux (phi, grad phi) then injection to the fine levels + re-sets B_z per level.
 
template<class ImplicitAdvance >
void step (Real dt, ImplicitAdvance &&implicit_advance)
 Advances the system by one macro-step dt.
 
void step (Real dt)
 Overload for a FULLY explicit system (static_assert if an implicit/IMEX block goes through it).
 
template<class CoupledSource >
void coupled_source_step (CoupledSource &&src, Real dt)
 
Real mass (std::size_t b) const
 

Detailed Description

template<CoupledSystemLike System, class RhsAssembler, class Elliptic = GeometricMG>
class pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >

Multi-species system coupler on AMR.

Template Parameters
SystemCoupledSystem (blocks/species).
RhsAssemblerassembler of the Poisson RHS (f = Sum_s q_s n_s, e.g. ChargeDensityRhs).
Ellipticelliptic backend (EllipticSolver concept, default GeometricMG). PRECONDITION: all blocks share EXACTLY the same AMR layout per level (checked at the ctor).

Constructor & Destructor Documentation

◆ AmrSystemCoupler()

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::AmrSystemCoupler ( System  system,
const Geometry geom,
const BoxArray ba_coarse,
const BCRec bcPhi,
RhsAssembler  rhs_assembler,
std::vector< std::vector< AmrLevelMP > >  block_levels,
Periodicity  base_per = Periodicity{true, true},
bool  replicated_coarse = true,
PoissonCadence  cadence = PoissonCadence::OncePerStep,
std::function< bool(Real, Real)>  active = {},
std::function< Real(Real, Real)>  bz = {} 
)
inline

Member Function Documentation

◆ aux() [1/2]

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
MultiFab & pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::aux ( int  k)
inline

◆ aux() [2/2]

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
const MultiFab & pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::aux ( int  k) const
inline

◆ aux_ncomp()

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
int pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::aux_ncomp ( ) const
inline

◆ coarse() [1/2]

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
MultiFab & pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::coarse ( std::size_t  b)
inline

◆ coarse() [2/2]

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
const MultiFab & pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::coarse ( std::size_t  b) const
inline

◆ coupled_source_step()

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
template<class CoupledSource >
void pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::coupled_source_step ( CoupledSource &&  src,
Real  dt 
)
inline
+ Here is the call graph for this function:

◆ levels()

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
std::vector< AmrLevelMP > & pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::levels ( std::size_t  b)
inline
+ Here is the caller graph for this function:

◆ mass()

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
Real pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::mass ( std::size_t  b) const
inline
+ Here is the call graph for this function:

◆ nlev()

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
int pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::nlev ( ) const
inline

◆ phi()

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
MultiFab & pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::phi ( )
inline

◆ set_bz()

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
void pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::set_bz ( std::function< Real(Real, Real)>  bz)
inline

◆ solve_count()

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
int pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::solve_count ( ) const
inline

◆ solve_fields()

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
void pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::solve_fields ( )
inline

Solves the fields: average_down per block, coarse system Poisson (RHS = Sum_s q_s n_s), coarse aux (phi, grad phi) then injection to the fine levels + re-sets B_z per level.

Increments solve_count().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ step() [1/2]

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
void pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::step ( Real  dt)
inline

Overload for a FULLY explicit system (static_assert if an implicit/IMEX block goes through it).

+ Here is the call graph for this function:

◆ step() [2/2]

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
template<class ImplicitAdvance >
void pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::step ( Real  dt,
ImplicitAdvance &&  implicit_advance 
)
inline

Advances the system by one macro-step dt.

Explicit blocks via advance_amr (their Disc + substeps); implicit/IMEX blocks delegated to implicit_advance (coupler, block, levels, dt). The per-block cadence (stride) holds a slow block then catches it up (hold-then-catch-up).

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ system() [1/2]

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
System & pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::system ( )
inline

◆ system() [2/2]

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
const System & pops::AmrSystemCoupler< System, RhsAssembler, Elliptic >::system ( ) const
inline

The documentation for this class was generated from the following file: