Peano
Loading...
Searching...
No Matches
GridSelector.py
Go to the documentation of this file.
1# This file is part of the Peano project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
3import abc
4
5
6class GridSelector(abc.ABC):
7 """!
8
9 Select a subset of the mesh entities
10
11 This is a sole helper class: It does not generate any C++ code itself
12 and is not an action set. It merely hands out guards, i.e. C++
13 snippets which other Python classes, such as action sets, can embed
14 into their generated code to decide whether they should act on a
15 particular vertex, face or cell.
16
17 Each routine returns a string which has to be a C++ boolean expression.
18 The expression is evaluated in a context where the corresponding marker
19 is available as marker, i.e. it can query the
20 peano4::datamanagement::VertexMarker, peano4::datamanagement::FaceMarker
21 or peano4::datamanagement::CellMarker, respectively.
22
23 @see FineGridSelector
24
25 """
26
27 @abc.abstractmethod
28 def createVertexGuard(self) -> str:
29 """!
30
31 C++ boolean expression over a peano4::datamanagement::VertexMarker
32 called marker
33
34 """
35
36 @abc.abstractmethod
37 def createFaceGuard(self) -> str:
38 """!
39
40 C++ boolean expression over a peano4::datamanagement::FaceMarker
41 called marker
42
43 """
44
45 @abc.abstractmethod
46 def createCellGuard(self) -> str:
47 """!
48
49 C++ boolean expression over a peano4::datamanagement::CellMarker
50 called marker
51
52 """
53
54 def createVertexStoreGuard(self) -> str:
55 """!
56
57 C++ boolean expression over a peano4::datamanagement::VertexMarker
58 called marker which decides whether a vertex's data is stored at
59 the end of a mesh sweep
60
61 Peano's stacks require that data stored in one mesh sweep are
62 loaded in the next one. The load is guarded by createVertexGuard().
63 If this guard depends on the refinement state, the store therefore
64 has to anticipate the state of the next sweep. By default, we use
65 createVertexGuard(), which is correct for selectors that do not
66 depend on the refinement state.
67
68 """
69 return self.createVertexGuard()
70
71 def createFaceStoreGuard(self) -> str:
72 """!
73
74 Counterpart of createVertexStoreGuard() for faces
75
76 """
77 return self.createFaceGuard()
78
79 def createCellStoreGuard(self) -> str:
80 """!
81
82 Counterpart of createVertexStoreGuard() for cells
83
84 """
85 return self.createCellGuard()
Select a subset of the mesh entities.
str createCellStoreGuard(self)
Counterpart of createVertexStoreGuard() for cells.
str createFaceStoreGuard(self)
Counterpart of createVertexStoreGuard() for faces.
str createVertexGuard(self)
C++ boolean expression over a peano4::datamanagement::VertexMarker called marker.
str createCellGuard(self)
C++ boolean expression over a peano4::datamanagement::CellMarker called marker.
str createFaceGuard(self)
C++ boolean expression over a peano4::datamanagement::FaceMarker called marker.
str createVertexStoreGuard(self)
C++ boolean expression over a peano4::datamanagement::VertexMarker called marker which decides whethe...