Skip to content

Commit

Permalink
Update geometry find element functions to use static casting instead …
Browse files Browse the repository at this point in the history
…of dynamic
  • Loading branch information
jmarquisbq committed Jun 21, 2024
1 parent baf9702 commit 582cbbd
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 35 deletions.
8 changes: 4 additions & 4 deletions src/simplnx/DataStructure/Geometry/EdgeGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ std::shared_ptr<DataObject> EdgeGeom::deepCopy(const DataPath& copyPath)

IGeometry::StatusCode EdgeGeom::findElementSizes(bool recalculate)
{
auto* sizes = getDataStructureRef().getDataAs<Float32Array>(m_ElementSizesId);
auto* sizes = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_ElementSizesId);
if(sizes != nullptr && !recalculate)
{
return 0;
Expand Down Expand Up @@ -174,7 +174,7 @@ IGeometry::StatusCode EdgeGeom::findElementSizes(bool recalculate)

IGeometry::StatusCode EdgeGeom::findElementsContainingVert(bool recalculate)
{
auto* containsVert = getDataStructureRef().getDataAs<ElementDynamicList>(m_CellContainingVertDataArrayId);
auto* containsVert = getDataStructureRef().getDataAsUnsafe<ElementDynamicList>(m_CellContainingVertDataArrayId);
if(containsVert != nullptr && !recalculate)
{
return 0;
Expand All @@ -195,7 +195,7 @@ IGeometry::StatusCode EdgeGeom::findElementsContainingVert(bool recalculate)

IGeometry::StatusCode EdgeGeom::findElementNeighbors(bool recalculate)
{
auto* edgeNeighbors = getDataStructureRef().getDataAs<ElementDynamicList>(m_CellNeighborsDataArrayId);
auto* edgeNeighbors = getDataStructureRef().getDataAsUnsafe<ElementDynamicList>(m_CellNeighborsDataArrayId);
if(edgeNeighbors != nullptr && !recalculate)
{
return 0;
Expand Down Expand Up @@ -228,7 +228,7 @@ IGeometry::StatusCode EdgeGeom::findElementNeighbors(bool recalculate)

IGeometry::StatusCode EdgeGeom::findElementCentroids(bool recalculate)
{
auto* edgeCentroids = getDataStructureRef().getDataAs<Float32Array>(m_CellCentroidsDataArrayId);
auto* edgeCentroids = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_CellCentroidsDataArrayId);
if(edgeCentroids != nullptr && !recalculate)
{
return 0;
Expand Down
16 changes: 8 additions & 8 deletions src/simplnx/DataStructure/Geometry/HexahedralGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ usize HexahedralGeom::getNumberOfCells() const

IGeometry::StatusCode HexahedralGeom::findElementSizes(bool recalculate)
{
auto* hexSizes = getDataStructureRef().getDataAs<Float32Array>(m_ElementSizesId);
auto* hexSizes = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_ElementSizesId);
if(hexSizes != nullptr && !recalculate)
{
return 0;
Expand All @@ -215,7 +215,7 @@ IGeometry::StatusCode HexahedralGeom::findElementSizes(bool recalculate)

IGeometry::StatusCode HexahedralGeom::findElementsContainingVert(bool recalculate)
{
auto* hexasControllingVert = getDataStructureRef().getDataAs<ElementDynamicList>(m_CellContainingVertDataArrayId);
auto* hexasControllingVert = getDataStructureRef().getDataAsUnsafe<ElementDynamicList>(m_CellContainingVertDataArrayId);
if(hexasControllingVert != nullptr && !recalculate)
{
return 0;
Expand All @@ -236,7 +236,7 @@ IGeometry::StatusCode HexahedralGeom::findElementsContainingVert(bool recalculat

IGeometry::StatusCode HexahedralGeom::findElementNeighbors(bool recalculate)
{
auto* hexNeighbors = getDataStructureRef().getDataAs<ElementDynamicList>(m_CellNeighborsDataArrayId);
auto* hexNeighbors = getDataStructureRef().getDataAsUnsafe<ElementDynamicList>(m_CellNeighborsDataArrayId);
if(hexNeighbors != nullptr && !recalculate)
{
return 0;
Expand Down Expand Up @@ -268,7 +268,7 @@ IGeometry::StatusCode HexahedralGeom::findElementNeighbors(bool recalculate)

IGeometry::StatusCode HexahedralGeom::findElementCentroids(bool recalculate)
{
auto* hexCentroids = getDataStructureRef().getDataAs<Float32Array>(m_CellCentroidsDataArrayId);
auto* hexCentroids = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_CellCentroidsDataArrayId);
if(hexCentroids != nullptr && !recalculate)
{
return 0;
Expand Down Expand Up @@ -332,7 +332,7 @@ void HexahedralGeom::getShapeFunctions(const Point3D<float64>& pCoords, float64*

IGeometry::StatusCode HexahedralGeom::findEdges(bool recalculate)
{
auto* edgeList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_EdgeDataArrayId);
auto* edgeList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_EdgeDataArrayId);
if(edgeList != nullptr && !recalculate)
{
return 0;
Expand All @@ -353,7 +353,7 @@ IGeometry::StatusCode HexahedralGeom::findEdges(bool recalculate)

IGeometry::StatusCode HexahedralGeom::findFaces(bool recalculate)
{
auto* quadList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_FaceListId);
auto* quadList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_FaceListId);
if(quadList != nullptr && !recalculate)
{
return 0;
Expand All @@ -374,7 +374,7 @@ IGeometry::StatusCode HexahedralGeom::findFaces(bool recalculate)

IGeometry::StatusCode HexahedralGeom::findUnsharedEdges(bool recalculate)
{
auto* unsharedEdgeList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_UnsharedEdgeListId);
auto* unsharedEdgeList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_UnsharedEdgeListId);
if(unsharedEdgeList != nullptr && !recalculate)
{
return 0;
Expand All @@ -396,7 +396,7 @@ IGeometry::StatusCode HexahedralGeom::findUnsharedEdges(bool recalculate)

IGeometry::StatusCode HexahedralGeom::findUnsharedFaces(bool recalculate)
{
auto* unsharedQuadList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_UnsharedFaceListId);
auto* unsharedQuadList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_UnsharedFaceListId);
if(unsharedQuadList != nullptr && !recalculate)
{
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/simplnx/DataStructure/Geometry/ImageGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ usize ImageGeom::getNumberOfCells() const

IGeometry::StatusCode ImageGeom::findElementSizes(bool recalculate)
{
auto* voxelSizes = getDataStructureRef().getDataAs<Float32Array>(m_ElementSizesId);
auto* voxelSizes = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_ElementSizesId);
if(voxelSizes != nullptr && !recalculate)
{
return 0;
Expand Down
12 changes: 6 additions & 6 deletions src/simplnx/DataStructure/Geometry/QuadGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ usize QuadGeom::getNumberOfVerticesPerFace() const

IGeometry::StatusCode QuadGeom::findElementSizes(bool recalculate)
{
auto* quadSizes = getDataStructureRef().getDataAs<Float32Array>(m_ElementSizesId);
auto* quadSizes = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_ElementSizesId);
if(quadSizes != nullptr && !recalculate)
{
return 0;
Expand All @@ -190,7 +190,7 @@ IGeometry::StatusCode QuadGeom::findElementSizes(bool recalculate)

IGeometry::StatusCode QuadGeom::findElementsContainingVert(bool recalculate)
{
auto* quadsContainingVert = getDataStructureRef().getDataAs<ElementDynamicList>(m_CellContainingVertDataArrayId);
auto* quadsContainingVert = getDataStructureRef().getDataAsUnsafe<ElementDynamicList>(m_CellContainingVertDataArrayId);
if(quadsContainingVert != nullptr && !recalculate)
{
return 0;
Expand All @@ -211,7 +211,7 @@ IGeometry::StatusCode QuadGeom::findElementsContainingVert(bool recalculate)

IGeometry::StatusCode QuadGeom::findElementNeighbors(bool recalculate)
{
auto* quadNeighbors = getDataStructureRef().getDataAs<ElementDynamicList>(m_CellNeighborsDataArrayId);
auto* quadNeighbors = getDataStructureRef().getDataAsUnsafe<ElementDynamicList>(m_CellNeighborsDataArrayId);
if(quadNeighbors != nullptr && !recalculate)
{
return 0;
Expand Down Expand Up @@ -243,7 +243,7 @@ IGeometry::StatusCode QuadGeom::findElementNeighbors(bool recalculate)

IGeometry::StatusCode QuadGeom::findElementCentroids(bool recalculate)
{
auto* quadCentroids = getDataStructureRef().getDataAs<Float32Array>(m_CellCentroidsDataArrayId);
auto* quadCentroids = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_CellCentroidsDataArrayId);
if(quadCentroids != nullptr && !recalculate)
{
return 0;
Expand Down Expand Up @@ -285,7 +285,7 @@ void QuadGeom::getShapeFunctions(const Point3D<float64>& pCoords, float64* shape

IGeometry::StatusCode QuadGeom::findEdges(bool recalculate)
{
auto* edgeList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_EdgeDataArrayId);
auto* edgeList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_EdgeDataArrayId);
if(edgeList != nullptr && !recalculate)
{
return 0;
Expand All @@ -306,7 +306,7 @@ IGeometry::StatusCode QuadGeom::findEdges(bool recalculate)

IGeometry::StatusCode QuadGeom::findUnsharedEdges(bool recalculate)
{
auto* unsharedEdgeList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_UnsharedEdgeListId);
auto* unsharedEdgeList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_UnsharedEdgeListId);
if(unsharedEdgeList != nullptr && !recalculate)
{
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/simplnx/DataStructure/Geometry/RectGridGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ usize RectGridGeom::getNumberOfCells() const

IGeometry::StatusCode RectGridGeom::findElementSizes(bool recalculate)
{
auto* sizeArray = getDataStructureRef().getDataAs<Float32Array>(m_ElementSizesId);
auto* sizeArray = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_ElementSizesId);
if(sizeArray != nullptr && !recalculate)
{
return 0;
Expand Down
16 changes: 8 additions & 8 deletions src/simplnx/DataStructure/Geometry/TetrahedralGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ usize TetrahedralGeom::getNumberOfCells() const

IGeometry::StatusCode TetrahedralGeom::findElementSizes(bool recalculate)
{
auto* tetSizes = getDataStructureRef().getDataAs<Float32Array>(m_ElementSizesId);
auto* tetSizes = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_ElementSizesId);
if(tetSizes != nullptr && !recalculate)
{
return 0;
Expand All @@ -215,7 +215,7 @@ IGeometry::StatusCode TetrahedralGeom::findElementSizes(bool recalculate)

IGeometry::StatusCode TetrahedralGeom::findElementsContainingVert(bool recalculate)
{
auto* tetsContainingVert = getDataStructureRef().getDataAs<ElementDynamicList>(m_CellContainingVertDataArrayId);
auto* tetsContainingVert = getDataStructureRef().getDataAsUnsafe<ElementDynamicList>(m_CellContainingVertDataArrayId);
if(tetsContainingVert != nullptr && !recalculate)
{
return 0;
Expand All @@ -236,7 +236,7 @@ IGeometry::StatusCode TetrahedralGeom::findElementsContainingVert(bool recalcula

IGeometry::StatusCode TetrahedralGeom::findElementNeighbors(bool recalculate)
{
auto* tetNeighbors = getDataStructureRef().getDataAs<ElementDynamicList>(m_CellNeighborsDataArrayId);
auto* tetNeighbors = getDataStructureRef().getDataAsUnsafe<ElementDynamicList>(m_CellNeighborsDataArrayId);
if(tetNeighbors != nullptr && !recalculate)
{
return 0;
Expand Down Expand Up @@ -268,7 +268,7 @@ IGeometry::StatusCode TetrahedralGeom::findElementNeighbors(bool recalculate)

IGeometry::StatusCode TetrahedralGeom::findElementCentroids(bool recalculate)
{
auto* tetCentroids = getDataStructureRef().getDataAs<Float32Array>(m_CellCentroidsDataArrayId);
auto* tetCentroids = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_CellCentroidsDataArrayId);
if(tetCentroids != nullptr && !recalculate)
{
return 0;
Expand Down Expand Up @@ -316,7 +316,7 @@ void TetrahedralGeom::getShapeFunctions([[maybe_unused]] const Point3D<float64>&

IGeometry::StatusCode TetrahedralGeom::findEdges(bool recalculate)
{
auto* edgeList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_EdgeDataArrayId);
auto* edgeList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_EdgeDataArrayId);
if(edgeList != nullptr && !recalculate)
{
return 0;
Expand All @@ -337,7 +337,7 @@ IGeometry::StatusCode TetrahedralGeom::findEdges(bool recalculate)

IGeometry::StatusCode TetrahedralGeom::findFaces(bool recalculate)
{
auto* triList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_FaceListId);
auto* triList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_FaceListId);
if(triList != nullptr && !recalculate)
{
return 0;
Expand All @@ -358,7 +358,7 @@ IGeometry::StatusCode TetrahedralGeom::findFaces(bool recalculate)

IGeometry::StatusCode TetrahedralGeom::findUnsharedEdges(bool recalculate)
{
auto* unsharedEdgeList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_UnsharedEdgeListId);
auto* unsharedEdgeList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_UnsharedEdgeListId);
if(unsharedEdgeList != nullptr && !recalculate)
{
return 0;
Expand All @@ -380,7 +380,7 @@ IGeometry::StatusCode TetrahedralGeom::findUnsharedEdges(bool recalculate)

IGeometry::StatusCode TetrahedralGeom::findUnsharedFaces(bool recalculate)
{
auto* unsharedTriList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_UnsharedFaceListId);
auto* unsharedTriList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_UnsharedFaceListId);
if(unsharedTriList != nullptr && !recalculate)
{
return 0;
Expand Down
12 changes: 6 additions & 6 deletions src/simplnx/DataStructure/Geometry/TriangleGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ usize TriangleGeom::getNumberOfVerticesPerFace() const

IGeometry::StatusCode TriangleGeom::findElementSizes(bool recalculate)
{
auto* triangleSizes = getDataStructureRef().getDataAs<Float32Array>(m_ElementSizesId);
auto* triangleSizes = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_ElementSizesId);
if(triangleSizes != nullptr && !recalculate)
{
return 0;
Expand All @@ -191,7 +191,7 @@ IGeometry::StatusCode TriangleGeom::findElementSizes(bool recalculate)

IGeometry::StatusCode TriangleGeom::findElementsContainingVert(bool recalculate)
{
auto* trianglesContainingVert = getDataStructureRef().getDataAs<ElementDynamicList>(m_CellContainingVertDataArrayId);
auto* trianglesContainingVert = getDataStructureRef().getDataAsUnsafe<ElementDynamicList>(m_CellContainingVertDataArrayId);
if(trianglesContainingVert != nullptr && !recalculate)
{
return 0;
Expand All @@ -212,7 +212,7 @@ IGeometry::StatusCode TriangleGeom::findElementsContainingVert(bool recalculate)

IGeometry::StatusCode TriangleGeom::findElementNeighbors(bool recalculate)
{
auto* triangleNeighbors = getDataStructureRef().getDataAs<ElementDynamicList>(m_CellNeighborsDataArrayId);
auto* triangleNeighbors = getDataStructureRef().getDataAsUnsafe<ElementDynamicList>(m_CellNeighborsDataArrayId);
if(triangleNeighbors != nullptr && !recalculate)
{
return 0;
Expand Down Expand Up @@ -244,7 +244,7 @@ IGeometry::StatusCode TriangleGeom::findElementNeighbors(bool recalculate)

IGeometry::StatusCode TriangleGeom::findElementCentroids(bool recalculate)
{
auto* triangleCentroids = getDataStructureRef().getDataAs<Float32Array>(m_CellCentroidsDataArrayId);
auto* triangleCentroids = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_CellCentroidsDataArrayId);
if(triangleCentroids != nullptr && !recalculate)
{
return 0;
Expand Down Expand Up @@ -284,7 +284,7 @@ void TriangleGeom::getShapeFunctions([[maybe_unused]] const Point3D<float64>& pC

IGeometry::StatusCode TriangleGeom::findEdges(bool recalculate)
{
auto* edgeList = getDataStructureRef().getDataAs<UInt64Array>(m_EdgeDataArrayId);
auto* edgeList = getDataStructureRef().getDataAsUnsafe<UInt64Array>(m_EdgeDataArrayId);
if(edgeList != nullptr && !recalculate)
{
return 0;
Expand All @@ -306,7 +306,7 @@ IGeometry::StatusCode TriangleGeom::findEdges(bool recalculate)

IGeometry::StatusCode TriangleGeom::findUnsharedEdges(bool recalculate)
{
auto* unsharedEdgeList = getDataStructureRef().getDataAs<DataArray<MeshIndexType>>(m_UnsharedEdgeListId);
auto* unsharedEdgeList = getDataStructureRef().getDataAsUnsafe<DataArray<MeshIndexType>>(m_UnsharedEdgeListId);
if(unsharedEdgeList != nullptr && !recalculate)
{
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/simplnx/DataStructure/Geometry/VertexGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ std::shared_ptr<DataObject> VertexGeom::deepCopy(const DataPath& copyPath)

IGeometry::StatusCode VertexGeom::findElementSizes(bool recalculate)
{
auto* vertexSizes = getDataStructureRef().getDataAs<Float32Array>(m_ElementSizesId);
auto* vertexSizes = getDataStructureRef().getDataAsUnsafe<Float32Array>(m_ElementSizesId);
if(vertexSizes != nullptr && !recalculate)
{
return 0;
Expand Down

0 comments on commit 582cbbd

Please sign in to comment.