Peano
Loading...
Searching...
No Matches
peano4::datamanagement::VertexEnumerator< Vertex > Struct Template Reference

Vertex enumerator within array. More...

#include <VertexEnumerator.h>

Public Member Functions

 VertexEnumerator ()
 
 VertexEnumerator (Vertex *firstVertex)
 Constructs vertex enumerator with default layout for consecutively stored vertices.
 
void setPointer (int i, Vertex *value)
 Usually is only used by the observers, i.e.
 
Vertex & operator() (int i) const
 Access the ith vertex.
 

Private Attributes

Vertex * _vertices [TwoPowerD]
 

Detailed Description

template<class Vertex>
struct peano4::datamanagement::VertexEnumerator< Vertex >

Vertex enumerator within array.

When Peano invokes an event (function) for a cell, it internally operates over an array of the \( 2^d \) vertices that are adjacent to this cell. That is, every cell has access to its adjacent vertices. However, we never provide direct access to an array of these vertices, since you could neither assume that this array has exactly \( 2^d \) entries, not should any code every make an assumption about the physical ordering of these vertices in memory. The data might be scattered, and it might be permuted. Peano internally decides how to order the data.

Yet, Peano logically orders the vertices. They are enumerated from \( [0,2^d-1] \) lexicographically with the bottom left (2d) bottom left front vertex being vertex number 0.

Every cell event now is given an instance of VertexEnumerator, and you can use the functor of this object to get the vertex with a logical number. That is

vertexEnumerator(0).foo();

will invoke foo() on vertex 0. The enumerator encapsulates how the vertices are ordered in memory. User codes do not see this explicitly,

Internally, the vertex enumerator is only a collection of \( 2^d \) pointers to vertices. The grid traversal automaton builds up this enumerator, i.e. it sets these pointers via setPointer(). When user codes use the functor, they are given back the respective object to which the ith pointer points to.

See also
peano4::datamanagement::FaceEnumerator for the same discussion for vertices.

Definition at line 57 of file VertexEnumerator.h.

Constructor & Destructor Documentation

◆ VertexEnumerator() [1/2]

template<class Vertex >
peano4::datamanagement::VertexEnumerator< Vertex >::VertexEnumerator ( )

◆ VertexEnumerator() [2/2]

template<class Vertex >
peano4::datamanagement::VertexEnumerator< Vertex >::VertexEnumerator ( Vertex * firstVertex)

Constructs vertex enumerator with default layout for consecutively stored vertices.

Definition at line 73 of file VertexEnumerator.h.

References peano4::datamanagement::VertexEnumerator< Vertex >::_vertices, assertion, and TwoPowerD.

Member Function Documentation

◆ operator()()

template<class Vertex >
Vertex & peano4::datamanagement::VertexEnumerator< Vertex >::operator() ( int i) const

Access the ith vertex.

Consult the class enumeration for detailed information. The vertices within a cell are enumerated lexicographically as illustrated below.

Definition at line 101 of file VertexEnumerator.h.

References peano4::datamanagement::VertexEnumerator< Vertex >::_vertices, assertion1, and TwoPowerD.

◆ setPointer()

template<class Vertex >
void peano4::datamanagement::VertexEnumerator< Vertex >::setPointer ( int i,
Vertex * value )

Usually is only used by the observers, i.e.

users should not interact with this routine.

Definition at line 85 of file VertexEnumerator.h.

References peano4::datamanagement::VertexEnumerator< Vertex >::_vertices, assertion, and TwoPowerD.

Field Documentation

◆ _vertices


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