Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some cppcheck fixes #2852

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Source/driver/Castro.H
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ public:
/// @param state MultiFab to check
/// @param check_ghost do we check the ghost cells?
///
static void check_for_nan(amrex::MultiFab& state, int check_ghost=0);
static void check_for_nan(const amrex::MultiFab& state, int check_ghost=0);


#include <Castro_sources.H>
Expand Down Expand Up @@ -1138,7 +1138,7 @@ public:
/// @param S Current state
/// @param time current time
///
void define_new_center (amrex::MultiFab& S, amrex::Real time);
void define_new_center (const amrex::MultiFab& S, amrex::Real time);
void write_center ();

///
Expand Down
8 changes: 4 additions & 4 deletions Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2782,8 +2782,8 @@ Castro::reflux (int crse_level, int fine_level, bool in_post_timestep)
// Update the flux register now that we may have modified some of the flux corrections.

for (OrientationIter fi; fi.isValid(); ++fi) {
FabSet& fs = (*reg)[fi()];
if (fi().coordDir() == idir) {
FabSet& fs = (*reg)[fi()];
fs.copyFrom(temp_fluxes[idir], 0, 0, 0, temp_fluxes[idir].nComp());
}
}
Expand Down Expand Up @@ -3551,7 +3551,7 @@ Castro::apply_tagging_restrictions(TagBoxArray& tags, [[maybe_unused]] Real time
{
bool outer_boundary_test[3] = {false};

int idx[3] = {i, j, k};
const int idx[3] = {i, j, k};

for (int dim = 0; dim < AMREX_SPACEDIM; ++dim) {

Expand Down Expand Up @@ -4239,7 +4239,7 @@ Castro::get_numpts ()
}

void
Castro::define_new_center(MultiFab& S, Real time)
Castro::define_new_center(const MultiFab& S, Real time)
{
BL_PROFILE("Castro::define_new_center()");

Expand Down Expand Up @@ -4428,7 +4428,7 @@ Castro::expand_state(MultiFab& S, Real time, int ng)


void
Castro::check_for_nan(MultiFab& state_in, int check_ghost)
Castro::check_for_nan(const MultiFab& state_in, int check_ghost)
{
BL_PROFILE("Castro::check_for_nan()");

Expand Down
4 changes: 2 additions & 2 deletions Source/driver/Castro_util.H
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ void position(int i, int j, int k,
// Given 3D indices (i,j,k), return the cell-centered spatial position.
// Optionally we can also be edge-centered in any of the directions.

int idx[3] = {i, j, k};
const int idx[3] = {i, j, k};

bool cc[3] = {ccx, ccy, ccz};
const bool cc[3] = {ccx, ccy, ccz};

Real offset[AMREX_SPACEDIM];

Expand Down