IModel< NV > Struct Template ReferenceΒΆ

adc_cpp: pops::IModel< NV > 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::IModel< NV > Struct Template Referenceabstract

Hyperbolic model seen behind a virtual interface (runtime dispatch). More...

#include <dynamic_model.hpp>

+ Inheritance diagram for pops::IModel< NV >:
+ Collaboration diagram for pops::IModel< NV >:

Public Types

using State = StateVec< NV >
 

Public Member Functions

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)).
 
virtual int n_aux () const
 Width of the aux channel that the model READS (cf.
 

Static Public Attributes

static constexpr int n_vars = NV
 

Detailed Description

template<int NV>
struct pops::IModel< NV >

Hyperbolic model seen behind a virtual interface (runtime dispatch).

Member Typedef Documentation

◆ State

template<int NV>
using pops::IModel< NV >::State = StateVec<NV>

Constructor & Destructor Documentation

◆ ~IModel()

template<int NV>
virtual pops::IModel< NV >::~IModel ( )
virtualdefault

Member Function Documentation

◆ elliptic_rhs()

template<int NV>
virtual Real pops::IModel< NV >::elliptic_rhs ( const State ) const
inlinevirtual

Elliptic right-hand side f(U) of the system Poisson (default: zero, no coupling).

◆ flux()

template<int NV>
virtual State pops::IModel< NV >::flux ( const State u,
const Aux a,
int  dir 
) const
pure virtual
+ Here is the caller graph for this function:

◆ max_wave_speed()

template<int NV>
virtual Real pops::IModel< NV >::max_wave_speed ( const State u,
const Aux a,
int  dir 
) const
pure virtual
+ Here is the caller graph for this function:

◆ n_aux()

template<int NV>
virtual int pops::IModel< NV >::n_aux ( ) const
inlinevirtual

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 in pops::ModelAdapter< M >.

◆ source()

template<int NV>
virtual State pops::IModel< NV >::source ( const State ,
const Aux  
) const
inlinevirtual

Source term S(U, aux) (default: zero, model without source).

+ Here is the caller graph for this function:

◆ to_conservative()

template<int NV>
virtual State pops::IModel< NV >::to_conservative ( const State p) const
inlinevirtual

Primitive -> conservative conversion (U = M.to_conservative(P)).

Counterpart of to_primitive; used by System::set_primitive_state (init from primitives). Identity by default.

◆ to_primitive()

template<int NV>
virtual State pops::IModel< NV >::to_primitive ( const State u) const
inlinevirtual

Conservative -> primitive conversion (P = M.to_primitive(U)).

The DSL/CompositeModel exposes it (hyperbolic brick); a model without conversion (pure scalar) leaves it as the IDENTITY (prim == cons), which is exact for scalar transport. Used by host marshaling of System::get_primitive_state. Prim shares the same NV width as State (cf. concept).

+ Here is the caller graph for this function:

Member Data Documentation

◆ n_vars

template<int NV>
constexpr int pops::IModel< NV >::n_vars = NV
staticconstexpr

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