Peano
Loading...
Searching...
No Matches
peano4::datamanagement Namespace Reference

Namespaces

namespace  tests
 

Data Structures

struct  CellMarker
 Cell marker. More...
 
class  FaceEnumerator
 Enumerator over an array of faces. More...
 
class  FaceHeapDataEnumerator
 Enumerator over copies of the faces of a cell. More...
 
struct  FaceMarker
 Provide information about selected face. More...
 
struct  VertexEnumerator
 Vertex enumerator within array. More...
 
class  VertexHeapDataEnumerator
 Enumerator over copies of the vertices of a cell. More...
 
struct  VertexMarker
 Vertex marker to provide information about selected vertex. More...
 

Functions

template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void loadCellData (StackMap &stackMap, int spacetreeId, const peano4::grid::GridTraversalEvent &event, const CellMarker &cellMarker, const char *name, LoadStoreComputeFlag loadStoreComputeFlag)
 Load the data of one cell onto the call stack.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void storeCellData (StackMap &stackMap, int spacetreeId, const peano4::grid::GridTraversalEvent &event, const CellMarker &cellMarker, const char *name, LoadStoreComputeFlag loadStoreComputeFlag)
 Store the data of one cell from the call stack.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename Send >
void sendCellData (StackMap &stackMap, int spacetreeId, int toStack, peano4::grid::TraversalObserver::SendReceiveContext context, const CellMarker &cellMarker, LoadStoreComputeFlag loadStoreComputeFlag, Send send)
 Send the data of the cell.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename ReceiveAndMerge >
void receiveAndMergeCellData (StackMap &stackMap, int spacetreeId, int fromStack, peano4::grid::TraversalObserver::SendReceiveContext context, const peano4::grid::GridTraversalEvent &event, const CellMarker &cellMarker, LoadStoreComputeFlag loadStoreComputeFlag, ReceiveAndMerge receiveAndMerge)
 Receive the data of the cell and merge it into the local data.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void loadFaceData (StackMap &stackMap, int spacetreeId, const peano4::grid::GridTraversalEvent &event, const FaceMarker &faceMarker, const char *name, LoadStoreComputeFlag loadStoreComputeFlag)
 Load the face data of one cell onto the call stack.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void storeFaceData (StackMap &stackMap, int spacetreeId, const peano4::grid::GridTraversalEvent &event, const FaceMarker &faceMarker, const char *name, LoadStoreComputeFlag loadStoreComputeFlag)
 Store the face data of one cell from the call stack.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename Send >
void sendFaceData (StackMap &stackMap, int spacetreeId, int position, int toStack, peano4::grid::TraversalObserver::SendReceiveContext context, const FaceMarker &faceMarker, LoadStoreComputeFlag loadStoreComputeFlag, Send send)
 Send the data of one face.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename ReceiveAndMerge >
void receiveAndMergeFaceData (StackMap &stackMap, int spacetreeId, int position, int fromStack, peano4::grid::TraversalObserver::SendReceiveContext context, const peano4::grid::GridTraversalEvent &event, const FaceMarker &faceMarker, LoadStoreComputeFlag loadStoreComputeFlag, ReceiveAndMerge receiveAndMerge)
 Receive the data of one face and merge it into the local data.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void loadVertexData (StackMap &stackMap, int spacetreeId, const peano4::grid::GridTraversalEvent &event, const VertexMarker &vertexMarker, const char *name, LoadStoreComputeFlag loadStoreComputeFlag)
 Load the vertex data of one cell onto the call stack.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void storeVertexData (StackMap &stackMap, int spacetreeId, const peano4::grid::GridTraversalEvent &event, const VertexMarker &vertexMarker, const char *name, LoadStoreComputeFlag loadStoreComputeFlag)
 Store the vertex data of one cell from the call stack.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename Send >
