include/pops/runtime/builders/factory/model_factory.hpp File ReferenceΒΆ

adc_cpp: include/pops/runtime/builders/factory/model_factory.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
model_factory.hpp File Reference

Assemble a CompositeModel from a ModelSpec (bricks + parameters). More...

#include <pops/core/foundation/cold.hpp>
#include <pops/core/state/variables.hpp>
#include <pops/physics/bricks/bricks.hpp>
#include <pops/runtime/dynamic/model_registry.hpp>
#include <pops/runtime/config/model_spec.hpp>
#include <algorithm>
#include <stdexcept>
#include <string>
#include <vector>
+ Include dependency graph for model_factory.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  pops
 
namespace  pops::detail
 

Functions

void pops::detail::validate_model_spec (const ModelSpec &m)
 Completeness contract of a ModelSpec (ADC-290): transport and elliptic MUST be chosen explicitly.
 
template<class Visitor >
POPS_COLD_FN void pops::detail::dispatch_transport (const ModelSpec &m, Visitor &&v)
 Non-drift guard (ADC-331): the registry's n_vars column (model_registry.hpp, a LIGHT header with no brick types) MUST agree with the real brick types' ::n_vars.
 
template<int NV, class Visitor >
POPS_COLD_FN void pops::detail::dispatch_source (const ModelSpec &m, Visitor &&v)
 Builds the source brick and calls v(source).
 
template<class Visitor >
POPS_COLD_FN void pops::detail::dispatch_elliptic (const ModelSpec &m, Visitor &&v)
 Builds the elliptic right-hand-side brick and calls v(elliptic).
 
template<class Brick >
POPS_COLD_FN void pops::detail::bind_variable_roles (Brick &brk, const VariableSet &cons)
 AUTOMATIC resolution by ROLES (audit sec.5): fills the component indices of a SOURCE or ELLIPTIC brick (c_rho / c_mx / c_my / c_E) from the conservative descriptor cons of the TRANSPORT.
 
template<class Visitor >
POPS_COLD_FN void pops::detail::dispatch_model (const ModelSpec &m, Visitor &&visitor)
 Assembles the CompositeModel designated by m and calls visitor(model).
 
template<class TR , class Visitor >
POPS_COLD_FN void pops::detail::dispatch_model_for (const ModelSpec &m, TR tr, Visitor &&visitor)
 Same as dispatch_model but with the transport brick ALREADY chosen (tr).
 
POPS_COLD_FN std::vector< int > pops::detail::resolve_implicit_components (const std::string &block, const VariableSet &cons, const std::vector< std::string > &names, const std::vector< std::string > &roles)
 Resolves the IMPLICIT MASK of a block (add_block: implicit_vars / implicit_roles) into a list of conserved-component indices, against the block descriptor cons.
 
POPS_COLD_FN int pops::detail::resolve_selected_component (const std::string &origin, const std::string &block, const VariableSet &cons, const std::string &name, const std::string &role)
 Resolves a SINGLE selector variable of block (the AMR regrid variable, ADC-296) into its conserved-component index, by NAME (name) XOR by physical ROLE (role), against cons.
 

Detailed Description

Assemble a CompositeModel from a ModelSpec (bricks + parameters).

The core knows only generic BRICKS; a scenario is a composition, named on the application side (adc_cases). dispatch_model(spec, visitor) builds the CompositeModel<Hyperbolic, Source, Elliptic> designated by the spec and calls visitor(model). Invalid combinations (fluid source on a scalar transport) are rejected.