Loading...
Searching...
No Matches
HydroCouple::Spatial::IMeshView Class Referenceabstract

IMeshView is a bulk, structure-of-arrays view of an unstructured mesh or network: flat coordinate spans plus CSR (compressed sparse row) connectivity. More...

#include <hydrocouplespatial.h>

Collaboration diagram for HydroCouple::Spatial::IMeshView:

Public Member Functions

virtual ~IMeshView ()=default
 IMeshView destructor.
 
virtual int64_t nodeCount () const =0
 The number of nodes (vertices) in the mesh.
 
virtual int64_t edgeCount () const =0
 The number of edges in the mesh.
 
virtual int64_t faceCount () const =0
 The number of faces (patches/cells) in the mesh; 0 for a pure network.
 
virtual std::span< const double > nodeX () const =0
 x coordinates of all nodes; the span has nodeCount() elements.
 
virtual std::span< const double > nodeY () const =0
 y coordinates of all nodes; the span has nodeCount() elements.
 
virtual std::span< const double > nodeZ () const =0
 z coordinates of all nodes; the span has nodeCount() elements, or is empty for a 2D mesh.
 
virtual std::span< const int64_t > faceNodeOffsets () const =0
 CSR row offsets into faceNodes(): the nodes of face f are faceNodes()[faceNodeOffsets()[f] ... faceNodeOffsets()[f+1]).
 
virtual std::span< const int64_t > faceNodes () const =0
 Concatenated node indexes of all faces, ordered counter-clockwise per face.
 
virtual std::span< const int64_t > edgeNodes () const =0
 Node index pairs of all edges: edge e connects edgeNodes()[2*e] and edgeNodes()[2*e + 1].
 
Topology every conservative remap needs

Required (never empty on a mesh with faces).

UGRID names in brackets.

virtual std::span< const int64_t > faceEdgeOffsets () const =0
 CSR row offsets into faceEdges(): the edges of face f are faceEdges()[faceEdgeOffsets()[f] ... faceEdgeOffsets()[f+1]).
 
virtual std::span< const int64_t > faceEdges () const =0
 Concatenated edge indexes of all faces [face_edge_connectivity].
 
virtual std::span< const int64_t > edgeFaces () const =0
 The two faces of every edge: edge e separates edgeFaces()[2*e] (left, looking from edgeNodes()[2*e] toward edgeNodes()[2*e+1]) from edgeFaces()[2*e+1] (right); -1 marks the outside of the mesh, so a boundary edge has exactly one -1 [edge_face_connectivity].
 
Metric quantities

Optional: a producer that does not hold them returns empty spans and a consumer computes its own from the coordinates.

A producer that does hold them publishes them so that both sides of a coupling integrate over the same areas and lengths — the discrepancy between two independently computed area sets is exactly the mass a conservative exchange fails to conserve. Same lifetime rule as the coordinate spans.

virtual std::span< const double > faceX () const =0
 x coordinate of every face's representative point (centroid or circumcentre, producer's choice) [face_x]; faceCount() or empty.
 
virtual std::span< const double > faceY () const =0
 y coordinate of every face's representative point [face_y]; faceCount() or empty.
 
virtual std::span< const double > faceAreas () const =0
 Plan area of every face in the reference system's distance units squared; faceCount() or empty.
 
virtual std::span< const double > edgeLengths () const =0
 Length of every edge in the reference system's distance units; edgeCount() or empty.
 
virtual std::span< const double > edgeNormalX () const =0
 x component of every edge's unit normal, pointing from the left face to the right face as edgeFaces() orders them; edgeCount() or empty.
 
virtual std::span< const double > edgeNormalY () const =0
 y component of every edge's unit normal; edgeCount() or empty.
 

Detailed Description

IMeshView is a bulk, structure-of-arrays view of an unstructured mesh or network: flat coordinate spans plus CSR (compressed sparse row) connectivity.

The layout is deliberately congruent with the UGRID conventions so that persistence (face_node_connectivity, node coordinate arrays), message packing, and device staging can all consume the view without transformation. All spans remain valid until the underlying mesh topology or geometry changes. Obtained from INetwork::meshView(), IPolyhedralSurface::meshView(), and their specializations.

Spatial search (which face contains a point, nearest node) is deliberately not part of the view: it is every adapter's inner loop and every adapter has different locality needs, so each builds the index it wants from these arrays once at prepare() time.

Constructor & Destructor Documentation

◆ ~IMeshView()

virtual HydroCouple::Spatial::IMeshView::~IMeshView ( )
virtualdefault

IMeshView destructor.

Member Function Documentation

◆ edgeCount()

virtual int64_t HydroCouple::Spatial::IMeshView::edgeCount ( ) const
nodiscardpure virtual

The number of edges in the mesh.

◆ edgeFaces()

