entities

class dolfin.cpp.mesh.entities(*args)

Bases: object

MeshEntityIterator provides a common iterator for mesh entities over meshes, boundaries and incidence relations. The basic use is illustrated below.

Example

The following example shows how to iterate over all mesh entities of a mesh of topological dimension dim:

>>> for e in dolfin.cpp.entities(mesh, 1):
...     print e.index()

The following example shows how to iterate over mesh entities of topological dimension dim connected (incident) to some mesh entity f:

>>> f = dolfin.cpp.MeshEntity(mesh, 0, 0)
>>> for e in dolfin.cpp.entities(f, 1):
...     print e.index()

In addition to the general iterator, a set of specific named iterators are provided for entities of type Vertex, Edge, Face, Facet and Cell. These iterators are defined along with their respective classes.

Overloaded versions

  • MeshEntityIterator()

    Default constructor

  • MeshEntityIterator(mesh, dim)

    Create iterator for mesh entities over given topological dimension

  • MeshEntityIterator(entity, dim)

    Create iterator for entities of given dimension connected to given entity

  • MeshEntityIterator(it)

    Copy constructor

end()

Check if iterator has reached the end

end_iterator()

Provide a safeguard iterator pointing beyond the end of an iteration process, either iterating over the mesh /or incident entities. Added to be bit more like STL iterators, since many algorithms rely on a kind of beyond iterator.

next()
pos()

Return current position

thisown

The membership flag