Skip to content

Commit

Permalink
Merge pull request #88 from seahorce-scidac/more_fb_changes
Browse files Browse the repository at this point in the history
more FillBoundary->FillPatch
  • Loading branch information
asalmgren authored Dec 14, 2023
2 parents aa534a3 + 9f987bd commit b432f69
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 29 deletions.
7 changes: 4 additions & 3 deletions Source/TimeIntegration/ROMSX_advance_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ ROMSX::advance_3d (int lev, MultiFab& mf_cons,
#endif
}

mf_Huon->FillBoundary(geom[lev].periodicity());
mf_Hvom->FillBoundary(geom[lev].periodicity());
// WE BELIEVE THESE VALUES SHOULD ALREADY BE FILLED
// mf_Huon->FillBoundary(geom[lev].periodicity());
// mf_Hvom->FillBoundary(geom[lev].periodicity());

// ************************************************************************
// This should fill both temp and salt with temp/salt currently in cons_old
Expand Down Expand Up @@ -323,7 +324,7 @@ ROMSX::advance_3d (int lev, MultiFab& mf_cons,

} // mfi

mf_cons.FillBoundary(geom[lev].periodicity());
FillPatch(lev, t_new[lev], mf_cons, cons_new);

for ( MFIter mfi(mf_cons, TilingIfNotGPU()); mfi.isValid(); ++mfi )
{
Expand Down
9 changes: 4 additions & 5 deletions Source/TimeIntegration/ROMSX_advance_3d_ml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ void ROMSX::advance_3d_ml (int lev, Real dt_lev)
vec_Akv[lev], vec_Akt[lev], vec_Hz[lev], vec_Huon[lev], vec_Hvom[lev],
vec_z_w[lev], vec_hOfTheConfusingName[lev], N, dt_lev);

vec_ubar[lev]->FillBoundary(geom[lev].periodicity());
vec_vbar[lev]->FillBoundary(geom[lev].periodicity());

vec_t3[lev]->FillBoundary(geom[lev].periodicity());
vec_s3[lev]->FillBoundary(geom[lev].periodicity());
FillPatch(lev, t_new[lev], *vec_ubar[lev], GetVecOfPtrs(vec_ubar));
FillPatch(lev, t_new[lev], *vec_vbar[lev], GetVecOfPtrs(vec_vbar));
FillPatch(lev, t_new[lev], *vec_t3[lev], GetVecOfPtrs(vec_t3));
FillPatch(lev, t_new[lev], *vec_s3[lev], GetVecOfPtrs(vec_s3));

// Fill in three ways: 1) interpolate from coarse grid if lev > 0; 2) fill from physical boundaries;
// 3) fine-fine fill of ghost cells with FillBoundary call
Expand Down
38 changes: 17 additions & 21 deletions Source/TimeIntegration/ROMSX_setup_step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ ROMSX::setup_step (int lev, Real time, Real dt_lev)
std::unique_ptr<MultiFab>& mf_bvstr = vec_bvstr[lev];
MultiFab mf_rw(ba,dm,1,IntVect(NGROW,NGROW,0));

MultiFab mf_W(ba,dm,1,IntVect(NGROW+1,NGROW+1,0));
mf_W.setVal(0.0);

std::unique_ptr<MultiFab>& mf_visc2_p = vec_visc2_p[lev];
std::unique_ptr<MultiFab>& mf_visc2_r = vec_visc2_r[lev];

Expand All @@ -82,19 +79,15 @@ ROMSX::setup_step (int lev, Real time, Real dt_lev)

mf_DC.setVal(0);

U_old.FillBoundary(geom[lev].periodicity());
U_new.FillBoundary(geom[lev].periodicity());
V_old.FillBoundary(geom[lev].periodicity());
V_new.FillBoundary(geom[lev].periodicity());
mf_W.FillBoundary(geom[lev].periodicity());
FillPatch(lev, time, *cons_old[lev], cons_old);
FillPatch(lev, time, *xvel_old[lev], xvel_old);
FillPatch(lev, time, *yvel_old[lev], yvel_old);

S_old.FillBoundary(geom[lev].periodicity());
S_new.FillBoundary(geom[lev].periodicity());
FillPatch(lev, time, *cons_new[lev], cons_new);
FillPatch(lev, time, *xvel_new[lev], xvel_new);
FillPatch(lev, time, *yvel_new[lev], yvel_new);

mf_rw.setVal(0.0);
mf_W.setVal(0.0);
U_old.FillBoundary(geom[lev].periodicity());
V_old.FillBoundary(geom[lev].periodicity());
mf_rufrc->setVal(0);
mf_rvfrc->setVal(0);

Expand Down Expand Up @@ -237,7 +230,10 @@ ROMSX::setup_step (int lev, Real time, Real dt_lev)
rho_eos(gbx2,state_old,rho,rhoA,rhoS,Hz,z_w,h,N);
}

if(solverChoice.use_prestep) {
MultiFab mf_W(ba,dm,1,IntVect(NGROW+1,NGROW+1,0));
mf_W.setVal(0.0);

if (solverChoice.use_prestep) {
const int nnew = 0;
prestep(lev, U_old, V_old, U_new, V_new,
mf_ru, mf_rv,
Expand All @@ -246,7 +242,7 @@ ROMSX::setup_step (int lev, Real time, Real dt_lev)
mf_bvstr, iic, ntfirst, nnew, nstp, nrhs, N, dt_lev);
}


// We use FillBoundary not FillPatch here since mf_W is single-level scratch space
mf_W.FillBoundary(geom[lev].periodicity());

for ( MFIter mfi(S_old, TilingIfNotGPU()); mfi.isValid(); ++mfi )
Expand Down Expand Up @@ -436,12 +432,12 @@ ROMSX::setup_step (int lev, Real time, Real dt_lev)
// Update Akv with new depth. NOTE: this happens before set_zeta in ROMS
set_vmix(lev);

S_old.FillBoundary(geom[lev].periodicity());
S_new.FillBoundary(geom[lev].periodicity());
FillPatch(lev, time, *cons_old[lev], cons_old);
FillPatch(lev, time, *cons_new[lev], cons_new);

vec_t3[lev]->FillBoundary(geom[lev].periodicity());
vec_s3[lev]->FillBoundary(geom[lev].periodicity());
FillPatch(lev, time, *vec_t3[lev], GetVecOfPtrs(vec_t3));
FillPatch(lev, time, *vec_s3[lev], GetVecOfPtrs(vec_s3));

vec_Huon[lev]->FillBoundary(geom[lev].periodicity());
vec_Hvom[lev]->FillBoundary(geom[lev].periodicity());
FillPatch(lev, time, *vec_Huon[lev], GetVecOfPtrs(vec_Huon));
FillPatch(lev, time, *vec_Hvom[lev], GetVecOfPtrs(vec_Hvom));
}

0 comments on commit b432f69

Please sign in to comment.