1"""Hanging faces on adaptive meshes: the toolbox action sets
2(toolbox.blockstructured.api.InterpolateHangingFaces,
3toolbox.blockstructured.api.RestrictHangingFaces) and how the Finite
4Volume scheme uses them."""
14Interpolate = toolbox.blockstructured.api.InterpolateHangingFaces
15Restrict = toolbox.blockstructured.api.RestrictHangingFaces
24 body = action_set.get_body_of_operation(ActionSet.OPERATION_CREATE_HANGING_FACE)
25 assert "interpolateHaloLayer_AoS_linear_with_constant_extrapolation(" in body
26 assert "coarseGridFacesQFace(marker.getSelectedFaceNumber()).value" in body
27 assert "fineGridFaceQFace.value" in body
29 ActionSet.OPERATION_DESTROY_HANGING_FACE,
30 ActionSet.OPERATION_TOUCH_FACE_FIRST_TIME,
31 ActionSet.OPERATION_CREATE_CELL,
33 assert action_set.get_body_of_operation(operation) ==
""
38 body = action_set.get_body_of_operation(ActionSet.OPERATION_CREATE_HANGING_FACE)
39 assert "interpolateHaloLayer_AoS_piecewise_constant(" in body
44 body = action_set.get_body_of_operation(ActionSet.OPERATION_DESTROY_HANGING_FACE)
45 assert "restrictInnerHalfOfHaloLayer_AoS_averaging(" in body
46 assert "coarseGridFacesQFace(marker.getSelectedFaceNumber()).value" in body
47 clear = action_set.get_body_of_operation(ActionSet.OPERATION_TOUCH_FACE_FIRST_TIME)
48 assert "clearHaloLayerAoS(" in clear
50 action_set.get_guard_of_operation(ActionSet.OPERATION_TOUCH_FACE_FIRST_TIME)
57 body = action_set.get_body_of_operation(ActionSet.OPERATION_DESTROY_HANGING_FACE)
58 assert "restrictInnerHalfOfHaloLayer_AoS_inject(" in body
60 action_set.get_body_of_operation(ActionSet.OPERATION_TOUCH_FACE_FIRST_TIME)
71 solver, 9, **scheme_arguments
74 solver, volume_size=0.1
77 [
"probe"],
"probe",
"probe", directory=str(tmp_path)
79 exahype2_project.set_global_simulation_parameters(
84 periodic_BC=[
True,
True,
True],
88 solver.generate_solver_realisation(exahype2_project, peano_project, *graphs)
89 return solver, [{task.name: task
for task
in graph.tasks}
for graph
in graphs[:2]]
93 return [a
for a
in task.action_sets
if isinstance(a, action_set_type)]
99 solver, (setup, time_step) =
_graphs(tmp_path)
101 assert interpolation.scheme == Interpolate.Scheme.Linear
102 assert interpolation.d[
"FACE_NAME"] == solver._patch_overlap_current_time_step.name
104 assert restriction.scheme == Restrict.Scheme.Averaging
105 assert restriction.d[
"FACE_NAME"] == solver._patch_overlap_update.name
107 setup[
"Probe Project on faces"], Restrict
109 assert setup_restriction.d[
"FACE_NAME"] == solver._patch_overlap_update.name
113 _, (setup, time_step) =
_graphs(
115 interpolation=Interpolate.Scheme.PiecewiseConstant,
116 restriction=Restrict.Scheme.Inject,
119 assert interpolation.scheme == Interpolate.Scheme.PiecewiseConstant
120 for task
in [time_step[
"Probe_Project on faces"], setup[
"Probe Project on faces"]]:
122 assert restriction.scheme == Restrict.Scheme.Inject
The conservative flux F(Q) of a hyperbolic PDE.
Point-wise initial condition: given the physical position of a single degree of freedom,...
The maximum absolute eigenvalue of the flux Jacobian in a given direction, i.e.
Abstract base class for all ExaHyPE 2 solvers.
Finite Volumes with a Rusanov Riemann solver and explicit Euler time stepping, realised over a block-...
Setup phase counterpart to RusanovWithExplicitEuler: sets the initial condition for a Finite Volume s...
Represents a Peano 4 project.
Patch implementation of a degree of freedom.
Action set (reactions to events)
Holds a sequence of Task instances.
The Python-side model of "what happens during one mesh sweep".
The task graph abstraction allows users to formalise their solver steps over small task graphs which ...
test_interpolation_defaults_to_linear_in_create_hanging_face()
test_time_step_interpolates_before_reconstruction_and_restricts_projection(tmp_path)
_action_sets_of_type(task, action_set_type)
test_injection_does_not_clear_faces()
test_averaging_restricts_in_destroy_hanging_face_and_clears_faces()
test_piecewise_constant_interpolation()
_graphs(tmp_path, **scheme_arguments)
test_schemes_are_configurable(tmp_path)