Skip to content

Commit

Permalink
FillPatch Fortran Interface: Fix incorrect size of Vector<BCRec> (AMR…
Browse files Browse the repository at this point in the history
…eX-Codes#3546)

This fixes a very old bug.
  • Loading branch information
WeiqunZhang authored Sep 15, 2023
1 parent a8192ec commit 6eb91be
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Src/F_Interfaces/AmrCore/AMReX_fillpatch_fi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extern "C"
int* lo_bc[], int* hi_bc[],
INTERP_HOOK pre_interp, INTERP_HOOK post_interp)
{
Vector<BCRec> bcs(ncomp);
Vector<BCRec> bcs;
for (int i = 0; i < ncomp; ++i) {
bcs.emplace_back(lo_bc[i+scomp], hi_bc[i+scomp]);
}
Expand Down Expand Up @@ -137,7 +137,6 @@ extern "C"
Array<Vector<BCRec>, AMREX_SPACEDIM> bcs;
for (int d = 0; d < AMREX_SPACEDIM; ++d)
{
bcs[d].resize(ncomp);
for (int i = 0; i < ncomp; ++i)
{ bcs[d].emplace_back(lo_bc[d*(scomp+ncomp)+i+scomp],
hi_bc[d*(scomp+ncomp)+i+scomp]); }
Expand Down Expand Up @@ -183,7 +182,7 @@ extern "C"
int* lo_bc[], int* hi_bc[],
INTERP_HOOK pre_interp, INTERP_HOOK post_interp)
{
Vector<BCRec> bcs(ncomp);
Vector<BCRec> bcs;
for (int i = 0; i < ncomp; ++i) {
bcs.emplace_back(lo_bc[i+scomp], hi_bc[i+scomp]);
}
Expand Down

0 comments on commit 6eb91be

Please sign in to comment.