mesh.Mesh.front_walk#
- Mesh.front_walk(level=0, startat=0, frontinc=1, partinc=1, maxval=-1)#
Visit all elements using a frontal walk.
In a frontal walk a forward step is executed simultanuously from all the elements in the current front. The elements thus reached become the new front. An element can be reached from the current element if both are connected by a lower entity of the specified level. Default level is ‘point’.
Parameters#
- level: int
Hierarchy of the geometric items connecting two elements: 0 = node, 1 = edge, 2 = face. Only values of a lower hierarchy than the elements of the Mesh itself make sense. There are no connections on the upper level.
- startat: int or list of ints
Initial element number(s) in the front.
- frontinc: int
Increment for the front number on each frontal step.
- partinc: int
Increment for the front number when the front gets empty and a new part is started.
- maxval: int
Maximum frontal value. If negative (default) the walk will continue until all elements have been reached. If non-negative, walking will stop as soon as the frontal value reaches this maximum.
Returns#
- int array
An array of ints specifying for each element in which step the element was reached by the walker. Unwalked elements have a value -1.
See Also#
adjacency.Adjacency.front_walk()Examples#
>>> M = Mesh(eltype='quad4').subdivide(5,2) >>> print(M.front_walk()) [0 1 2 3 4 1 1 2 3 4] >>> print(M.front_walk(maxval=2)) [ 0 1 2 -1 -1 1 1 2 -1 -1]