3from __future__
import annotations
5from .PDETerm
import PDETerm
11 The algebraic, volume-distributed source term S(Q) of a hyperbolic PDE -
12 as opposed to PointSource, which contributes only at isolated points.
14 See python/exahype2/solvers/fv/riemann/kernels.py's sourceTerm(), which
15 is not normal-dependent (a volumetric source has no notion of a face
16 direction), so unlike Flux/MaxEigenvalue/MassMatrix/
17 NonconservativeProduct this term has no normal parameter to begin with.
18 It depends on the position x and the time stamp t only, i.e. neither on
19 the mesh size nor on the time step size. The signature matches
20 ::exahype2::fv::rusanov::VolumetricSourceFunctor:
23 virtual void volumetricSource(
24 const double* __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
25 const tarch::la::Vector<Dimensions, double>& x,
27 double* __restrict__ S // S[{{NUMBER_OF_UNKNOWNS}}]
34 "const double* __restrict__ Q, "
35 "const tarch::la::Vector<Dimensions, double>& x, "
37 "double* __restrict__ S"
40 NAME =
"volumetricSource"
44 implementation: str =
None,
45 stateless: bool =
False,
50 A C++ snippet that becomes volumetricSource()'s body (the empty
51 string is a valid, generated no-op body), or None (the default)
52 to leave volumetricSource() pure virtual for you to implement by
53 hand. Don't add this term to a solver at all if the PDE has no
54 volumetric source contribution.
59 implementation=implementation,
66 VolumetricSource-specific code generation
68 Reuses PDETerm.Generator's declaration/definition/GPU-offload logic
69 as-is - VolumetricSource.SIGNATURE is picked up automatically.
70 Declared explicitly (rather than left to be inherited implicitly)
71 for the same reason as Flux.Generator: the obvious place to add
72 volumetricSource-specific generation behaviour later, and so
73 volumetric_source_term.generator reports its type as
74 VolumetricSource.Generator rather than the more generic
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++ ...
VolumetricSource-specific code generation.
The algebraic, volume-distributed source term S(Q) of a hyperbolic PDE - as opposed to PointSource,...
__init__(self, str implementation=None, bool stateless=False)
implementation: str A C++ snippet that becomes volumetricSource()'s body (the empty string is a valid...