Skip to content

Commit e3bab46

Browse files
authored
Fix diffusion shadow (AMReX-Astro#3068)
some loop counters were also uninitialized. this also fixes a few compiler warnings.
1 parent 0cf48c9 commit e3bab46

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

Exec/unit_tests/diffusion_test/Prob.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ void Castro::problem_post_simulation(Vector<std::unique_ptr<AmrLevel> >& amr_lev
2020
Castro& castro = dynamic_cast<Castro&>(*amr_level[n]);
2121
Real time = castro.get_state_data(State_Type).curTime();
2222

23-
auto domain_lo = castro.geom.Domain().loVect3d();
24-
auto domain_hi = castro.geom.Domain().hiVect3d();
25-
2623
// the state data
2724
MultiFab& S = castro.get_new_data(State_Type);
2825

Exec/unit_tests/diffusion_test/Problem_Derive.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
using namespace amrex;
99

1010

11-
void deranalytic(const Box& bx, FArrayBox& derfab, int dcomp, int /*ncomp*/,
12-
const FArrayBox& datfab, const Geometry& geomdata,
11+
void deranalytic(const Box& bx, FArrayBox& derfab, int /*dcomp*/, int /*ncomp*/,
12+
const FArrayBox& /*datfab*/, const Geometry& geomdata,
1313
Real time, const int* /*bcrec*/, int /*level*/)
1414
{
1515

@@ -18,7 +18,6 @@ void deranalytic(const Box& bx, FArrayBox& derfab, int dcomp, int /*ncomp*/,
1818

1919
const int coord_type = geomdata.Coord();
2020

21-
auto const dat = datfab.array();
2221
auto const der = derfab.array();
2322

2423
amrex::ParallelFor(bx,
@@ -33,8 +32,8 @@ void deranalytic(const Box& bx, FArrayBox& derfab, int dcomp, int /*ncomp*/,
3332
r[2] = problo[2] + dx[2] * (static_cast<Real>(k) + 0.5_rt);
3433
#endif
3534
if (coord_type <= 1) {
36-
for (int i; i < AMREX_SPACEDIM; ++i) {
37-
r[i] -= problem::center[i];
35+
for (int n = 0; n < AMREX_SPACEDIM; ++n) {
36+
r[n] -= problem::center[n];
3837
}
3938
}
4039

Exec/unit_tests/diffusion_test/problem_bc_fill.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ void problem_bc_fill(int i, int j, int k,
4141
r[2] = problo[2] + dx[2] * (static_cast<Real>(k) + 0.5_rt);
4242
#endif
4343
if (coord <= 1) {
44-
for (int i; i < AMREX_SPACEDIM; ++i) {
45-
r[i] -= problem::center[i];
44+
for (int n = 0; n < AMREX_SPACEDIM; ++n) {
45+
r[n] -= problem::center[n];
4646
}
4747
}
4848

Exec/unit_tests/diffusion_test/problem_initialize_state_data.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ void problem_initialize_state_data (int i, int j, int k,
2525
r[2] = problo[2] + dx[2] * (static_cast<Real>(k) + 0.5_rt);
2626
#endif
2727
if (coord_type <= 1) {
28-
for (int i; i < AMREX_SPACEDIM; ++i) {
29-
r[i] -= problem::center[i];
28+
for (int n = 0; n < AMREX_SPACEDIM; ++n) {
29+
r[n] -= problem::center[n];
3030
}
3131
}
3232

0 commit comments

Comments
 (0)