3from __future__
import annotations
5from .PDETerm
import PDETerm
11 Point-wise initial condition: given the physical position of a single
12 degree of freedom, write its initial Q there.
14 Unlike the legacy, cell-wise initialCondition() (handed a whole mesh
15 cell's centre and extent plus gridIsConstructed, and expected to fill an
16 entire patch itself - see python/exahype2/solvers/rkfd/*.template.h),
17 this term is evaluated once per degree of freedom, exactly like Flux and
21 virtual void initPointWisely(
22 const tarch::la::Vector<Dimensions, double>& x,
23 double* __restrict__ Q // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
27 Q holds unknowns+auxiliary_variables entries - the whole state, not just
28 the hyperbolic unknowns Flux/MaxEigenvalue work with - since this term
29 has to set up everything a fresh degree of freedom needs, not just
30 contribute to an already-existing state.
35 "const tarch::la::Vector<Dimensions, double>& x, "
36 "double* __restrict__ Q"
39 NAME =
"initPointWisely"
43 implementation: str =
None,
44 stateless: bool =
False,
49 A C++ snippet that becomes initPointWisely()'s body (the empty
50 string is a valid, generated no-op body, though a no-op initial
51 condition leaves Q uninitialised), or None (the default) to leave
52 initPointWisely() pure virtual for you to implement by hand.
54 A grid construction such as exahype2.api.fv.SetupSimulationOverRegularGrid
55 validates that the solver it is attached to has this term
56 registered before it does anything else, since it relies on it to
57 fill in the initial condition.
62 implementation=implementation,
69 InitPointWisely-specific code generation
71 Reuses PDETerm.Generator's declaration/definition/GPU-offload logic
72 as-is - InitPointWisely.SIGNATURE is picked up automatically.
73 Declared explicitly (rather than left to be inherited implicitly)
74 for the same reason as Flux.Generator: the obvious place to add
75 initPointWisely-specific generation behaviour later, and so
76 init_point_wisely_term.generator reports its type as
77 InitPointWisely.Generator rather than the more generic
InitPointWisely-specific code generation.
Point-wise initial condition: given the physical position of a single degree of freedom,...
__init__(self, str implementation=None, bool stateless=False)
implementation: str A C++ snippet that becomes initPointWisely()'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++ ...