From 098ee78ed66140f1b75f7feea28944cea1330700 Mon Sep 17 00:00:00 2001 From: the-florist Date: Mon, 14 Oct 2024 18:28:55 +0100 Subject: [PATCH] Clang tidy fixes --- Examples/ScalarField/InitialScalarData.hpp | 4 ++-- Examples/ScalarField/ScalarFieldLevel.cpp | 2 +- Source/BoxUtils/NanCheck.hpp | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Examples/ScalarField/InitialScalarData.hpp b/Examples/ScalarField/InitialScalarData.hpp index a98a984db..d882a76da 100644 --- a/Examples/ScalarField/InitialScalarData.hpp +++ b/Examples/ScalarField/InitialScalarData.hpp @@ -44,7 +44,7 @@ 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); @@ -52,7 +52,7 @@ class InitialScalarData // 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); diff --git a/Examples/ScalarField/ScalarFieldLevel.cpp b/Examples/ScalarField/ScalarFieldLevel.cpp index ec7ab4840..9bcaa470e 100644 --- a/Examples/ScalarField/ScalarFieldLevel.cpp +++ b/Examples/ScalarField/ScalarFieldLevel.cpp @@ -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."); } diff --git a/Source/BoxUtils/NanCheck.hpp b/Source/BoxUtils/NanCheck.hpp index 3409f091f..da0ea76d3 100644 --- a/Source/BoxUtils/NanCheck.hpp +++ b/Source/BoxUtils/NanCheck.hpp @@ -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) @@ -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)