ModelAdapter< M > Struct Template ReferenceΒΆ

adc_cpp: pops::ModelAdapter< M > 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::ModelAdapter< M > Struct Template Referencefinal

Adapts a STATIC model M into IModel<M::n_vars>. More...

#include <dynamic_model.hpp>

+ Inheritance diagram for pops::ModelAdapter< M >:
+ Collaboration diagram for pops::ModelAdapter< M >:

Public Types

using State = StateVec< M::n_vars >
 
- Public Types inherited from pops::IModel< M::n_vars >
using State = StateVec< NV >
 

Public Member Functions

 ModelAdapter ()=default
 
 ModelAdapter (M m)
 
State flux (const State &u, const Aux &a, int dir) const override
 
Real max_wave_speed (const State &u, const Aux &a, int dir) const override
 
State source (const State &u, const Aux &a) const override
 
Real elliptic_rhs (const State &u) const override
 
State to_primitive (const State &u) const override
 
State to_conservative (const State &p) const override
 
int n_aux () const override
 Width of the aux channel that the model READS (cf.
 
- Public Member Functions inherited from pops::IModel< M::n_vars >
virtual ~IModel ()=default
 
virtual State flux (const State &u, const Aux &a, int dir) const=0
 
virtual Real max_wave_speed (const State &u, const Aux &a, int dir) const=0
 
virtual State source (const State &, const Aux &) const
 Source term S(U, aux) (default: zero, model without source).
 
virtual Real elliptic_rhs (const State &) const
 Elliptic right-hand side f(U) of the system Poisson (default: zero, no coupling).
 
virtual State to_primitive (const State &u) const
 Conservative -> primitive conversion (P = M.to_primitive(U)).
 
virtual State to_conservative (const State &p) const
 Primitive -> conservative conversion (U = M.to_conservative(P)).
 

Public Attributes

model {}
 

Additional Inherited Members

- Static Public Attributes inherited from pops::IModel< M::n_vars >
static constexpr int n_vars
 

Detailed Description

template<class M>
struct pops::ModelAdapter< M >

Adapts a STATIC model M into IModel<M::n_vars>.

M may be a hyperbolic brick (flux + max_wave_speed) or a full CompositeModel (flux + source + elliptic_rhs): source / elliptic_rhs are forwarded WHEN M exposes them (otherwise default value). Lets a model GENERATED by the DSL (CompositeModel<GenHyp, GenSrc, GenEll>) be loaded at runtime as a real coupled block.

Member Typedef Documentation

◆ State

template<class M >
using pops::ModelAdapter< M >::State = StateVec<M::n_vars>

Constructor & Destructor Documentation

◆ ModelAdapter() [1/2]

template<class M >
pops::ModelAdapter< M >::ModelAdapter ( )
default

◆ ModelAdapter() [2/2]

template<class M >
pops::ModelAdapter< M >::ModelAdapter ( m)
inlineexplicit

Member Function Documentation

◆ elliptic_rhs()

template<class M >
Real pops::ModelAdapter< M >::elliptic_rhs ( const State u) const
inlineoverride

◆ flux()

template<class M >
State pops::ModelAdapter< M >::flux ( const State u,
const Aux a,
int  dir 
) const
inlineoverride

◆ max_wave_speed()

template<class M >
Real pops::ModelAdapter< M >::max_wave_speed ( const State u,
const Aux a,
int  dir 
) const
inlineoverride

◆ n_aux()

template<class M >
int pops::ModelAdapter< M >::n_aux ( ) const
inlineoverridevirtual

Width of the aux channel that the model READS (cf.

aux_comps). Lets the System runtime size and marshal the right number of components to the host path (B_z...). Default: base contract (phi/grad), for a model that does not read any extra field.

Reimplemented from pops::IModel< M::n_vars >.

◆ source()

template<class M >
State pops::ModelAdapter< M >::source ( const State u,
const Aux a 
) const
inlineoverride

◆ to_conservative()

template<class M >
State pops::ModelAdapter< M >::to_conservative ( const State p) const
inlineoverride

◆ to_primitive()

template<class M >
State pops::ModelAdapter< M >::to_primitive ( const State u) const
inlineoverride

Member Data Documentation

◆ model

template<class M >
M pops::ModelAdapter< M >::model {}

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