Skip to content

Commit 30a4b72

Browse files
committed
Improve output formatting and fix an error in computing tolerance in 3D.
1 parent 662f2cc commit 30a4b72

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/axom/quest/examples/quest_distributed_distance_query_example.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -983,11 +983,6 @@ class QueryMeshWrapper
983983
SLIC_ASSERT(queryPts.size() == cpCoords.size());
984984
SLIC_ASSERT(queryPts.size() == cpIndices.size());
985985

986-
if(params.isVerbose())
987-
{
988-
SLIC_INFO(axom::fmt::format("Closest points ({}):", cpCoords.size()));
989-
}
990-
991986
/*
992987
Allowable slack is half the arclength between 2 adjacent object
993988
points. A query point on the object can correctly have that
@@ -999,7 +994,7 @@ class QueryMeshWrapper
999994
const double longSpacing =
1000995
2 * M_PI * params.circleRadius / params.longPointCount;
1001996
const double latSpacing = params.circleRadius * M_PI / 180 *
1002-
(params.latRange[1] - params.latRange[0]) / params.latPointCount;
997+
(params.latRange[1] - params.latRange[0]) / (params.latPointCount - 1);
1003998
const double avgObjectRes = DIM == 2
1004999
? longSpacing
10051000
: std::sqrt(longSpacing * longSpacing + latSpacing * latSpacing);
@@ -1572,13 +1567,13 @@ int main(int argc, char** argv)
15721567
getIntMinMax(int(query.searchCount()), minSearchCount, maxSearchCount, sumSearchCount);
15731568

15741569
SLIC_INFO(axom::fmt::format(
1575-
"Initialization with policy {} took {{avg:{}, min:{}, max:{}}} seconds",
1570+
"Initialization with policy {} took {{avg:{:.5f}, min:{:.5f}, max:{:.5f}}} seconds",
15761571
axom::runtime_policy::s_policyToName.at(params.policy),
15771572
sumInit / num_ranks,
15781573
minInit,
15791574
maxInit));
15801575
SLIC_INFO(axom::fmt::format(
1581-
"Query with policy {} took {{avg:{}, min:{}, max:{}}} seconds",
1576+
"Query with policy {} took {{avg:{:.5f}, min:{:.5f}, max:{:.5f}}} seconds",
15821577
axom::runtime_policy::s_policyToName.at(params.policy),
15831578
sumQuery / num_ranks,
15841579
minQuery,
@@ -1589,7 +1584,7 @@ int main(int argc, char** argv)
15891584
minSearchCount,
15901585
maxSearchCount));
15911586
SLIC_INFO(axom::fmt::format(
1592-
"Effective distance threshold {{avg:{}, min:{}, max:{}}}",
1587+
"Effective distance threshold {{avg:{:.5f}, min:{:.5f}, max:{:.5f}}}",
15931588
sumFilterDist / num_ranks,
15941589
minFilterDist,
15951590
maxFilterDist));
@@ -1642,6 +1637,7 @@ int main(int argc, char** argv)
16421637

16431638
queryMeshWrapper.saveMesh(params.distanceFile);
16441639

1640+
axom::slic::flushStreams();
16451641
if(errCount)
16461642
{
16471643
SLIC_INFO(axom::fmt::format(" Error exit: {} errors found.", errCount));

0 commit comments

Comments
 (0)