3from __future__
import annotations
5from .PDETerm
import PDETerm
11 A source term that contributes only at isolated points (e.g. a seismic
12 point source), as opposed to VolumetricSource, which is distributed over
15 See python/exahype2/solvers/aderdg/AbstractSolverDeclarations.py's
16 pointSource(), which additionally takes t, dt and an index n selecting
17 which of possibly several point sources is being evaluated - dropped
18 here the same way h/t/dt are dropped from Flux, and n returns once PDE
19 terms are tied to real C code snippets with proper signatures:
22 virtual void pointSource(
23 const double* __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
24 const tarch::la::Vector<Dimensions, double>& x,
25 double* __restrict__ forceVector // forceVector[{{NUMBER_OF_UNKNOWNS}}]
32 "const double* __restrict__ Q, "
33 "const tarch::la::Vector<Dimensions, double>& x, "
34 "double* __restrict__ forceVector"
41 implementation: str =
None,
42 stateless: bool =
False,
47 A C++ snippet that becomes pointSource()'s body (the empty string
48 is a valid, generated no-op body), or None (the default) to leave
49 pointSource() pure virtual for you to implement by hand. Don't add
50 this term to a solver at all if the PDE has no point source
56 implementation=implementation,
63 PointSource-specific code generation
65 Reuses PDETerm.Generator's declaration/definition/GPU-offload logic
66 as-is - PointSource.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 pointSource-specific generation behaviour later, and so
70 point_source_term.generator reports its type as
71 PointSource.Generator rather than the more generic PDETerm.Generator.
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++ ...
PointSource-specific code generation.
A source term that contributes only at isolated points (e.g.
__init__(self, str implementation=None, bool stateless=False)
implementation: str A C++ snippet that becomes pointSource()'s body (the empty string is a valid,...