void sendVertexData (StackMap &stackMap, int spacetreeId, int position, int toStack, peano4::grid::TraversalObserver::SendReceiveContext context, const VertexMarker &vertexMarker, LoadStoreComputeFlag loadStoreComputeFlag, Send send)
 Send the data of one vertex.
 
template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename ReceiveAndMerge >
void receiveAndMergeVertexData (StackMap &stackMap, int spacetreeId, int position, int fromStack, peano4::grid::TraversalObserver::SendReceiveContext context, const peano4::grid::GridTraversalEvent &event, const VertexMarker &vertexMarker, LoadStoreComputeFlag loadStoreComputeFlag, ReceiveAndMerge receiveAndMerge)
 Receive the data of one vertex and merge it into the local data.
 
tarch::la::Vector< Dimensions, double > reconstructXOfParentVertex (const VertexMarker &marker, const std::bitset< Dimensions > &parentVertexPositionWithinParentCell)
 Reconstruct parent vertex position.
 

Function Documentation

◆ loadCellData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void peano4::datamanagement::loadCellData ( StackMap &  stackMap,
int  spacetreeId,
const peano4::grid::GridTraversalEvent &  event,
const CellMarker &  cellMarker,
const char *  name,
LoadStoreComputeFlag  loadStoreComputeFlag 
)

Load the data of one cell onto the call stack.

Cell counterpart of loadVertexData() and loadFaceData(): Called by the generated observers in loadCell(), once per cell data type. The routine pushes one entry onto the call stack:

  • If the cell's data resides on the stack the event names (event.getCellData()) and is to be loaded persistently, the routine pops it from there.
  • If the cell is new or the data is computed on, the routine creates new data.
  • Otherwise, the data on the call stack is not initialised. Only the debug information is set.

The routine used to be generated by peano4.api.output.Observer for every data type. Its logic does not depend on the type though, so the generated code now calls this function template.

Template Parameters
DataCell data type, i.e. the generated DaStGen or patch class.
StackMapStack map holding the stacks of Data, e.g. peano4::maps::HierarchicalStackMap.
LoadStoreComputeFlagFunctor mapping a CellMarker onto a peano4::grid::LoadStoreComputeFlag. Typically a lambda forwarding to Data::loadStoreComputeFlag() with the data type's additional load and store arguments.
Parameters
stackMapThe stacks of Data.
spacetreeIdTree on which the observer runs.
eventThe traversal event of loadCell().
cellMarkerMarker of the cell.
nameName of the data. Used for log messages only.
loadStoreComputeFlagSee LoadStoreComputeFlag.

Remote data

If the traversal event tells us that the cell's source stack is peano4::grid::TraversalObserver::NoData, the cell is not adjacent to any local cell. The automaton hands out NoData for exactly these entities. No user code ever sees them, as the observer masks all events with isLocal(). We therefore do not construct a dummy data object for them even if the flag asks for computeOnData(): that would allocate and initialise (potentially large) data for nothing. The slot on the call stack stays in its NoData state, just as for entities whose flag is NoData.

◆ loadFaceData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void peano4::datamanagement::loadFaceData ( StackMap &  stackMap,
int  spacetreeId,
const peano4::grid::GridTraversalEvent &  event,
const FaceMarker &  faceMarker,
const char *  name,
LoadStoreComputeFlag  loadStoreComputeFlag 
)

Load the face data of one cell onto the call stack.

Face counterpart of loadVertexData(): Called by the generated observers in loadCell(), once per face data type, it handles the \( 2d \) faces of the cell. For each face, the routine takes the data from the stack the event names (event.getFaceDataFrom()) and places it at the position within the call stack block the event names (event.getFaceDataTo()):

  • If the face resides on an input stack and the data is to be loaded persistently, or if it resides on a temporary stack, the routine pops it from there.
  • If the face is new (created or hanging) or the data is computed on, the routine creates new data.
  • Otherwise, the data on the call stack is not initialised. Only the debug information is set.

The routine used to be generated by peano4.api.output.Observer for every data type. Its logic does not depend on the type though, so the generated code now calls this function template.

