|
Peano
|
Enumerator over copies of the faces of a cell. More...
#include <FaceHeapDataEnumerator.h>

Public Member Functions | |
| FaceHeapDataEnumerator (const FaceEnumerator< Face > &faces) | |
| Copy the 2d faces the enumerator points to. | |
| Face & | operator() (int i) |
| Access the copy of face i. | |
| const Face & | operator() (int i) const |
Private Attributes | |
| std::vector< Face > | _faces |
Enumerator over copies of the faces of a cell.
A peano4::datamanagement::FaceEnumerator holds pointers to the faces adjacent to a cell. These faces reside on Peano's stacks, i.e. the pointers are only valid while the traversal handles the cell. Code that runs later, e.g. a task spawned from within touchCellFirstTime(), must not use a FaceEnumerator.
The present enumerator takes a FaceEnumerator and copies the faces it points to. It owns these copies and offers the same access operator as the FaceEnumerator, so code written against a FaceEnumerator can work with this enumerator instead. A task can for example capture
which shadows the FaceEnumerator fineGridFacesQ within the task.
The enumerator only refers to the actual face data if copying a face is shallow, i.e. if the face's data resides on the heap and the copies share it. This holds for data managed via smart pointers, e.g. data generated by peano4.api.datamodel.PatchToDoubleArrayWithSmartPointer. In this case, the copies are cheap, and writes through the enumerator alter the faces' data.
If the face holds its data as plain array or deep-copies its heap data (e.g. peano4.api.datamodel.PatchToDoubleArray or peano4.api.datamodel.PatchToDoubleArrayOnHeap), the enumerator works on deep copies of the data. Reads then yield the data at construction time of the enumerator, and writes are lost.
The vertex counterpart is peano4::datamanagement::VertexHeapDataEnumerator.
Definition at line 61 of file FaceHeapDataEnumerator.h.
| peano4::datamanagement::FaceHeapDataEnumerator< Face >::FaceHeapDataEnumerator | ( | const FaceEnumerator< Face > & | faces | ) |
Copy the 2d faces the enumerator points to.
| Face & peano4::datamanagement::FaceHeapDataEnumerator< Face >::operator() | ( | int | i | ) |
Access the copy of face i.
Faces are enumerated as in peano4::datamanagement::FaceEnumerator.
| const Face & peano4::datamanagement::FaceHeapDataEnumerator< Face >::operator() | ( | int | i | ) | const |
|
private |
Definition at line 63 of file FaceHeapDataEnumerator.h.