Skip to content

Commit a310f86

Browse files
committed
Remove zero-threshold checks from intersection shaper and in-memory example
1 parent 305cbf8 commit a310f86

File tree

2 files changed

+0
-92
lines changed

2 files changed

+0
-92
lines changed

src/axom/quest/IntersectionShaper.hpp

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,6 @@ class IntersectionShaper : public Shaper
12311231
const int device_allocator = m_allocatorId;
12321232

12331233
constexpr int NUM_TETS_PER_HEX = 24;
1234-
constexpr double ZERO_THRESHOLD = 1.e-10;
12351234

12361235
SLIC_INFO(axom::fmt::format("{:-^80}",
12371236
" Inserting shapes' bounding boxes into BVH "));
@@ -1260,11 +1259,6 @@ class IntersectionShaper : public Shaper
12601259

12611260
axom::ArrayView<const BoundingBox3D> hex_bbs_device_view = m_hex_bbs.view();
12621261

1263-
// Set shape components to zero if within threshold
1264-
snapShapeVerticesToZero<ExecSpace, ShapeType>(shapes,
1265-
shape_count,
1266-
ZERO_THRESHOLD);
1267-
12681262
// Find which shape bounding boxes intersect hexahedron bounding boxes
12691263
SLIC_INFO(axom::fmt::format(
12701264
"{:-^80}",
@@ -2782,7 +2776,6 @@ class IntersectionShaper : public Shaper
27822776

27832777
m_hexes = axom::Array<HexahedronType>(m_cellCount, m_cellCount, allocId);
27842778
axom::ArrayView<HexahedronType> hexes_device_view = m_hexes.view();
2785-
constexpr double ZERO_THRESHOLD = 1.e-10;
27862779
axom::for_all<ExecSpace>(
27872780
m_cellCount,
27882781
AXOM_LAMBDA(axom::IndexType i) {
@@ -2796,63 +2789,10 @@ class IntersectionShaper : public Shaper
27962789
Point3D({vertCoords_device_view[vertIndex],
27972790
vertCoords_device_view[vertIndex + 1],
27982791
vertCoords_device_view[vertIndex + 2]});
2799-
2800-
// Set hexahedra components to zero if within threshold
2801-
if(axom::utilities::isNearlyEqual(hexes_device_view[i][j][0],
2802-
0.0,
2803-
ZERO_THRESHOLD))
2804-
{
2805-
hexes_device_view[i][j][0] = 0.0;
2806-
}
2807-
2808-
if(axom::utilities::isNearlyEqual(hexes_device_view[i][j][1],
2809-
0.0,
2810-
ZERO_THRESHOLD))
2811-
{
2812-
hexes_device_view[i][j][1] = 0.0;
2813-
}
2814-
2815-
if(axom::utilities::isNearlyEqual(hexes_device_view[i][j][2],
2816-
0.0,
2817-
ZERO_THRESHOLD))
2818-
{
2819-
hexes_device_view[i][j][2] = 0.0;
2820-
}
28212792
}
28222793
}); // end of loop to initialize hexahedral elements and bounding boxes
28232794
}
28242795

2825-
//!\brief Set shape vertices to zero of within threshold.
2826-
template <typename ExecSpace, typename ShapeType>
2827-
void snapShapeVerticesToZero(axom::Array<ShapeType>& shapes,
2828-
axom::IndexType shapeCount,
2829-
double zeroThreshold)
2830-
{
2831-
AXOM_ANNOTATE_SCOPE("snapShapeVerticesToZero");
2832-
axom::ArrayView<ShapeType> shapesView = shapes.view();
2833-
axom::for_all<ExecSpace>(
2834-
shapeCount,
2835-
AXOM_LAMBDA(axom::IndexType i) {
2836-
for(int j = 0; j < ShapeType::NUM_VERTS; j++)
2837-
{
2838-
if(axom::utilities::isNearlyEqual(shapesView[i][j][0], 0.0, zeroThreshold))
2839-
{
2840-
shapesView[i][j][0] = 0.0;
2841-
}
2842-
2843-
if(axom::utilities::isNearlyEqual(shapesView[i][j][1], 0.0, zeroThreshold))
2844-
{
2845-
shapesView[i][j][1] = 0.0;
2846-
}
2847-
2848-
if(axom::utilities::isNearlyEqual(shapesView[i][j][2], 0.0, zeroThreshold))
2849-
{
2850-
shapesView[i][j][2] = 0.0;
2851-
}
2852-
}
2853-
});
2854-
}
2855-
28562796
#if defined(AXOM_USE_CONDUIT)
28572797
template <typename ExecSpace>
28582798
void populateVertCoordsFromBlueprintMesh2D(axom::Array<double>& vertCoords)

