Skip to content

Commit

Permalink
Apply style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
format-robot committed Oct 11, 2024
1 parent ba9bf06 commit af983a8
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 35 deletions.
12 changes: 6 additions & 6 deletions src/axom/core/utilities/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ namespace utilities
#ifdef WIN32
std::string TCharToString(TCHAR* buf)
{
#ifndef UNICODE
return std::string(buf);
#else
const auto wStr = std::wstring(buf);
return std::string(wStr.begin(), wStr.end());
#endif
#ifndef UNICODE
return std::string(buf);
#else
const auto wStr = std::wstring(buf);
return std::string(wStr.begin(), wStr.end());
#endif
}
#endif

Expand Down
10 changes: 6 additions & 4 deletions src/axom/quest/PointInCell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,18 +338,19 @@ class PointInCell
* \returns A std::vector of the candidates associated with \a pt
* \note If the query point is 2D and the spatial index is 3D, we use 0 for the z-coordinate
*/
std::vector<IndexType> getCandidatesForPt(axom::primal::Point<double,2> const& pt)
std::vector<IndexType> getCandidatesForPt(axom::primal::Point<double, 2> const& pt)
{
switch(m_meshWrapper.meshDimension())
{
case 2:
return m_pointFinder2D->getCandidates(pt);
case 3:
return m_pointFinder3D->getCandidates(axom::primal::Point<double, 3>(pt.data(), 2));
return m_pointFinder3D->getCandidates(
axom::primal::Point<double, 3>(pt.data(), 2));
default:
SLIC_ERROR("Point in Cell query only defined for 2D or 3D meshes.");
return std::vector<IndexType> {};
}
}
}

