CompositeModel< Hyperbolic, Source, Elliptic > Struct Template ReferenceΒΆ

adc_cpp: pops::CompositeModel< Hyperbolic, Source, Elliptic > Struct 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::CompositeModel< Hyperbolic, Source, Elliptic > Struct Template Reference

Composite physical model: one HYPERBOLIC brick + one source + one elliptic right-hand side. More...

#include <composite.hpp>

+ Collaboration diagram for pops::CompositeModel< Hyperbolic, Source, Elliptic >:

Public Types

using State = StateVec< Hyperbolic::n_vars >
 
using Prim = typename Hyperbolic::Prim
 
using Aux = pops::Aux
 

Public Member Functions

POPS_HD State flux (const State &u, const Aux &a, int dir) const
 
POPS_HD Real max_wave_speed (const State &u, const Aux &a, int dir) const
 
POPS_HD State source (const State &u, const Aux &a) const
 
POPS_HD Real elliptic_rhs (const State &u) const
 
POPS_HD Prim to_primitive (const State &u) const
 
POPS_HD State to_conservative (const Prim &p) const
 
POPS_HD Real pressure (const State &u) const
 
POPS_HD void wave_speeds (const State &u, const Aux &a, int dir, Real &smin, Real &smax) const
 
POPS_HD Real contact_speed (const State &ul, const State &ur, Real pl, Real pr, Real sl, Real sr, int dir) const
 Riemann CAPABILITIES (audit wave 3): HLLC hooks (contact_speed + hllc_star_state) and Roe (roe_dissipation) forwarded from the HYPERBOLIC brick when it declares them (the DSL emits them via enable_hllc; a C++ model can write them by hand).
 
POPS_HD State hllc_star_state (const State &u, Real p, Real s, Real sStar, int dir) const
 
POPS_HD State roe_dissipation (const State &ul, const Aux &al, const State &ur, const Aux &ar, int dir) const
 
POPS_HD State polar_geom_source (const State &u, Real r) const
 GEOMETRIC source term of polar curvature, delegated to the hyperbolic brick when it exposes it (polar fluid: IsothermalFluxPolar).
 
POPS_HD Real stability_speed (const State &u, const Aux &a, int dir) const
 Optional STEP BOUNDS (audit 2026-06, see core/physical_model.hpp): forwarded conditionally like pressure / wave_speeds, otherwise the composite does not expose them and the step policy stays the history.
 
POPS_HD Real stability_dt (const State &u, const Aux &a) const
 
POPS_HD Real source_frequency (const State &u, const Aux &a) const
 
POPS_HD State project (const State &u, const Aux &a) const
 PROJECTION PONCTUELLE post-pas (ADC-177) : forwardee depuis la brique HYPERBOLIQUE quand elle declare project(U, aux) (le DSL l'emet via m.projection ; une brique native peut l'ecrire a la main).
 
POPS_HD void source_jacobian (const State &u, const Aux &a, Real(&J)[n_vars][n_vars]) const
 ANALYTIC JACOBIAN of the source (audit wave 3): forwarded from the SOURCE brick when it declares jacobian(U, aux, J) (J[r][c] = dS_r/dU_c).
 

Static Public Member Functions

static VariableSet conservative_vars ()
 
static VariableSet primitive_vars ()
 

Public Attributes

Hyperbolic hyp {}
 
Source src {}
 
Elliptic ell {}
 

Static Public Attributes

static constexpr int n_vars = Hyperbolic::n_vars
 
static constexpr int n_aux
 

Detailed Description

template<class Hyperbolic, class Source, class Elliptic>
struct pops::CompositeModel< Hyperbolic, Source, Elliptic >

Composite physical model: one HYPERBOLIC brick + one source + one elliptic right-hand side.

Satisfies the PhysicalModel concept; the Vars (conversions + descriptor), the flux and the wave speeds come from the hyperbolic; pressure / wave_speeds are exposed when the hyperbolic provides them (required by the HLLC / Roe flux).

