3from __future__
import annotations
5from .PDETerm
import PDETerm
11 The non-conservative product B(Q) applied to a jump deltaQ in a given
12 direction, i.e. BTimesDeltaQ = B(Q) * deltaQ
14 The signature matches ::exahype2::fv::rusanov::NonconservativeProductFunctor,
15 i.e. what the Rusanov kernels hand over:
18 virtual void nonconservativeProduct(
19 const double* __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
20 const double* __restrict__ deltaQ, // deltaQ[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
21 const tarch::la::Vector<Dimensions, double>& x,
22 const tarch::la::Vector<Dimensions, double>& volumeSize,
26 double* __restrict__ BTimesDeltaQ // BTimesDeltaQ[{{NUMBER_OF_UNKNOWNS}}]
30 The kernels evaluate the term on each face of a volume: Q is the average
31 of the two adjacent volumes, deltaQ the difference right minus left (or
32 top minus bottom, ...) along normal. Both include the auxiliary
33 variables, so a term can use the jump of a material parameter, e.g. of
34 a bathymetry. The output only holds unknowns entries.
36 The size of the volume is called volumeSize rather than h - as it is in
37 the legacy API - as h frequently is the name of an unknown, e.g. the
38 water height of the shallow water equations.
43 "const double* __restrict__ Q, "
44 "const double* __restrict__ deltaQ, "
45 "const tarch::la::Vector<Dimensions, double>& x, "
46 "const tarch::la::Vector<Dimensions, double>& volumeSize, "
50 "double* __restrict__ BTimesDeltaQ"
53 NAME =
"nonconservativeProduct"
57 implementation: str =
None,
58 stateless: bool =
False,
63 A C++ snippet that becomes nonconservativeProduct()'s body (the
64 empty string is a valid, generated no-op body), or None (the
65 default) to leave nonconservativeProduct() pure virtual for you to
66 implement by hand. Don't add this term to a solver at all if the
67 PDE has no non-conservative contribution.
72 implementation=implementation,
79 NonconservativeProduct-specific code generation
81 Reuses PDETerm.Generator's declaration/definition/GPU-offload logic
82 as-is - NonconservativeProduct.SIGNATURE is picked up automatically.
83 Declared explicitly (rather than left to be inherited implicitly)
84 for the same reason as Flux.Generator: the obvious place to add
85 nonconservativeProduct-specific generation behaviour later, and so
86 ncp_term.generator reports its type as
87 NonconservativeProduct.Generator rather than the more generic
NonconservativeProduct-specific code generation.
The non-conservative product B(Q) applied to a jump deltaQ in a given direction, i....
__init__(self, str implementation=None, bool stateless=False)
implementation: str A C++ snippet that becomes nonconservativeProduct()'s body (the empty string is a...
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++ ...