/*!
Expand All @@ -365,7 +366,8 @@ class PointInCell
switch(m_meshWrapper.meshDimension())
{
case 2:
return m_pointFinder2D->getCandidates(axom::primal::Point<double, 2>(pt.data(), 2));
return m_pointFinder2D->getCandidates(
axom::primal::Point<double, 2>(pt.data(), 2));
case 3:
return m_pointFinder3D->getCandidates(pt);
default:
Expand Down
15 changes: 8 additions & 7 deletions src/axom/quest/tests/quest_point_in_cell_mfem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,8 @@ class PointInCellTest : public ::testing::Test

// Check that we found a cell
EXPECT_NE(MeshTraits::NO_CELL, foundCellId)
<< "element: " << eltId
<< "\n -- isopar: " << isoparCenter
<< "\n -- foundIsopar: " << foundIsoPar
<< "\n -- spacePt: " << spacePt
<< "element: " << eltId << "\n -- isopar: " << isoparCenter
<< "\n -- foundIsopar: " << foundIsoPar << "\n -- spacePt: " << spacePt
<< "\n -- isBdry: " << (isBdry ? "yes" : "no")
<< "\n -- bbox of element: " << this->m_boundingBoxes[eltId]
<< axom::fmt::format(" ({} point)",
Expand Down Expand Up @@ -788,7 +786,9 @@ class PointInCell2DTest : public PointInCellTest<2, ExecSpace>
// compute bounding boxes
this->m_boundingBoxes.resize(mesh->GetNE());
axom::quest::detail::PointInCellMeshWrapper<mesh_tag> meshWrapper(mesh);
meshWrapper.computeBoundingBoxes<DIM>(1.+ 1e-8, this->m_boundingBoxes.data(), this->m_meshBoundingBox);
meshWrapper.computeBoundingBoxes<DIM>(1. + 1e-8,
this->m_boundingBoxes.data(),
this->m_meshBoundingBox);
}

private:
Expand Down Expand Up @@ -1006,11 +1006,12 @@ class PointInCell3DTest : public PointInCellTest<3, ExecSpace>
// Dump mesh to disk
this->outputMesh(this->m_meshDescriptorStr);


// compute bounding boxes
this->m_boundingBoxes.resize(mesh->GetNE());
axom::quest::detail::PointInCellMeshWrapper<mesh_tag> meshWrapper(mesh);
meshWrapper.computeBoundingBoxes<DIM>(1 + 1e-8, this->m_boundingBoxes.data(), this->m_meshBoundingBox);
meshWrapper.computeBoundingBoxes<DIM>(1 + 1e-8,
this->m_boundingBoxes.data(),
this->m_meshBoundingBox);
}

private:
Expand Down
7 changes: 4 additions & 3 deletions src/axom/slam/BitSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ class BitSet
public:
using Index = int;

#if(defined(__x86_64__) && defined(__GNUC__)) || (defined(_WIN64) && (_MSC_VER >= 1600))
#if(defined(__x86_64__) && defined(__GNUC__)) || \
(defined(_WIN64) && (_MSC_VER >= 1600))
using Word = std::uint64_t;
#else
#else
using Word = std::uint32_t;
#endif
#endif

// TODO: update using a policy
using ArrayType = axom::Array<Word, 1>;
Expand Down
26 changes: 13 additions & 13 deletions src/axom/slam/tests/slam_set_BitSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ std::vector<int> testSizes()
{
std::vector<int> vals;

vals.push_back(0); // empty bitset
vals.push_back(23); // less than one word
vals.push_back(31); // one bit less than a 4-byte word
vals.push_back(32); // exactly one 4-byte word
vals.push_back(33); // one bit more than a 4-byte word
vals.push_back(63); // one bit less than an 8-byte word
vals.push_back(64); // exactly one 8-byte word
vals.push_back(65); // one bit more than an 8-byte word
vals.push_back(127); // one bit less than two words
vals.push_back(128); // two words
vals.push_back(129); // more than two words
vals.push_back(0); // empty bitset
vals.push_back(23); // less than one word
vals.push_back(31); // one bit less than a 4-byte word
vals.push_back(32); // exactly one 4-byte word
vals.push_back(33); // one bit more than a 4-byte word
vals.push_back(63); // one bit less than an 8-byte word
vals.push_back(64); // exactly one 8-byte word
vals.push_back(65); // one bit more than an 8-byte word
vals.push_back(127); // one bit less than two words
vals.push_back(128); // two words
vals.push_back(129); // more than two words
vals.push_back(153);
vals.push_back(1547); // large bitset
//vals.push_back(1234567); // large bitset
Expand Down Expand Up @@ -269,7 +269,7 @@ TEST_P(SlamBitSet, atomicOps)
slam::BitSet bitset2(NBITS);
for(Index i = 0; i < NBITS; ++i)
{
if(bitset1.test(i))
if(bitset1.test(i))
{
bitset2.atomicSet(i);
}
Expand All @@ -286,7 +286,7 @@ TEST_P(SlamBitSet, atomicOps)
EXPECT_EQ(bitset1, bitset2);

// Apply several atomic operations w/ checks
for(int i=0; i< NBITS; ++i)
for(int i = 0; i < NBITS; ++i)
{
EXPECT_EQ(bitset1.test(i), bitset2.test(i));

Expand Down
6 changes: 4 additions & 2 deletions src/axom/spin/ImplicitGrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,8 @@ ImplicitGrid<NDIMS, ExecSpace, IndexType>::QueryObject::visitCandidates(
int currBit = axom::utilities::countr_zero(currWord);
while(currBit < numBits)
{
bool found = getVisitResult(candidatePredicate, iword * bitsPerWord + currBit);
bool found =
getVisitResult(candidatePredicate, iword * bitsPerWord + currBit);
currBit++;
currBit += axom::utilities::countr_zero(currWord >> currBit);
if(found)
Expand Down Expand Up @@ -1134,7 +1135,8 @@ ImplicitGrid<NDIMS, ExecSpace, IndexType>::QueryObject::visitCandidates(
int currBit = axom::utilities::countr_zero(currWord);
while(currBit < numBits)
{
bool found = getVisitResult(candidatePredicate, iword * bitsPerWord + currBit);
bool found =
getVisitResult(candidatePredicate, iword * bitsPerWord + currBit);
currBit++;
currBit += axom::utilities::countr_zero(currWord >> currBit);
if(found)
Expand Down

0 comments on commit af983a8

Please sign in to comment.