1"""Unit tests for the gradient-based refinement criterion
2(@ref exahype2.api.GradientRefinement)."""
15 assert exahype2.api.GradientRefinement.SIGNATURE == (
16 "const double* __restrict__ gradient, "
18 "::exahype2::RefinementCommand* __restrict__ refinementCommand"
24 assert declaration.startswith(
"virtual void refineEraseWithGradient(")
25 assert declaration.rstrip().endswith(
") = 0;")
29 body =
"if (gradient[0] > 1.0) *refinementCommand = ::exahype2::RefinementCommand::Refine;"
31 definition = term.generator.generate_out_of_class_definitions(
32 "probe::AbstractProbe"
34 assert definition.startswith(
"void probe::AbstractProbe::refineEraseWithGradient(")
35 assert body
in definition
42 assert stub.startswith(
"void probe::Probe::refineEraseWithGradient(")
43 assert 'logTraceInWith1Argument("refineEraseWithGradient(...)", normal);' in stub
44 assert "not implemented yet" in stub
Base class of all the PDE terms which decide where to refine or coarsen the mesh.
Gradient-based refinement criterion: given a one-sided difference quotient of the solution along one ...
Point-wise refinement criterion: given the solution Q at a single degree of freedom,...
test_stub_traces_normal_only()
test_implementation_becomes_body()
test_signature_takes_gradient_and_normal()
test_both_criteria_are_adaptivity_criteria()
test_declaration_is_void_and_pure_virtual_without_implementation()