Loading...
Searching...
No Matches
dolfin::MeshEntityIterator Class Reference

`#include <MeshEntityIterator.h>`

## Public Member Functions

| MeshEntityIterator ()
| Default constructor.
| MeshEntityIterator (const Mesh &mesh, std::size_t dim)
| Create iterator for mesh entities over given topological dimension.
| MeshEntityIterator (const Mesh &mesh, std::size_t dim, std::string opt)
| MeshEntityIterator (const MeshEntity &entity, std::size_t dim)
| MeshEntityIterator (const MeshEntityIterator &it)
| Copy constructor.
virtual | ~MeshEntityIterator ()
| Destructor.
MeshEntityIterator & | operator++ ()
| Step to next mesh entity (prefix increment).
MeshEntityIterator & | operator-- ()
| Step to the previous mesh entity (prefix decrease).
std::size_t | pos () const
| Return current position.
bool | operator== (const MeshEntityIterator &it) const
| Comparison operator.
bool | operator!= (const MeshEntityIterator &it) const
| Comparison operator.
MeshEntity & | operator* ()
| Dereference operator.
MeshEntity * | operator-> ()
| Member access operator.
bool | end () const
| Check if iterator has reached the end.
MeshEntityIterator | end_iterator ()

## Detailed Description

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

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

for (MeshEntityIterator e(mesh, dim); !e.end(); ++e)
{
e->foo();
}
dolfin::MeshEntityIterator::MeshEntityIterator
MeshEntityIterator()
Default constructor.
Definition MeshEntityIterator.h:69

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

for (MeshEntityIterator e(f, dim); !e.end(); ++e)
{
e->foo();
}

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.

## Constructor & Destructor Documentation

## MeshEntityIterator() [1/2]

dolfin::MeshEntityIterator::MeshEntityIterator | ( | const Mesh & | mesh,
|  | std::size_t | dim,
|  | std::string | opt )

inline

Iterator over MeshEntity of dimension dim on mesh, with string option to iterate over "regular", "ghost" or "all" entities

## MeshEntityIterator() [2/2]

dolfin::MeshEntityIterator::MeshEntityIterator | ( | const MeshEntity & | entity,
|  | std::size_t | dim )

inline

Create iterator for entities of given dimension connected to given entity

## Member Function Documentation

## end_iterator()

MeshEntityIterator dolfin::MeshEntityIterator::end_iterator | ( |  | ) |

inline

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.

The documentation for this class was generated from the following file:

- /build/dolfin-lFBzDh/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/mesh/MeshEntityIterator.h