3from __future__
import annotations
5from ..PDETerm
import PDETerm
11 Dirichlet boundary conditions: given a position x outside of the domain
12 and a time stamp t, write the prescribed solution Q there.
15 virtual void dirichletBoundaryConditions(
16 const tarch::la::Vector<Dimensions, double>& x,
18 double* __restrict__ Q // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
22 Different to the legacy boundaryConditions() (@see
23 python/exahype2/solvers/fv/SingleSweepAbstract.template.h), the term is
24 not handed the solution inside the domain, the face's normal or the
25 mesh size. It is parameterised through position and time only.
27 A Finite Volume scheme such as exahype2.api.fv.RusanovWithExplicitEuler
28 evaluates the term at the centres of the ghost volumes, i.e. of the
29 volumes of the halo layer which lie outside of the domain, and stores
30 the result in the face data its reconstruction reads from (@see
31 exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions). t is the
32 time stamp of the solution that the time step is about to advance.
34 A solver needs this term if and only if at least one axis of the domain
35 is not periodic (@see exahype2.api.Project.set_global_simulation_parameters()).
36 If all axes are periodic, the term is never invoked, and the time step
37 does not contain any boundary handling at all.
39 Only the non-stateless variant is supported at the moment, i.e. the
40 term has to be added with stateless=False.
45 "const tarch::la::Vector<Dimensions, double>& x, "
47 "double* __restrict__ Q"
50 NAME =
"dirichletBoundaryConditions"
54 implementation: str =
None,
55 stateless: bool =
False,
59 @param implementation: str
60 A C++ snippet that becomes dirichletBoundaryConditions()'s body,
61 or None (the default) to leave dirichletBoundaryConditions() pure
62 virtual for you to implement by hand.
64 @param stateless: bool
65 Has to be False at the moment, @see the class documentation.
70 implementation=implementation,
77 DirichletBoundaryConditions-specific code generation
79 Reuses PDETerm.Generator as-is - DirichletBoundaryConditions.SIGNATURE
80 is picked up automatically. Declared explicitly for the same reason
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++ ...
DirichletBoundaryConditions-specific code generation.
Dirichlet boundary conditions: given a position x outside of the domain and a time stamp t,...
__init__(self, str implementation=None, bool stateless=False)