3from __future__
import annotations
5from .AdaptivityCriterion
import AdaptivityCriterion
11 Point-wise refinement criterion: given the solution Q at a single degree
12 of freedom, its position x and the time stamp t, decide whether the mesh
13 around this point should be refined, erased (coarsened) or kept.
16 virtual void refineErasePointwisely(
17 const double* __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
18 const tarch::la::Vector<Dimensions, double>& x,
20 ::exahype2::RefinementCommand* __restrict__ refinementCommand
24 Like all the other PDE terms, the generated method returns void and
25 writes its outcome into an output argument. The output semantics are
26 those of every adaptivity criterion (@ref exahype2.api.AdaptivityCriterion).
28 Different to the legacy refinementCriterion(Q, x, h, t), the term is not
29 handed the mesh size. Bounds on the mesh size are the job of the grid
30 construction, not of the physics.
32 Q holds unknowns+auxiliary_variables entries.
37 "const double* __restrict__ Q, "
38 "const tarch::la::Vector<Dimensions, double>& x, "
40 "::exahype2::RefinementCommand* __restrict__ refinementCommand"
43 NAME =
"refineErasePointwisely"
47 implementation: str =
None,
48 stateless: bool =
False,
52 @param implementation: str
53 A C++ snippet that becomes refineErasePointwisely()'s body, or None
54 (the default) to leave refineErasePointwisely() pure virtual for
55 you to implement by hand. The empty string is a valid body: it
56 leaves *refinementCommand untouched, i.e. at Keep.
58 @param stateless: bool
59 Generate a static, GPU-offloadable method instead of a virtual
60 one. Requires an implementation.
65 implementation=implementation,
72 RefineErasePointwisely-specific code generation
74 Reuses PDETerm.Generator as-is: RefineErasePointwisely.SIGNATURE is
75 picked up automatically. Declared explicitly for the same reason as
76 Flux.Generator, i.e. as the place for term-specific generation
Base class of all the PDE terms which decide where to refine or coarsen the mesh.
Turns a PDETerm into the C++ text for its generated method: exactly one method - the static,...
RefineErasePointwisely-specific code generation.
Point-wise refinement criterion: given the solution Q at a single degree of freedom,...
__init__(self, str implementation=None, bool stateless=False)