src/axom/quest/examples/quest_shape_in_memory.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,6 @@ axom::sidre::View* getElementVolumes(
10781078

10791079
constexpr int NUM_VERTS_PER_HEX = 8;
10801080
constexpr int NUM_COMPS_PER_VERT = 3;
1081-
constexpr double ZERO_THRESHOLD = 1.e-10;
10821081

10831082
axom::Array<Point3D> vertCoords(cellCount * NUM_VERTS_PER_HEX,
10841083
cellCount * NUM_VERTS_PER_HEX);
@@ -1103,21 +1102,6 @@ axom::sidre::View* getElementVolumes(
11031102
}
11041103
}
11051104

1106-
// Set vertex coords to zero if within threshold.
1107-
// (I don't know why we do this. I'm following examples.)
1108-
axom::ArrayView<double> flatCoordsView(
1109-
(double*)vertCoords.data(),
1110-
vertCoords.size() * Point3D::dimension());
1111-
assert(flatCoordsView.size() == cellCount * NUM_VERTS_PER_HEX * 3);
1112-
axom::for_all<ExecSpace>(
1113-
cellCount * 3,
1114-
AXOM_LAMBDA(axom::IndexType i) {
1115-
if(axom::utilities::isNearlyEqual(flatCoordsView[i], 0.0, ZERO_THRESHOLD))
1116-
{
1117-
flatCoordsView[i] = 0.0;
1118-
}
1119-
});
1120-
11211105
// Initialize hexahedral elements.
11221106
axom::Array<HexahedronType> hexes(cellCount, cellCount);
11231107
auto hexesView = hexes.view();
@@ -1308,7 +1292,6 @@ axom::sidre::View* getElementVolumes(
13081292

13091293
constexpr int NUM_VERTS_PER_HEX = 8;
13101294
constexpr int NUM_COMPS_PER_VERT = 3;
1311-
constexpr double ZERO_THRESHOLD = 1.e-10;
13121295

13131296
/*
13141297
Get vertex coordinates. We use UnstructuredMesh for this,
@@ -1369,21 +1352,6 @@ axom::sidre::View* getElementVolumes(
13691352
}
13701353
});
13711354

1372-
// Set vertex coords to zero if within threshold.
1373-
// (I don't know why we do this. I'm following examples.)
1374-
axom::ArrayView<double> flatCoordsView(
1375-
(double*)vertCoords.data(),
1376-
vertCoords.size() * Point3D::dimension());
1377-
assert(flatCoordsView.size() == cellCount * NUM_VERTS_PER_HEX * 3);
1378-
axom::for_all<ExecSpace>(
1379-
cellCount * 3,
1380-
AXOM_LAMBDA(axom::IndexType i) {
1381-
if(axom::utilities::isNearlyEqual(flatCoordsView[i], 0.0, ZERO_THRESHOLD))
1382-
{
1383-
flatCoordsView[i] = 0.0;
1384-
}
1385-
});
1386-
13871355
// Initialize hexahedral elements.
13881356
axom::Array<HexahedronType> hexes(cellCount,
13891357
cellCount,

0 commit comments

Comments
 (0)