Skip to content

Commit

Permalink
Clang tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
the-florist committed Oct 14, 2024
1 parent d64f119 commit 098ee78
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Examples/ScalarField/InitialScalarData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ class InitialScalarData
data_t rr2 = rr * rr;
IntVect iv = current_cell.get_int_vect();

if(iv[0] == 4 && iv[1] == 4 && iv[2] == 4)
if (iv[0] == 4 && iv[1] == 4 && iv[2] == 4)
{
data_t K = NAN;
current_cell.store_vars(K, c_K);
}

// calculate the field value
data_t phi = m_params.amplitude *
(1.0 + 0.01 * rr2 * exp(-pow(rr / m_params.width, 2.0)));
(1.0 + 0.01 * rr2 * exp(-pow(rr / m_params.width, 2.0)));

// store the vars
current_cell.store_vars(phi, c_phi);
Expand Down
2 changes: 1 addition & 1 deletion Examples/ScalarField/ScalarFieldLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void ScalarFieldLevel::initialData()
/*if (m_p.nan_check)
BoxLoops::loop(NanCheck(), m_state_new, m_state_new,
EXCLUDE_GHOST_CELLS, disable_simd());*/

MayDay::Error("Nan check didn't work.");
}

Expand Down
7 changes: 4 additions & 3 deletions Source/BoxUtils/NanCheck.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ class NanCheck
{
double val;
current_cell.load_vars(val, ivar);
if (std::isnan(val) || abs(val) > m_max_abs)
if (std::isnan(val) || abs(val) > m_max_abs)
// we want to exit if any of the threads find a nan
#pragma omp atomic write
stop = true;
thrd = omp_get_thread_num();
thrd = omp_get_thread_num();
}

if (stop)
Expand All @@ -77,7 +77,8 @@ class NanCheck
<< current_cell.load_vars(ivar) << std::endl;
}
pout() << "Nan was caught on thread: " << thrd << "\n";
pout() << "Error message printed on thread: " << omp_get_thread_num() << "\n";
pout() << "Error message printed on thread: "
<< omp_get_thread_num() << "\n";
IntVect iv = current_cell.get_int_vect();
pout() << "Integer coordinates: " << iv << std::endl;
if (m_dx != 0.0)
Expand Down

0 comments on commit 098ee78

Please sign in to comment.