HasPrimitiveVars Concept ReferenceΒΆ

adc_cpp: pops::HasPrimitiveVars Concept 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::HasPrimitiveVars Concept Reference

OPTIONAL extension of a PhysicalModel: primitive variables + cons<->prim conversions. More...

#include <physical_model.hpp>

Concept definition

template<class M>
PhysicalModel<M> && requires(const M m, const typename M::State u, const typename M::Prim p) {
typename M::Prim;
{ m.to_primitive(u) } -> std::same_as<typename M::Prim>;
{ m.to_conservative(p) } -> std::same_as<typename M::State>;
}
OPTIONAL extension of a PhysicalModel: primitive variables + cons<->prim conversions.
Definition physical_model.hpp:167
Minimal contract of a physical model.
Definition physical_model.hpp:81

Detailed Description

OPTIONAL extension of a PhysicalModel: primitive variables + cons<->prim conversions.

Lets the spatial operator reconstruct in primitive variables (rho, u, p) rather than conservative (more robust for Euler: positivity of rho and p), and centralizes the cons <-> prim conversion (the wave speed, the collision terms u_a - u_b are expressed naturally in primitive form). A model that does not expose it reconstructs in conservative form. INVARIANT: to_primitive/to_conservative must be inverses of each other. The spatial operator then reconstructs in primitive form (more robust: rho/p positivity).