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 ProjectPatchOntoFaces
9from .actionsets import RollOverUpdatedFaceWithSommerfeldBoundaryConditions
10
11
12class AdaptMeshAndBalanceLoad(BlockStructuredAdaptMeshAndBalanceLoad):
13 """!
14
15 Default mesh adaptation of the fourth-order finite differences
16
17 exahype2.api.rkfd4.CentralDifferencesWithRungeKutta uses this mesh
18 adaptation unless the user assigns another one to solver.mesh_adaptation.
19 @see exahype2.api.blockstructured.AdaptMeshAndBalanceLoad for the tasks.
20 The finite differences only plug in their own projection onto the faces,
21 including the restriction of the hanging faces. The interpolation and
22 restriction of the patches treat the grid cells of a patch like Finite
23 Volumes, i.e. the scheme drops to low order wherever the mesh changes.
24
25 """
26
28 """!
29
30 Keep the right-hand side estimates in sync with the mesh
31
32 solver._rhs_estimates lives on the cell stack between the sweeps of
33 the time step. A sweep only creates and destroys the entries of the
34 cell data that it uses. The mesh adaptation creates and destroys
35 cells, so it has to use the estimates, too. Otherwise, the cells it
36 creates have no entry on the stack, and the next time step pops from
37 a stack which is too short.
38
39 @param adapt_task: peano4.api.taskgraph.Task
40 The task which adapts the mesh.
41
42 """
43 adapt_task.use_cell(
44 self._solver._rhs_estimates,
45 peano4.api.taskgraph.Task.DataAccess.READ_AND_WRITE,
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 project_on_faces_task.add_action_set(
61 self._solver.numerical_scheme.create_restriction_of_hanging_faces()
62 )
63 project_on_faces_task.add_action_set(
64 RollOverUpdatedFaceWithSommerfeldBoundaryConditions.create_roll_over(
65 self._solver,
66 exahype2_project,
67 guard=self._solver.grid_selector.createFaceGuard(),
68 includes=includes,
69 time_step_size="0.0",
70 )
71 )
_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.
Project a patch's data onto the overlap held on its surrounding faces, so the halo layers can be reco...