Skip to content

Commit

Permalink
Reformat.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunney1 committed Jul 10, 2024
1 parent 43e497d commit f1bb261
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
5 changes: 1 addition & 4 deletions src/axom/quest/detail/MarchingCubesImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase
m_contourVal = contourVal;
}

void setMaskValue(int maskVal) override
{
m_maskVal = maskVal;
}
void setMaskValue(int maskVal) override { m_maskVal = maskVal; }

/*!
@brief Implementation of virtual markCrossings.
Expand Down
40 changes: 24 additions & 16 deletions src/axom/quest/examples/quest_marching_cubes_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ struct Input
->capture_default_str();

app.add_option("--maskCount", maskCount)
->description(
"Split the zones up using this many masks (default to 1).")
->description("Split the zones up using this many masks (default to 1).")
->capture_default_str();

#ifdef AXOM_USE_CALIPER
Expand Down Expand Up @@ -864,7 +863,7 @@ struct ContourTestBase
for(const auto& strategy : m_testStrategies)
{
mc.setFunctionField(strategy->functionName());
for (int iMask=0; iMask<params.maskCount; ++iMask)
for(int iMask = 0; iMask < params.maskCount; ++iMask)
{
mc.computeIsocontour(params.contourVal, iMask);
}
Expand Down Expand Up @@ -1075,26 +1074,35 @@ struct ContourTestBase
{
std::string maskFieldName = "mask";
axom::StackArray<axom::IndexType, DIM> zeros;
for( int d = 0; d < DIM; ++d ) { zeros[d] = 0; }
for ( axom::IndexType domId=0; domId<bpMesh.domainCount(); ++domId )
for(int d = 0; d < DIM; ++d)
{
zeros[d] = 0;
}
for(axom::IndexType domId = 0; domId < bpMesh.domainCount(); ++domId)
{
auto domainView = bpMesh.getDomainView<DIM>(domId);
auto cellCount = domainView.getCellCount();
auto slowestDirs = domainView.getConstCoordsViews()[0].mapping().slowestDirs();
auto slowestDirs =
domainView.getConstCoordsViews()[0].mapping().slowestDirs();
axom::StackArray<axom::IndexType, DIM> fastestDirs;
for ( int d = 0; d < DIM; ++d ) { fastestDirs[d] = slowestDirs[DIM - 1 - d]; }
domainView.createField(
maskFieldName,
"element",
conduit::DataType::c_int(cellCount),
zeros,
zeros,
fastestDirs);
for(int d = 0; d < DIM; ++d)
{
fastestDirs[d] = slowestDirs[DIM - 1 - d];
}
domainView.createField(maskFieldName,
"element",
conduit::DataType::c_int(cellCount),
zeros,
zeros,
fastestDirs);
auto maskView = domainView.template getFieldView<int>(maskFieldName);
int maskCount = params.maskCount;
axom::for_all<ExecSpace>(0, cellCount, AXOM_LAMBDA(axom::IndexType cellId) {
axom::for_all<ExecSpace>(
0,
cellCount,
AXOM_LAMBDA(axom::IndexType cellId) {
maskView.flatIndex(cellId) = (cellId % maskCount);
});
});
}
}

Expand Down

0 comments on commit f1bb261

Please sign in to comment.