CONTRACT: CompositeModel is a pure function of its 3 bricks, device-callable (POPS_HD). No MultiFab, no allocation, no global access. Every delegated method inherits the device-clean invariant of the underlying brick.

n_aux propagation: n_aux = max(aux_comps<Hyperbolic>, aux_comps<Source>, aux_comps<Elliptic>). The system sizes the aux channel accordingly. A brick without n_aux (default kAuxBaseComps=3) does not change the bit-identical history.

Member Typedef Documentation

◆ Aux

template<class Hyperbolic , class Source , class Elliptic >
using pops::CompositeModel< Hyperbolic, Source, Elliptic >::Aux = pops::Aux

◆ Prim

template<class Hyperbolic , class Source , class Elliptic >
using pops::CompositeModel< Hyperbolic, Source, Elliptic >::Prim = typename Hyperbolic::Prim

◆ State

template<class Hyperbolic , class Source , class Elliptic >
using pops::CompositeModel< Hyperbolic, Source, Elliptic >::State = StateVec<Hyperbolic::n_vars>

Member Function Documentation

◆ conservative_vars()

template<class Hyperbolic , class Source , class Elliptic >
static VariableSet pops::CompositeModel< Hyperbolic, Source, Elliptic >::conservative_vars ( )
inlinestatic

◆ contact_speed()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD Real pops::CompositeModel< Hyperbolic, Source, Elliptic >::contact_speed ( const State ul,
const State ur,
Real  pl,
Real  pr,
Real  sl,
Real  sr,
int  dir 
) const
inline

Riemann CAPABILITIES (audit wave 3): HLLC hooks (contact_speed + hllc_star_state) and Roe (roe_dissipation) forwarded from the HYPERBOLIC brick when it declares them (the DSL emits them via enable_hllc; a C++ model can write them by hand).

Concept-gated like pressure / wave_speeds: without hooks, the composite does not expose them (canonical paths / explicit rejections unchanged).

◆ elliptic_rhs()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD Real pops::CompositeModel< Hyperbolic, Source, Elliptic >::elliptic_rhs ( const State u) const
inline

◆ flux()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD State pops::CompositeModel< Hyperbolic, Source, Elliptic >::flux ( const State u,
const Aux a,
int  dir 
) const
inline

◆ hllc_star_state()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD State pops::CompositeModel< Hyperbolic, Source, Elliptic >::hllc_star_state ( const State u,
Real  p,
Real  s,
Real  sStar,
int  dir 
) const
inline

◆ max_wave_speed()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD Real pops::CompositeModel< Hyperbolic, Source, Elliptic >::max_wave_speed ( const State u,
const Aux a,
int  dir 
) const
inline

◆ polar_geom_source()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD State pops::CompositeModel< Hyperbolic, Source, Elliptic >::polar_geom_source ( const State u,
Real  r 
) const
inline

GEOMETRIC source term of polar curvature, delegated to the hyperbolic brick when it exposes it (polar fluid: IsothermalFluxPolar).

Concept-gated like pressure / wave_speeds: if the hyperbolic does not provide it (polar ExB scalar transport), CompositeModel does not expose it -> assemble_rhs_polar falls back to 0 (bit-identical). Does NOT touch the cartesian (assemble_rhs never calls it).

◆ pressure()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD Real pops::CompositeModel< Hyperbolic, Source, Elliptic >::pressure ( const State u) const
inline

◆ primitive_vars()

template<class Hyperbolic , class Source , class Elliptic >
static VariableSet pops::CompositeModel< Hyperbolic, Source, Elliptic >::primitive_vars ( )
inlinestatic

◆ project()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD State pops::CompositeModel< Hyperbolic, Source, Elliptic >::project ( const State u,
const Aux a 
) const
inline