Template Parameters
DataFace data type, i.e. the generated DaStGen or patch class.
StackMapStack map holding the stacks of Data, e.g. peano4::maps::HierarchicalStackMap.
LoadStoreComputeFlagFunctor mapping a FaceMarker onto a peano4::grid::LoadStoreComputeFlag. Typically a lambda forwarding to Data::loadStoreComputeFlag() with the data type's additional load and store arguments.
Parameters
stackMapThe stacks of Data.
spacetreeIdTree on which the observer runs.
eventThe traversal event of loadCell().
faceMarkerMarker of the cell's faces.
nameName of the data. Used for log messages only.
loadStoreComputeFlagSee LoadStoreComputeFlag.

Remote data

If the traversal event tells us that the face's source stack is peano4::grid::TraversalObserver::NoData, the face is not adjacent to any local cell. The automaton hands out NoData for exactly these entities. No user code ever sees them, as the observer masks all events with isLocal(). We therefore do not construct a dummy data object for them even if the flag asks for computeOnData(): that would allocate and initialise (potentially large) data for nothing. The slot on the call stack stays in its NoData state, just as for entities whose flag is NoData.

◆ loadVertexData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void peano4::datamanagement::loadVertexData ( StackMap &  stackMap,
int  spacetreeId,
const peano4::grid::GridTraversalEvent &  event,
const VertexMarker &  vertexMarker,
const char *  name,
LoadStoreComputeFlag  loadStoreComputeFlag 
)

Load the vertex data of one cell onto the call stack.

Called by the generated observers in loadCell(), once per vertex data type. For each of the \( 2^d \) vertices of the cell, the routine takes the data from the stack the event names (event.getVertexDataFrom()) and places it at the position within the call stack block the event names (event.getVertexDataTo()):

  • If the vertex resides on an input stack and the data is to be loaded persistently, or if it resides on a temporary stack, the routine pops it from there.
  • If the vertex is new (created or hanging) or the data is computed on, the routine creates new data.
  • Otherwise, the data on the call stack is not initialised. Only the debug information is set.

The routine used to be generated by peano4.api.output.Observer for every data type. Its logic does not depend on the type though, so the generated code now calls this function template.

Template Parameters
DataVertex data type, i.e. the generated DaStGen or patch class.
StackMapStack map holding the stacks of Data, e.g. peano4::maps::HierarchicalStackMap.
LoadStoreComputeFlagFunctor mapping a VertexMarker onto a peano4::grid::LoadStoreComputeFlag. Typically a lambda forwarding to Data::loadStoreComputeFlag() with the data type's additional load and store arguments.
Parameters
stackMapThe stacks of Data.
spacetreeIdTree on which the observer runs.
eventThe traversal event of loadCell().
vertexMarkerMarker of the cell's vertices.
nameName of the data. Used for log messages only.
loadStoreComputeFlagSee LoadStoreComputeFlag.

Remote data

If the traversal event tells us that the vertex's source stack is peano4::grid::TraversalObserver::NoData, the vertex is not adjacent to any local cell. The automaton hands out NoData for exactly these entities. No user code ever sees them, as the observer masks all events with isLocal(). We therefore do not construct a dummy data object for them even if the flag asks for computeOnData(): that would allocate and initialise (potentially large) data for nothing. The slot on the call stack stays in its NoData state, just as for entities whose flag is NoData.

◆ receiveAndMergeCellData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename ReceiveAndMerge >
void peano4::datamanagement::receiveAndMergeCellData ( StackMap &  stackMap,
int  spacetreeId,
int  fromStack,
peano4::grid::TraversalObserver::SendReceiveContext  context,
const peano4::grid::GridTraversalEvent &  event,
const CellMarker &  cellMarker,
LoadStoreComputeFlag  loadStoreComputeFlag,
ReceiveAndMerge  receiveAndMerge 
)

Receive the data of the cell and merge it into the local data.

