3from __future__
import annotations
5from .PDETerm
import PDETerm
11 The conservative flux F(Q) of a hyperbolic PDE
13 See python/exahype2/solvers/fv/riemann/kernels.py for the legacy
14 equivalent, which additionally threads h/t/dt through the signature.
15 This new API's flux() is, for now, deliberately reduced to
19 const double* __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
20 const tarch::la::Vector<Dimensions, double>& x,
22 double* __restrict__ F // F[{{NUMBER_OF_UNKNOWNS}}]
26 h/t/dt will return once PDE terms are tied to real C code snippets with
27 proper signatures; until then every term merely gets position, normal
28 (where physically meaningful) and its input/output.
30 Q holds unknowns+auxiliary_variables entries, whereas the output F only
31 holds unknowns entries: only the actual unknowns are subject to the
32 hyperbolic formulation, auxiliary variables are not.
37 "const double* __restrict__ Q, "
38 "const tarch::la::Vector<Dimensions, double>& x, "
40 "double* __restrict__ F"
47 implementation: str =
None,
48 stateless: bool =
False,
53 A C++ snippet that becomes flux()'s body (the empty string is a
54 valid, generated no-op body), or None (the default) to leave
55 flux() pure virtual for you to implement by hand. Don't add this
56 term to a solver at all if the PDE has no flux contribution.
61 implementation=implementation,
68 Flux-specific code generation
70 Reuses PDETerm.Generator's declaration/definition/GPU-offload logic
71 as-is - Flux.SIGNATURE is picked up automatically. Declared
72 explicitly (rather than left to be inherited implicitly) so that
73 Flux.Generator is the obvious place to add flux-specific generation
74 behaviour later, and so flux_term.generator reports its type as
75 Flux.Generator rather than the more generic PDETerm.Generator.
Flux-specific code generation.
The conservative flux F(Q) of a hyperbolic PDE.
__init__(self, str implementation=None, bool stateless=False)
implementation: str A C++ snippet that becomes flux()'s body (the empty string is a valid,...
Turns a PDETerm into the C++ text for its generated method: exactly one method - the static,...
Represents one named, point-wise PDE operator that a solver exposes for the user to implement: a C++ ...