3from __future__
import annotations
5from .PDETerm
import PDETerm
11 The (possibly Q-dependent) mass matrix M(Q) multiplying the input in a
12 given direction, i.e. MTimesQ = M(Q) * Q. There is no direct legacy
13 equivalent named "mass matrix" - the closest relative is aderdg's
14 multiplyMaterialParameterMatrix() in
15 python/exahype2/solvers/aderdg/AbstractSolverDeclarations.py, which is
16 also normal-dependent, so this term follows the same reduced-signature
17 pattern as Flux/MaxEigenvalue:
20 virtual void massMatrix(
21 const double* __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
22 const tarch::la::Vector<Dimensions, double>& x,
24 double* __restrict__ MTimesQ // MTimesQ[{{NUMBER_OF_UNKNOWNS}}]
31 "const double* __restrict__ Q, "
32 "const tarch::la::Vector<Dimensions, double>& x, "
34 "double* __restrict__ MTimesQ"
41 implementation: str =
None,
42 stateless: bool =
False,
47 A C++ snippet that becomes massMatrix()'s body (the empty string
48 is a valid, generated no-op body), or None (the default) to leave
49 massMatrix() pure virtual for you to implement by hand. Don't add
50 this term to a solver at all if the PDE has an (implicit) identity
56 implementation=implementation,
63 MassMatrix-specific code generation
65 Reuses PDETerm.Generator's declaration/definition/GPU-offload logic
66 as-is - MassMatrix.SIGNATURE is picked up automatically. Declared
67 explicitly (rather than left to be inherited implicitly) for the
68 same reason as Flux.Generator: the obvious place to add
69 massMatrix-specific generation behaviour later, and so
70 mass_matrix_term.generator reports its type as MassMatrix.Generator
71 rather than the more generic PDETerm.Generator.
MassMatrix-specific code generation.
The (possibly Q-dependent) mass matrix M(Q) multiplying the input in a given direction,...
__init__(self, str implementation=None, bool stateless=False)
implementation: str A C++ snippet that becomes massMatrix()'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++ ...