From 727f52e749be64aa01d231468ef39dddd566e369 Mon Sep 17 00:00:00 2001 From: zhi Date: Mon, 18 Nov 2024 13:13:21 -0500 Subject: [PATCH] fix compile --- Source/hydro/Castro_mol_hydro.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/hydro/Castro_mol_hydro.cpp b/Source/hydro/Castro_mol_hydro.cpp index e1d06fc4b1..0772b71b79 100644 --- a/Source/hydro/Castro_mol_hydro.cpp +++ b/Source/hydro/Castro_mol_hydro.cpp @@ -657,16 +657,12 @@ Castro::construct_mol_hydro_source(Real time, Real dt, MultiFab& A_update) if (!Geom().IsCartesian()) { pradial.resize(xbx, 1); } - - Array4 pradial_fab = pradial.array(); #endif #if AMREX_SPACEDIM == 2 if (Geom().IsSPHERICAL()) { ptheta.resize(ybx, 1); } - - Array4 ptheta_fab = ptheta.array(); #endif for (int idir = 0; idir < AMREX_SPACEDIM; ++idir) { @@ -682,26 +678,28 @@ Castro::construct_mol_hydro_source(Real time, Real dt, MultiFab& A_update) // get the scaled radial pressure -- we need to treat this specially if (idir == 0 && !mom_flux_has_p(0, 0, coord)) { + Array4 pradial_fab = pradial.array(); Array4 const qex_arr = qe[idir].array(); amrex::ParallelFor(nbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { - pradial_fab(i,j,k) = area_arr(i,j,k) * qex_fab(i,j,k,GDPRES) * dt; + pradial_fab(i,j,k) = area_arr(i,j,k) * qex_arr(i,j,k,GDPRES) * dt; }); } #endif #if AMREX_SPACEDIM == 2 - if (idir == 1 && !mom_flux_has_p(1, 1, coord)) { - // get the scaled pressure in the theta direction + // get the scaled pressure in the theta direction - Array4 const qey_fab = qe[idir].array(); + if (idir == 1 && !mom_flux_has_p(1, 1, coord)) { + Array4 ptheta_fab = ptheta.array(); + Array4 const qey_arr = qe[idir].array(); amrex::ParallelFor(nbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { - ptheta_fab(i,j,k) = area_arr(i,j,k) * qey_fab(i,j,k,GDPRES) * dt; + ptheta_fab(i,j,k) = area_arr(i,j,k) * qey_arr(i,j,k,GDPRES) * dt; }); } #endif @@ -734,6 +732,7 @@ Castro::construct_mol_hydro_source(Real time, Real dt, MultiFab& A_update) #if AMREX_SPACEDIM <= 2 if (!Geom().IsCartesian()) { + Array4 pradial_fab = pradial.array(); Array4 P_radial_fab = P_radial.array(mfi); const Real scale = stage_weight; @@ -748,6 +747,7 @@ Castro::construct_mol_hydro_source(Real time, Real dt, MultiFab& A_update) #if AMREX_SPACEDIM == 2 if (Geom().IsSPHERICAL()) { + Array4 ptheta_fab = ptheta.array(); Array4 P_theta_fab = P_theta.array(mfi); const Real scale = stage_weight;