3from .DynamicMeshRefinement
import DynamicMeshRefinement
9 Evaluate the gradient-based refinement criterion and collect the outcome
10 as refine and erase requests
12 The action set is the counterpart of
13 exahype2.api.blockstructured.DynamicMeshRefinement for solvers with an
14 exahype2.api.GradientRefinement PDE term. It differs only in what it
15 evaluates per volume: For each coordinate axis, it computes the left and
16 the right difference quotient of the solution
17 (@ref exahype2::fv::computeOneSidedGradient()) and hands each of them to
18 the term, i.e. it calls the term 2*Dimensions times per volume. Each
19 call starts from Keep.
21 A volume asks for a refinement if any call says Refine, and it may be
22 erased only if all calls say Erase. As the action set combines the
23 volumes of a cell the same way, it simply treats each call like the
24 outcome of one further volume. Everything else, i.e. the mesh size
25 bounds and the bookkeeping within the refinement service, is inherited.
30 TemplateEvaluateVolume =
"""
31 for (int normal=0; normal<Dimensions; normal++) {
32 for (int side=0; side<2; side++) {
33 double gradient[{{NUMBER_OF_UNKNOWNS}} + {{NUMBER_OF_AUXILIARY_VARIABLES}}];
34 ::exahype2::fv::computeOneSidedGradient(
35 fineGridCell{{UNKNOWN_IDENTIFIER}}.value,
36 {{NUMBER_OF_UNKNOWNS}} + {{NUMBER_OF_AUXILIARY_VARIABLES}},
37 {{NUMBER_OF_VOLUMES_PER_AXIS}},
41 ::exahype2::fv::getVolumeLength( marker.h(), {{NUMBER_OF_VOLUMES_PER_AXIS}} ),
44 ::exahype2::RefinementCommand command = ::exahype2::RefinementCommand::Keep;
45 repositories::{{SOLVER_INSTANCE}}.refineEraseWithGradient(
50 anyVolumeWantsToRefine = anyVolumeWantsToRefine or command == ::exahype2::RefinementCommand::Refine;
51 allVolumesWantToErase = allVolumesWantToErase and command == ::exahype2::RefinementCommand::Erase;
57 return __name__.replace(
".py",
"").replace(
".",
"_")
Evaluate the gradient-based refinement criterion and collect the outcome as refine and erase requests...
get_action_set_name(self)
Return unique action set name.
Evaluate the point-wise refinement criterion and collect the outcome as refine and erase requests.