From ef84fa5f5cf45e21bea5597b32a6268683c370c7 Mon Sep 17 00:00:00 2001 From: Marco Garten Date: Wed, 18 Sep 2024 13:42:07 -0700 Subject: [PATCH] Implement clang-tidy fixes --- Source/Diagnostics/Diagnostics.cpp | 2 +- Source/Diagnostics/FullDiagnostics.cpp | 2 +- Source/Diagnostics/MultiDiagnostics.cpp | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Diagnostics/Diagnostics.cpp b/Source/Diagnostics/Diagnostics.cpp index 51330f81cfe..c8a5f93a535 100644 --- a/Source/Diagnostics/Diagnostics.cpp +++ b/Source/Diagnostics/Diagnostics.cpp @@ -581,7 +581,7 @@ Diagnostics::ComputeAndPack () if (m_diag_type == DiagTypes::TimeAveraged) { - amrex::Real real_a = 1.0; + const amrex::Real real_a = 1.0; // call amrex sax operation to do the following amrex::MultiFab::Saxpy( m_sum_mf_output[i_buffer][lev], real_a, m_mf_output[i_buffer][lev], diff --git a/Source/Diagnostics/FullDiagnostics.cpp b/Source/Diagnostics/FullDiagnostics.cpp index bcae1c04bd1..2099752a2e7 100644 --- a/Source/Diagnostics/FullDiagnostics.cpp +++ b/Source/Diagnostics/FullDiagnostics.cpp @@ -196,7 +196,7 @@ FullDiagnostics::Flush ( int i_buffer, bool /* force_flush */ ) if (m_time_average_type == TimeAverageType::Static || m_time_average_type == TimeAverageType::Dynamic) { // Loop over the output levels and divide by the number of steps in the averaging period for (int lev = 0; lev < nlev_output; ++lev) { - m_sum_mf_output.at(i_buffer).at(lev).mult(1./m_average_period_steps); + m_sum_mf_output.at(i_buffer).at(lev).mult(1._rt/static_cast(m_average_period_steps)); } m_flush_format->WriteToFile( diff --git a/Source/Diagnostics/MultiDiagnostics.cpp b/Source/Diagnostics/MultiDiagnostics.cpp index 1dd4c62c0f5..2119ac276f9 100644 --- a/Source/Diagnostics/MultiDiagnostics.cpp +++ b/Source/Diagnostics/MultiDiagnostics.cpp @@ -21,9 +21,7 @@ MultiDiagnostics::MultiDiagnostics () */ alldiags.resize( ndiags ); for (int i=0; i(i, diags_names[i], diags_types[i]); - } else if ( diags_types[i] == DiagTypes::TimeAveraged ){ + if ( diags_types[i] == DiagTypes::Full || diags_types[i] == DiagTypes::TimeAveraged ){ alldiags[i] = std::make_unique(i, diags_names[i], diags_types[i]); } else if ( diags_types[i] == DiagTypes::BackTransformed ){ alldiags[i] = std::make_unique(i, diags_names[i], diags_types[i]);