Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed May 4, 2024
1 parent 17c3929 commit eb7ebcf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -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$'
HeaderFilterRegex: '(/source/*/|^\./|^./tmp_build_dir/microphysics_sources/*/).*\.H$'
17 changes: 9 additions & 8 deletions source/fluxes/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ get_vy_index(const std::vector<std::string>& 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<int>(std::distance(var_names_pf.cbegin(), idx));
}

inline int
Expand All @@ -41,7 +41,7 @@ get_vz_index(const std::vector<std::string>& 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<int>(std::distance(var_names_pf.cbegin(), idx));
}

inline int
Expand All @@ -51,12 +51,11 @@ get_dT_index(const std::vector<std::string>& 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<int>(std::distance(var_names_pf.cbegin(), idx));
}

void main_main()
{
const int narg = amrex::command_argument_count();

std::string pltfile(diag_rp::plotfile);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<int>(gvarnames.size()), 0);

Vector<BCRec> bcr{bcr_default};
auto is_per = is_periodic;
Expand Down

0 comments on commit eb7ebcf

Please sign in to comment.