virtual std::span< const int64_t > HydroCouple::Spatial::IMeshView::edgeFaces ( ) const
nodiscardpure virtual

The two faces of every edge: edge e separates edgeFaces()[2*e] (left, looking from edgeNodes()[2*e] toward edgeNodes()[2*e+1]) from edgeFaces()[2*e+1] (right); -1 marks the outside of the mesh, so a boundary edge has exactly one -1 [edge_face_connectivity].

2 * edgeCount() elements; empty for a pure network. This is the accessor a flux exchange uses to know which cell a normal component points out of, and a partitioner uses to find the boundary.

◆ edgeLengths()

virtual std::span< const double > HydroCouple::Spatial::IMeshView::edgeLengths ( ) const
nodiscardpure virtual

Length of every edge in the reference system's distance units; edgeCount() or empty.

◆ edgeNodes()

virtual std::span< const int64_t > HydroCouple::Spatial::IMeshView::edgeNodes ( ) const
nodiscardpure virtual

Node index pairs of all edges: edge e connects edgeNodes()[2*e] and edgeNodes()[2*e + 1].

The span has 2 * edgeCount() elements. The pair's order is the edge's direction for VectorBasis::AlongEntity and for the left/right convention of edgeFaces().

◆ edgeNormalX()

virtual std::span< const double > HydroCouple::Spatial::IMeshView::edgeNormalX ( ) const
nodiscardpure virtual

x component of every edge's unit normal, pointing from the left face to the right face as edgeFaces() orders them; edgeCount() or empty.

◆ edgeNormalY()

virtual std::span< const double > HydroCouple::Spatial::IMeshView::edgeNormalY ( ) const
nodiscardpure virtual

y component of every edge's unit normal; edgeCount() or empty.

◆ faceAreas()

virtual std::span< const double > HydroCouple::Spatial::IMeshView::faceAreas ( ) const
nodiscardpure virtual

Plan area of every face in the reference system's distance units squared; faceCount() or empty.

◆ faceCount()

virtual int64_t HydroCouple::Spatial::IMeshView::faceCount ( ) const
nodiscardpure virtual

The number of faces (patches/cells) in the mesh; 0 for a pure network.

◆ faceEdgeOffsets()

virtual std::span< const int64_t > HydroCouple::Spatial::IMeshView::faceEdgeOffsets ( ) const
nodiscardpure virtual

CSR row offsets into faceEdges(): the edges of face f are faceEdges()[faceEdgeOffsets()[f] ... faceEdgeOffsets()[f+1]).

faceCount() + 1 elements; empty for a pure network. The edges of a face are listed in the same counter-clockwise order as its nodes, edge k joining node k to node k+1 [face_edge_connectivity].

◆ faceEdges()

virtual std::span< const int64_t > HydroCouple::Spatial::IMeshView::faceEdges ( ) const
nodiscardpure virtual

Concatenated edge indexes of all faces [face_edge_connectivity].

◆ faceNodeOffsets()

virtual std::span< const int64_t > HydroCouple::Spatial::IMeshView::faceNodeOffsets ( ) const
nodiscardpure virtual

CSR row offsets into faceNodes(): the nodes of face f are faceNodes()[faceNodeOffsets()[f] ... faceNodeOffsets()[f+1]).

The span has faceCount() + 1 elements; it is empty for a pure network.

◆ faceNodes()

virtual std::span< const int64_t > HydroCouple::Spatial::IMeshView::faceNodes ( ) const
nodiscardpure virtual

Concatenated node indexes of all faces, ordered counter-clockwise per face.

◆ faceX()

virtual std::span< const double > HydroCouple::Spatial::IMeshView::faceX ( ) const
nodiscardpure virtual

x coordinate of every face's representative point (centroid or circumcentre, producer's choice) [face_x]; faceCount() or empty.

◆ faceY()

virtual std::span< const double > HydroCouple::Spatial::IMeshView::faceY ( ) const
nodiscardpure virtual

y coordinate of every face's representative point [face_y]; faceCount() or empty.

◆ nodeCount()

virtual int64_t HydroCouple::Spatial::IMeshView::nodeCount ( ) const
nodiscardpure virtual

The number of nodes (vertices) in the mesh.

◆ nodeX()

virtual std::span< const double > HydroCouple::Spatial::IMeshView::nodeX ( ) const
nodiscardpure virtual

x coordinates of all nodes; the span has nodeCount() elements.

◆ nodeY()

virtual std::span< const double > HydroCouple::Spatial::IMeshView::nodeY ( ) const
nodiscardpure virtual

y coordinates of all nodes; the span has nodeCount() elements.

◆ nodeZ()

virtual std::span< const double > HydroCouple::Spatial::IMeshView::nodeZ ( ) const
nodiscardpure virtual

z coordinates of all nodes; the span has nodeCount() elements, or is empty for a 2D mesh.


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