Called by the generated observers in receiveAndMergeCell(). If the cell's data on top of the call stack is loaded persistently and wants to receive data, the routine pops the incoming data from stack fromStack and merges it into the local data via Data::merge().

Template Parameters
ReceiveAndMergeFunctor mapping the data and a CellMarker onto a bool: Does this data want to receive data? Typically a lambda forwarding to Data::receiveAndMerge().
See also
loadCellData() for the other template arguments and parameters.

◆ receiveAndMergeFaceData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename ReceiveAndMerge >
void peano4::datamanagement::receiveAndMergeFaceData ( StackMap &  stackMap,
int  spacetreeId,
int  position,
int  fromStack,
peano4::grid::TraversalObserver::SendReceiveContext  context,
const peano4::grid::GridTraversalEvent &  event,
const FaceMarker &  faceMarker,
LoadStoreComputeFlag  loadStoreComputeFlag,
ReceiveAndMerge  receiveAndMerge 
)

Receive the data of one face and merge it into the local data.

Called by the generated observers in receiveAndMergeFace(). If the data of the face at position within the call stack block is loaded persistently and wants to receive data, the routine pops the incoming data from stack fromStack and merges it into the local data via Data::merge().

Template Parameters
ReceiveAndMergeFunctor mapping the data and a FaceMarker onto a bool: Does this data want to receive data? Typically a lambda forwarding to Data::receiveAndMerge().
See also
loadFaceData() for the other template arguments and parameters.

◆ receiveAndMergeVertexData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename ReceiveAndMerge >
void peano4::datamanagement::receiveAndMergeVertexData ( StackMap &  stackMap,
int  spacetreeId,
int  position,
int  fromStack,
peano4::grid::TraversalObserver::SendReceiveContext  context,
const peano4::grid::GridTraversalEvent &  event,
const VertexMarker &  vertexMarker,
LoadStoreComputeFlag  loadStoreComputeFlag,
ReceiveAndMerge  receiveAndMerge 
)

Receive the data of one vertex and merge it into the local data.

Called by the generated observers in receiveAndMergeVertex(). If the data of the vertex at position within the call stack block is loaded persistently and wants to receive data, the routine pops the incoming data from stack fromStack and merges it into the local data via Data::merge().

Template Parameters
ReceiveAndMergeFunctor mapping the data and a VertexMarker onto a bool: Does this data want to receive data? Typically a lambda forwarding to Data::receiveAndMerge().
See also
loadVertexData() for the other template arguments and parameters.

◆ reconstructXOfParentVertex()

tarch::la::Vector< Dimensions, double > peano4::datamanagement::reconstructXOfParentVertex ( const VertexMarker &  marker,
const std::bitset< Dimensions > &  parentVertexPositionWithinParentCell 
)

Reconstruct parent vertex position.

Whenever we run into a vertex event, this event is triggered from a cell's point of view. You can find out from the VertexMarker where within this cell the vertex is for which you got a vertex event. Likewisely, you can also reconstruct the spatial arrangement of this cell's parent cell. It is not a core vertex marker routine, which is frequently used, so we outsource it into a separate function of its own. At the moment, we are only aware of some debugging, tracing facilities which need this function.

Parameters
parentVertexPositionWithinParentCellfollows Peano's dimension-generic lexicographic enumeration. You can also pass in an integer, which will automatically be packed into a bitset then.

◆ sendCellData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename Send >
void peano4::datamanagement::sendCellData ( StackMap &  stackMap,
int  spacetreeId,
int  toStack,
peano4::grid::TraversalObserver::SendReceiveContext  context,
const CellMarker &  cellMarker,
LoadStoreComputeFlag  loadStoreComputeFlag,
Send  send 
)

Send the data of the cell.

Called by the generated observers in sendCell(). The routine copies the cell's data on top of the call stack onto stack toStack if the data is stored persistently and if the data wants to be sent or the domain is forked or joined.

