include/pops/runtime/builders/compiled/amr_dsl_block.hpp File 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
|
add_compiled_model on the AmrSystem side: wires a COMPILED model (a CompositeModel, generated by the DSL or hand-written, known at COMPILE time) as a block of an AMR hierarchy, EXACTLY the production path of AmrSystem::add_block but WITHOUT going through the ModelSpec dispatch (the model is already a concrete type). More...
#include <pops/coupling/schur/amr/amr_condensed_schur_source_stepper.hpp>#include <pops/coupling/amr/amr_coupler_mp.hpp>#include <pops/mesh/index/box2d.hpp>#include <pops/mesh/layout/box_array.hpp>#include <pops/mesh/layout/distribution_mapping.hpp>#include <pops/mesh/execution/for_each.hpp>#include <pops/mesh/geometry/geometry.hpp>#include <pops/mesh/storage/multifab.hpp>#include <pops/mesh/layout/refinement.hpp>#include <pops/numerics/fv/numerical_flux.hpp>#include <pops/numerics/fv/reconstruction.hpp>#include <pops/numerics/spatial_operator.hpp>#include <pops/numerics/time/integrators/implicit_stepper.hpp>#include <pops/parallel/comm.hpp>#include <pops/runtime/amr/amr_runtime.hpp>#include <pops/runtime/amr_system.hpp>#include <pops/runtime/builders/block/block_builder.hpp>#include <pops/runtime/config/dispatch_tags.hpp>#include <algorithm>#include <functional>#include <memory>#include <stdexcept>#include <string>#include <utility>#include <vector>
Include dependency graph for amr_dsl_block.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | pops::AmrDiscLF< L, F > |
| Bundle (limiter, Riemann flux) expected by AmrCouplerMP::step<Disc>. More... | |
| struct | pops::detail::SharedAmrLayout |
| SHARED layout of a multi-block AMR hierarchy (PR1 capstone), frozen at construction. More... | |
Namespaces | |
| namespace | pops |
| namespace | pops::detail |
Functions | |
| template<class Model > | |
| void | pops::detail::apply_pointwise_project_amr (const Model &m, std::vector< AmrLevelMP > &levels) |
| void | pops::detail::amr_write_coarse_bz (MultiFab &bz, const std::vector< double > &field, int n) |
Fills the COARSE B_z field (component 0, n*n row-major in GLOBAL indices) from field. | |
| template<class Coupler > | |
| void | pops::detail::amr_schur_source (Coupler &cpl, AmrCondensedSchurSourceStepper &schur, MultiFab &bz_coarse, MultiFab &phi_coarse, double theta, double dt) |
| A GLOBAL condensed source STAGE on the mono-block coupler hierarchy. | |
| template<class Model , class Limiter , class Flux > | |
| AmrCompiledHooks | pops::detail::build_amr_compiled (const Model &model, const AmrBuildParams &bp) |
| Builds the AMR coupler for a composite Model + concrete (Limiter, Flux) and fills the type-erased hooks. | |
| SharedAmrLayout | pops::detail::make_shared_amr_layout (const AmrBuildParams &bp) |
| Builds the SHARED layout (PR1): coarse (per the ownership policy) + ONE central FIXED fine patch (the seed of build_amr_compiled, BEFORE its regrid). | |
| template<class Model , class Limiter , class Flux > | |
| AmrRuntimeBlock | pops::detail::build_amr_block (const Model &model, const SharedAmrLayout &S, const std::string &name, const std::vector< double > &density, bool has_density, double gamma, int substeps, bool recon_prim, bool imex, int stride=1, const std::vector< int > &implicit_components={}, const NewtonOptions &nopts={}, const std::vector< double > *state=nullptr, bool newton_diagnostics=false, AmrTimeMethod time_method=AmrTimeMethod::kEuler, double pos_floor=0.0) |
Builds ONE type-erased AMR block (AmrRuntimeBlock) on the SHARED layout S, for a composite Model + concrete (Limiter, Flux). | |
| template<class Model > | |
| AmrRuntimeBlock | pops::detail::dispatch_amr_block_rusanov (const Model &m, const std::string &lim, const SharedAmrLayout &S, const std::string &name, const std::vector< double > &density, bool has_density, double gamma, int substeps, bool recon_prim, bool imex, int stride, const std::vector< int > &implicit_components, const NewtonOptions &nopts, const std::vector< double > *state, bool newton_diagnostics, AmrTimeMethod time_method, double pos_floor) |
| template<class Model > | |
| AmrRuntimeBlock | pops::detail::dispatch_amr_block_hll (const Model &m, const std::string &lim, const SharedAmrLayout &S, const std::string &name, const std::vector< double > &density, bool has_density, double gamma, int substeps, bool recon_prim, bool imex, int stride, const std::vector< int > &implicit_components, const NewtonOptions &nopts, const std::vector< double > *state, bool newton_diagnostics, AmrTimeMethod time_method, double pos_floor) |
| template<class Model > | |
| AmrRuntimeBlock | pops::detail::dispatch_amr_block_hllc (const Model &m, const std::string &lim, const SharedAmrLayout &S, const std::string &name, const std::vector< double > &density, bool has_density, double gamma, int substeps, bool recon_prim, bool imex, int stride, const std::vector< int > &implicit_components, const NewtonOptions &nopts, const std::vector< double > *state, bool newton_diagnostics, AmrTimeMethod time_method, double pos_floor) |
| template<class Model > | |
| AmrRuntimeBlock | pops::detail::dispatch_amr_block_roe (const Model &m, const std::string &lim, const SharedAmrLayout &S, const std::string &name, const std::vector< double > &density, bool has_density, double gamma, int substeps, bool recon_prim, bool imex, int stride, const std::vector< int > &implicit_components, const NewtonOptions &nopts, const std::vector< double > *state, bool newton_diagnostics, AmrTimeMethod time_method, double pos_floor) |
| template<class Model > | |
| AmrRuntimeBlock | pops::detail::dispatch_amr_block (const Model &m, const std::string &lim, const std::string &riem, const SharedAmrLayout &S, const std::string &name, const std::vector< double > &density, bool has_density, double gamma, int substeps, bool recon_prim, bool imex, int stride=1, const std::vector< int > &implicit_components={}, const NewtonOptions &nopts={}, const std::vector< double > *state=nullptr, bool newton_diagnostics=false, AmrTimeMethod time_method=AmrTimeMethod::kEuler, double pos_floor=0.0) |
| Dispatch of the spatial scheme (limiter x Riemann flux) -> build_amr_block. | |
| template<class Model > | |
| AmrCompiledHooks | pops::detail::dispatch_amr_compiled_rusanov (const Model &m, const std::string &lim, const AmrBuildParams &bp) |
| template<class Model > | |
| AmrCompiledHooks | pops::detail::dispatch_amr_compiled_hll (const Model &m, const std::string &lim, const AmrBuildParams &bp) |
| template<class Model > | |
| AmrCompiledHooks | pops::detail::dispatch_amr_compiled_hllc (const Model &m, const std::string &lim, const AmrBuildParams &bp) |
| template<class Model > | |
| AmrCompiledHooks | pops::detail::dispatch_amr_compiled_roe (const Model &m, const std::string &lim, const AmrBuildParams &bp) |
| template<class Model > | |
| AmrCompiledHooks | pops::detail::dispatch_amr_compiled (const Model &m, const std::string &lim, const std::string &riem, const AmrBuildParams &bp) |
| Dispatch of the spatial scheme (limiter x Riemann flux) -> build_amr_compiled. | |
| std::vector< int > | pops::resolve_implicit_components_compiled (const std::string &block, const VariableSet &cons, const std::vector< std::string > &names, const std::vector< std::string > &roles) |
Resolves the partial IMEX MASK (implicit_vars / implicit_roles) of a COMPILED block into indices of conserved components, against the conservative descriptor cons of the CONCRETE Model (known here). | |
| template<class Model > | |
| void | pops::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. | |
Detailed Description
add_compiled_model on the AmrSystem side: wires a COMPILED model (a CompositeModel, generated by the DSL or hand-written, known at COMPILE time) as a block of an AMR hierarchy, EXACTLY the production path of AmrSystem::add_block but WITHOUT going through the ModelSpec dispatch (the model is already a concrete type).
A SINGLE compiled block -> historical mono-block AmrCouplerMP path (bit-identical); SEVERAL compiled blocks or a MIX of compiled + native (capstone v, multi-block production DSL) -> AmrRuntime runtime engine on the shared hierarchy, the compiled block being materialized there as a type-erased AmrRuntimeBlock.
Refined counterpart of add_compiled_model(System&, ...) (dsl_block.hpp). The AMR coupler build machinery (AmrCouplerMP<Model> + conservative reflux + regrid) is instantiated HERE, from the CALLING translation unit, on the concrete Model type – like block_builder.hpp for the flat System. The type-erased closures enter AmrSystem through AmrSystem::set_compiled_block (a non-template method) which freezes TWO builders: the mono-block one (detail::build_amr_compiled / dispatch_amr_compiled, SHARED with the native ModelSpec path of add_block once the type is resolved by detail::dispatch_model) AND the multi-block one (detail::dispatch_amr_block, also SHARED with add_block in native multi-block).
Generated by