Peano
Loading...
Searching...
No Matches
AdaptMeshAndBalanceLoad.py
Go to the documentation of this file.
1# This file is part of the ExaHyPE2 project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
3import peano4.api
4
6 AdaptMeshAndBalanceLoad as BlockStructuredAdaptMeshAndBalanceLoad,
7)
8from .actionsets import DiscardPatchInterior
9from .actionsets import ProjectPatchOntoFaces
10from .actionsets import RollOverUpdatedFaceWithSommerfeldBoundaryConditions
11
12
13class AdaptMeshAndBalanceLoad(BlockStructuredAdaptMeshAndBalanceLoad):
14 """!
15
16 Default mesh adaptation of the Finite Volume schemes
17
18 exahype2.api.fv.RusanovWithExplicitEuler and
19 exahype2.api.fv.RusanovWithOptimisticExplicitEuler use this mesh
20 adaptation unless the user assigns another one to solver.mesh_adaptation.
21 @see exahype2.api.blockstructured.AdaptMeshAndBalanceLoad for the tasks.
22 On top of these, the Finite Volumes
23
24 - wait for and drop the optimistic patch interior updates which the last
25 time step has spawned
26 (exahype2.api.fv.actionsets.DiscardPatchInterior), as they belong to
27 the old mesh, and
28 - use their own projection onto the faces.
29
30 """
31
33
35 task_number = getattr(self._solver, "_optimistic_cell_update_task_number", None)
36 if task_number is not None:
37 adapt_task.use_cell(
38 task_number, peano4.api.taskgraph.Task.DataAccess.READ_AND_WRITE
39 )
40 adapt_task.add_action_set(
42 self._solver,
43 guard=self._solver.grid_selector.createCellGuard(),
44 task_number=task_number,
45 )
46 )
47
48 def _add_projection_action_sets(self, project_on_faces_task, exahype2_project):
49 includes = (
50 self._solver._get_default_includes() + self._solver.user_solver_includes
51 )
52 project_on_faces_task.add_action_set(
54 self._solver._patch,
55 self._solver._patch_overlap_update,
56 guard=self._solver.grid_selector.createCellGuard(),
57 includes=includes,
58 )
59 )
60
62 if hasattr(
63 self._solver.numerical_scheme, "create_restriction_of_hanging_faces"
64 ):
65 project_on_faces_task.add_action_set(
66 self._solver.numerical_scheme.create_restriction_of_hanging_faces()
67 )
68 project_on_faces_task.add_action_set(
69 RollOverUpdatedFaceWithSommerfeldBoundaryConditions.create_roll_over(
70 self._solver,
71 exahype2_project,
72 guard=self._solver.grid_selector.createFaceGuard(),
73 includes=includes,
74 time_step_size="0.0",
75 )
76 )
_add_projection_action_sets(self, project_on_faces_task, exahype2_project)
Add the scheme-specific action sets which project the patches onto the faces and roll the face data o...
_add_further_adaptation_action_sets(self, adapt_task)
Add scheme-specific action sets to the task which adapts the mesh.
_solver
Only numerical schemes which support adaptive meshes offer the restriction of the hanging faces.
Project a Finite Volume patch's data onto the overlap held on its surrounding faces,...