Skip to content

Commit

Permalink
calculate harmonic viscosity on a larger box
Browse files Browse the repository at this point in the history
  • Loading branch information
hklion committed Sep 12, 2023
1 parent 88799a1 commit dd03bfd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Source/TimeIntegration/ROMSX_uv3dmix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ ROMSX::uv3dmix (const Box& bx,

Box gbx2 = bx;
gbx2.grow(IntVect(NGROW,NGROW,0));
// This might need to be done with a grown tilebox instead
Box gbx1 = bx;
gbx1.grow(IntVect(NGROW-1,NGROW-1,0));
int ncomp = 1;

FArrayBox fab_UFx(gbx2,1,amrex::The_Async_Arena());
Expand All @@ -48,7 +51,7 @@ ROMSX::uv3dmix (const Box& bx,
//DO j=JstrV-1,Jend
//DO i=IstrU-1,Iend
// Should these be on ubox/vbox?
amrex::ParallelFor(bx, ncomp,
amrex::ParallelFor(gbx1, ncomp,
[=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
{
// cff depends on k, but UFx and VFe will only be affected by the last cell?
Expand All @@ -66,7 +69,7 @@ ROMSX::uv3dmix (const Box& bx,
//K_LOOP : DO k=1,N(ng)
//DO j=Jstr,Jend+1
//DO i=Istr,Iend+1
amrex::ParallelFor(bx, ncomp,
amrex::ParallelFor(gbx1, ncomp,
[=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
{
//printf("%d %d %d %15.15g %15.15g %15.15g %15.15g\n",i,j,k,Hz(i-1,j,k),Hz(i,j,k),Hz(i-1,j-1,k),Hz(i,j-1,k));
Expand All @@ -90,7 +93,7 @@ ROMSX::uv3dmix (const Box& bx,
//K_LOOP : DO k=1,N(ng)
//DO j=Jstr,Jend
//DO i=IstrU,Iend
amrex::ParallelFor(bx, ncomp,
amrex::ParallelFor(gbx1, ncomp,
[=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
{
const amrex::Real cff=dt_lev*0.25*(pm(i-1,j,0)+pm(i,j,0))*(pn(i-1,j,0)+pn(i,j,0));
Expand All @@ -112,7 +115,7 @@ ROMSX::uv3dmix (const Box& bx,
//K_LOOP : DO k=1,N(ng)
//DO j=JstrV,Jend
//DO i=Istr,Iend
amrex::ParallelFor(bx, ncomp,
amrex::ParallelFor(gbx1, ncomp,
[=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
{
const amrex::Real cff=dt_lev*0.25*(pm(i,j,0)+pm(i,j-1,0))*(pn(i,j,0)+pn(i,j-1,0));
Expand Down

0 comments on commit dd03bfd

Please sign in to comment.