PROJECTION PONCTUELLE post-pas (ADC-177) : forwardee depuis la brique HYPERBOLIQUE quand elle declare project(U, aux) (le DSL l'emet via m.projection ; une brique native peut l'ecrire a la main).

Concept-gate comme stability_speed : sans methode, le compose ne l'expose pas et le stepper n'applique aucune projection (chemin bit-identique).

◆ roe_dissipation()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD State pops::CompositeModel< Hyperbolic, Source, Elliptic >::roe_dissipation ( const State ul,
const Aux al,
const State ur,
const Aux ar,
int  dir 
) const
inline

◆ source()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD State pops::CompositeModel< Hyperbolic, Source, Elliptic >::source ( const State u,
const Aux a 
) const
inline

◆ source_frequency()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD Real pops::CompositeModel< Hyperbolic, Source, Elliptic >::source_frequency ( const State u,
const Aux a 
) const
inline

◆ source_jacobian()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD void pops::CompositeModel< Hyperbolic, Source, Elliptic >::source_jacobian ( const State u,
const Aux a,
Real(&)  J[n_vars][n_vars] 
) const
inline

ANALYTIC JACOBIAN of the source (audit wave 3): forwarded from the SOURCE brick when it declares jacobian(U, aux, J) (J[r][c] = dS_r/dU_c).

The Newton of the implicit source uses it instead of finite differences (HasSourceJacobian trait); without the method, nothing is exposed and the Newton keeps the historical finite differences.

◆ stability_dt()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD Real pops::CompositeModel< Hyperbolic, Source, Elliptic >::stability_dt ( const State u,
const Aux a 
) const
inline

◆ stability_speed()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD Real pops::CompositeModel< Hyperbolic, Source, Elliptic >::stability_speed ( const State u,
const Aux a,
int  dir 
) const
inline

Optional STEP BOUNDS (audit 2026-06, see core/physical_model.hpp): forwarded conditionally like pressure / wave_speeds, otherwise the composite does not expose them and the step policy stays the history.

stability_speed / stability_dt come from the HYPERBOLIC brick (it is the one the DSL emits); source_frequency comes from the SOURCE brick (it is the source that knows its relaxation/collision frequency).

◆ to_conservative()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD State pops::CompositeModel< Hyperbolic, Source, Elliptic >::to_conservative ( const Prim p) const
inline

◆ to_primitive()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD Prim pops::CompositeModel< Hyperbolic, Source, Elliptic >::to_primitive ( const State u) const
inline

◆ wave_speeds()

template<class Hyperbolic , class Source , class Elliptic >
POPS_HD void pops::CompositeModel< Hyperbolic, Source, Elliptic >::wave_speeds ( const State u,
const Aux a,
int  dir,
Real smin,
Real smax 
) const
inline

Member Data Documentation

◆ ell

template<class Hyperbolic , class Source , class Elliptic >
Elliptic pops::CompositeModel< Hyperbolic, Source, Elliptic >::ell {}

◆ hyp

template<class Hyperbolic , class Source , class Elliptic >
Hyperbolic pops::CompositeModel< Hyperbolic, Source, Elliptic >::hyp {}

◆ n_aux

template<class Hyperbolic , class Source , class Elliptic >
constexpr int pops::CompositeModel< Hyperbolic, Source, Elliptic >::n_aux
staticconstexpr
Initial value:
= [] {
int w = aux_comps<Hyperbolic>();
if (aux_comps<Source>() > w)
w = aux_comps<Source>();
if (aux_comps<Elliptic>() > w)
w = aux_comps<Elliptic>();
return w;
}()

◆ n_vars

template<class Hyperbolic , class Source , class Elliptic >
constexpr int pops::CompositeModel< Hyperbolic, Source, Elliptic >::n_vars = Hyperbolic::n_vars
staticconstexpr

◆ src

template<class Hyperbolic , class Source , class Elliptic >
Source pops::CompositeModel< Hyperbolic, Source, Elliptic >::src {}

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