Peano
Loading...
Searching...
No Matches
ProjectPatchOntoFaces.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
4import jinja2
5
6
8
9
11 """! Project patch data onto faces so we can reconstruct the halo layers later on
12
13 This class is very similar to peano4.toolbox.blockstructured.ProjectPatchOntoFaces,
14 but there are some delicate differences.
15
16 The big difference is that the projection also sets the isUpdated() flag and
17 the UpdatedTimeStamp(). As the projection writes to these two updated
18 records, it is important that you roll it over afterwards. This is done via
19 the mapping RollOverUpdatedFace.
20
21 It is important to study this action set in combination with DynamicAMR. In
22 the documentation of the latter I explain why we need the guard
23
24 not marker.hasBeenRefined()
25
26 if we want to support dynamic coarsening. See exahype2.solvers.fv.FV.add_actions_to_init_grid()
27 for details on the ordering of the action sets.
28
29 """
30 def __init__(self,solver, guard):
31 peano4.toolbox.blockstructured.ProjectPatchOntoFaces.__init__(
32 self,
33 solver._patch,
34 solver._patch_overlap_update,
35 "not marker.hasBeenRefined() and " + guard,
36 solver._get_default_includes() + solver.user_action_set_includes, True)
37
38 self.d[ "FACE_METADATA_ACCESSOR" ] = "fineGridFaces" + solver._face_label.name
39 self.d[ "CELL_METADATA_ACCESSOR" ] = "fineGridCell""" + solver._cell_label.name
40
42 for (int d=0; d<Dimensions; d++) {{
43 {FACE_METADATA_ACCESSOR}(d).setUpdated(1,true);
44 {FACE_METADATA_ACCESSOR}(d).setUpdatedTimeStamp(1,{CELL_METADATA_ACCESSOR}.getTimeStamp());
45 {FACE_METADATA_ACCESSOR}(d+Dimensions).setUpdated(0,true);
46 {FACE_METADATA_ACCESSOR}(d+Dimensions).setUpdatedTimeStamp(0,{CELL_METADATA_ACCESSOR}.getTimeStamp());
47 logDebug( "touchCellLastTime(...)", "update {FACE_METADATA_ACCESSOR}(" << d << ")(1)" );
48 logDebug( "touchCellLastTime(...)", "update {FACE_METADATA_ACCESSOR}(" << (d+Dimensions) << ")(0)" );
49 }}
50"""
51
52
54 return __name__.replace(".py", "").replace(".", "_")
55
Project patch data onto faces so we can reconstruct the halo layers later on.
This class assumes that you have NxNxN patch within your block.