include/pops/runtime/builders/compiled/dsl_block.hpp Source FileΒΆ
|
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
|
dsl_block.hpp
Go to the documentation of this file.
3#include <pops/core/model/physical_model.hpp> // aux_comps<Model>: aux width requested by the model
62 // -> this template): "ssprk3" (3 stages, order 3, less dissipative, to pair with weno5), "euler"
64 // (historical default, bit-identical). Has effect ONLY on the explicit advance -- IMEX keeps its
67 // other string ("explicit"/unknown) falls back to ssprk2 (add_native_block validates the upstream string).
68 const std::string method = (time == "ssprk3") ? "ssprk3" : (time == "euler") ? "euler" : "ssprk2";
78 sys.install_block(name, Model::n_vars, Model::conservative_vars(), Model::primitive_vars(), gamma,
80 // cons <-> prim conversions OF THE MODEL (set/get_primitive_state): same formulas as the flux of
Builds the closures of a block (time advance + residual + Poisson contribution) from a COMPILED model...
Field distributed over a level: decomposition (BoxArray) + distribution (DistributionMapping) + ncomp...
Definition multifab.hpp:33
Coupled multi-species system, composed at runtime from generic bricks.
Definition system.hpp:89
POPS_EXPORT GridContext grid_context()
REAL mesh + BC + aux of the System (aux not owned)
POPS_EXPORT void set_block_dt_bounds(const std::string &name, std::function< Real(const MultiFab &)> source_frequency, std::function< Real(const MultiFab &)> stability_dt)
Installs the optional STEP BOUNDS of a block (after install_block): reduction of the max source frequ...
POPS_EXPORT void ensure_aux_width(int ncomp)
Guarantees that the SHARED aux channel has at least ncomp components.
POPS_EXPORT void install_block(const std::string &name, int ncomp, const VariableSet &cons_vars, const VariableSet &prim_vars, double gamma, BlockClosures closures, std::function< Real(const MultiFab &)> max_speed, std::function< void(const MultiFab &, MultiFab &)> poisson_rhs, int substeps, bool evolve, int stride=1)
Installs a block from already-built closures (cf.
POPS_EXPORT void set_block_conversion(const std::string &name, CellConvert prim_to_cons, CellConvert cons_to_prim)
Installs the pointwise cons <-> prim conversions of a block (after install_block).
POPS_EXPORT void set_block_ghosts(const std::string &name, int n_ghost)
Guarantees that the state U of block name carries at least n_ghost ghosts (width of the spatial stenc...
Definition amr_hierarchy.hpp:29
int block_n_ghost(const std::string &lim)
Number of ghosts required by the spatial scheme lim (single source: Limiter::n_ghost).
Definition block_builder.hpp:759
std::function< Real(const MultiFab &)> make_stability_dt(const Model &m, const GridContext &ctx)
Closure of the block min admissible step (bound dt <= stability_dt * substeps / stride,...
Definition block_builder.hpp:852
void add_compiled_model(AmrSystem &sys, const std::string &name, Model model, const std::string &limiter="minmod", const std::string &riemann="rusanov", const std::string &recon="conservative", const std::string &time="explicit", double gamma=1.4, int substeps=1, int stride=1, const std::vector< std::string > &implicit_vars={}, const std::vector< std::string > &implicit_roles={}, double pos_floor=0.0)
Wires model (concrete CompositeModel) as an AMR block of sys, with the requested scheme.
Definition amr_dsl_block.hpp:1028
POPS_COLD_FN BlockClosures make_block(const Model &m, const std::string &lim, const std::string &riem, const GridContext &ctx, bool imex, bool recon_prim, const std::string &method="ssprk2", const std::vector< int > &implicit_components={}, const NewtonOptions &newton_opts={}, NewtonReport *newton_report=nullptr, Real pos_floor=Real(0), bool wave_speed_cache=false)
Definition block_builder.hpp:726
std::function< void(const MultiFab &, MultiFab &)> make_poisson_rhs(const Model &m)
Block contribution to the Poisson right-hand side: rhs += elliptic_rhs(U) (host loop).
Definition block_builder.hpp:861
std::function< Real(const MultiFab &)> make_max_speed(const Model &m, const GridContext &ctx)
Closure of the speed used by the block CFL step.
Definition block_builder.hpp:831
std::function< Real(const MultiFab &)> make_source_frequency(const Model &m, const GridContext &ctx)
Closure of the block max source frequency (bound dt <= cfl * substeps / (stride * mu)).
Definition block_builder.hpp:842
std::pair< std::function< void(const double *, double *)>, std::function< void(const double *, double *)> > make_cell_convert(const Model &m)
PER-CELL (one cell) cons <-> prim conversions of the MODEL, type-erased over arrays of Model::n_vars ...
Definition block_builder.hpp:875
C++20 concepts defining the contract of the physics layer.
Mesh + transport BC + aux shared by a block closures.
Definition grid_context.hpp:41
Runtime multi-species composition: one coupled system, block by block.
Generated by