From eb7ebcf65355b5cbae48114d830bce642c44b508 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sat, 4 May 2024 17:52:11 -0400 Subject: [PATCH] more fixes --- .clang-tidy | 2 +- source/fluxes/main.cpp | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 1e22849..2ab8a4f 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -40,4 +40,4 @@ Checks: > mpi-*, openmp-* -HeaderFilterRegex: '(/conductivity/|/constants/|/EOS/|/integration/|/interfaces/|/networks/|/neutrinos/|/nse_solver/|/opacity/|/rates/|/screening/|/util/|^\./|^./tmp_build_dir/microphysics_sources/*/).*\.H$' \ No newline at end of file +HeaderFilterRegex: '(/source/*/|^\./|^./tmp_build_dir/microphysics_sources/*/).*\.H$' \ No newline at end of file diff --git a/source/fluxes/main.cpp b/source/fluxes/main.cpp index 091fe7e..67588b1 100644 --- a/source/fluxes/main.cpp +++ b/source/fluxes/main.cpp @@ -31,7 +31,7 @@ get_vy_index(const std::vector& var_names_pf) { if (idx == var_names_pf.cend()) { amrex::Error("Error: could not find vely component"); } - return std::distance(var_names_pf.cbegin(), idx); + return static_cast(std::distance(var_names_pf.cbegin(), idx)); } inline int @@ -41,7 +41,7 @@ get_vz_index(const std::vector& var_names_pf) { if (idx == var_names_pf.cend()) { amrex::Error("Error: could not find velz component"); } - return std::distance(var_names_pf.cbegin(), idx); + return static_cast(std::distance(var_names_pf.cbegin(), idx)); } inline int @@ -51,12 +51,11 @@ get_dT_index(const std::vector& var_names_pf) { if (idx == var_names_pf.cend()) { amrex::Error("Error: could not find tpert component"); } - return std::distance(var_names_pf.cbegin(), idx); + return static_cast(std::distance(var_names_pf.cbegin(), idx)); } void main_main() { - const int narg = amrex::command_argument_count(); std::string pltfile(diag_rp::plotfile); @@ -98,10 +97,12 @@ void main_main() int spec_comp = get_spec_index(var_names_pf); int dT_comp = get_dT_index(var_names_pf); - int v_comp = get_vy_index(var_names_pf); - if (ndims == 3) { + int vcomp{-1}; + if (ndims == 2) { + v_comp = get_vy_index(var_names_pf); + } else if (ndims == 3) { // z is the vertical - int v_comp = get_vz_index(var_names_pf); + v_comp = get_vz_index(var_names_pf); } // create the variable names we will derive and store in the output @@ -140,7 +141,7 @@ void main_main() // output MultiFab - gmf[ilev].define(pf.boxArray(ilev), pf.DistributionMap(ilev), gvarnames.size(), 0); + gmf[ilev].define(pf.boxArray(ilev), pf.DistributionMap(ilev), static_cast(gvarnames.size()), 0); Vector bcr{bcr_default}; auto is_per = is_periodic;