Template Parameters
SendFunctor mapping the data and a CellMarker onto a bool: Does this data want to be sent? Typically a lambda forwarding to Data::send().
See also
loadCellData() for the other template arguments and parameters.

◆ sendFaceData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename Send >
void peano4::datamanagement::sendFaceData ( StackMap &  stackMap,
int  spacetreeId,
int  position,
int  toStack,
peano4::grid::TraversalObserver::SendReceiveContext  context,
const FaceMarker &  faceMarker,
LoadStoreComputeFlag  loadStoreComputeFlag,
Send  send 
)

Send the data of one face.

Called by the generated observers in sendFace(). The routine copies the data of the face at position within the call stack block onto stack toStack if the data is stored persistently and if the data wants to be sent or the domain is forked or joined.

Template Parameters
SendFunctor mapping the data and a FaceMarker onto a bool: Does this data want to be sent? Typically a lambda forwarding to Data::send().
See also
loadFaceData() for the other template arguments and parameters.

◆ sendVertexData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag , typename Send >
void peano4::datamanagement::sendVertexData ( StackMap &  stackMap,
int  spacetreeId,
int  position,
int  toStack,
peano4::grid::TraversalObserver::SendReceiveContext  context,
const VertexMarker &  vertexMarker,
LoadStoreComputeFlag  loadStoreComputeFlag,
Send  send 
)

Send the data of one vertex.

Called by the generated observers in sendVertex(). The routine copies the data of the vertex at position within the call stack block onto stack toStack if the data is stored persistently and if the data wants to be sent or the domain is forked or joined.

Template Parameters
SendFunctor mapping the data and a VertexMarker onto a bool: Does this data want to be sent? Typically a lambda forwarding to Data::send().
See also
loadVertexData() for the other template arguments and parameters.

◆ storeCellData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void peano4::datamanagement::storeCellData ( StackMap &  stackMap,
int  spacetreeId,
const peano4::grid::GridTraversalEvent &  event,
const CellMarker &  cellMarker,
const char *  name,
LoadStoreComputeFlag  loadStoreComputeFlag 
)

Store the data of one cell from the call stack.

Counterpart of loadCellData(), called by the generated observers in storeCell(). The routine pops the cell's entry from the call stack and pushes it onto the stack the event names (event.getCellData()) if this stack is a temporary stack, or if it is an output stack and the data is to be stored persistently. Otherwise, the data is dropped.

See also
loadCellData() for the template arguments and parameters.

◆ storeFaceData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void peano4::datamanagement::storeFaceData ( StackMap &  stackMap,
int  spacetreeId,
const peano4::grid::GridTraversalEvent &  event,
const FaceMarker &  faceMarker,
const char *  name,
LoadStoreComputeFlag  loadStoreComputeFlag 
)

Store the face data of one cell from the call stack.

Counterpart of loadFaceData(), called by the generated observers in storeCell(). For each of the \( 2d \) faces of the cell, the routine takes the data from the call stack block and pushes it onto the stack the event names (event.getFaceDataTo()) if this stack is a temporary stack, or if it is an output stack and the data is to be stored persistently. Otherwise, the data is dropped.

See also
loadFaceData() for the template arguments and parameters.

◆ storeVertexData()

template<typename Data , typename StackMap , typename LoadStoreComputeFlag >
void peano4::datamanagement::storeVertexData ( StackMap &  stackMap,
int  spacetreeId,
const peano4::grid::GridTraversalEvent &  event,
const VertexMarker &  vertexMarker,
const char *  name,
LoadStoreComputeFlag  loadStoreComputeFlag 
)

Store the vertex data of one cell from the call stack.

Counterpart of loadVertexData(), called by the generated observers in storeCell(). For each of the \( 2^d \) vertices of the cell, the routine takes the data from the call stack block and pushes it onto the stack the event names (event.getVertexDataTo()) if this stack is a temporary stack, or if it is an output stack and the data is to be stored persistently. Otherwise, the data is dropped.

See also
loadVertexData() for the template arguments and parameters.