1#ifndef _REMORA_STRETCH_H_
2#define _REMORA_STRETCH_H_
29 int nz =
geom[0].Domain().length(2);
34 Box
bx(IntVect(0,0,0),IntVect(0,0,
N));
114 Box
bx =
mfi.tilebox();
124 wgbx3.surroundingNodes(2);
128 int nz =
geom[
lev].Domain().length(2);
143 Gpu::streamSynchronize();
154 z_w(
i,
j,0) =
h(
i,
j,0,1);
167 Gpu::streamSynchronize();
209 int ii = std::min(std::max(
i ,
lo.x),
hi.x);
210 int im = std::min(std::max(
i-1,
lo.x),
hi.x);
211 int jj = std::min(std::max(
j ,
lo.y),
hi.y);
212 int jm = std::min(std::max(
j-1,
lo.y),
hi.y);
244 BL_PROFILE(
"REMORA::stretch_transform_full_domain()");
249 const int N =
geom[
lev].Domain().length(2);
251 const Real
ds =
one / Real(
N);
255 const Box&
wbx =
mfi.growntilebox();
264 z_w(
i,
j,
k) =
stretched_depth(
ds*(
k-
N),
Cs_w_dat[
k],
hc,
h(
i,
j,0), zeta(
i,
j,0));
268 z_w(
i,
j,
N) = zeta(
i,
j,0);
272 Gpu::streamSynchronize();
constexpr amrex::Real two
constexpr amrex::Real one
constexpr amrex::Real zero
mf_h setVal(geomdata.ProbHi(2))
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_h
multilevel data container for current step's z velocities (largely unused; W stored separately)
amrex::Vector< amrex::MultiFab * > cons_new
multilevel data container for current step's scalar data: temperature, salinity, passive tracer
void stretch_transform(int lev)
Calculate vertical stretched coordinates.
amrex::Gpu::DeviceVector< amrex::Real > s_w
Scaled vertical coordinate (range [0,1]) that transforms to z, defined at w-points (cell faces)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Hz
Width of cells in the vertical (z-) direction (3D, Hz in ROMS)
amrex::Gpu::DeviceVector< amrex::Real > s_r
Scaled vertical coordinate (range [0,1]) that transforms to z, defined at rho points (cell centers)
void stretch_transform_full_domain(int lev, const amrex::MultiFab &mf_h, const amrex::MultiFab &mf_zeta, amrex::MultiFab &mf_z_r, amrex::MultiFab &mf_z_w)
Calculate z_r and z_w on full-domain arrays at a level not yet created.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_z_r
z coordinates at rho points (cell centers)
void calc_stretch_coeffs()
calculate vertical stretch coefficients
amrex::Gpu::DeviceVector< amrex::Real > Cs_r
Stretching coefficients at rho points.
static SolverChoice solverChoice
Container for algorithmic choices.
amrex::Gpu::DeviceVector< amrex::Real > Cs_w
Stretching coefficients at w points.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_z_phys_nd
z coordinates at psi points (cell nodes)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Zt_avg1
Average of the free surface, zeta (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_z_w
z coordinates at w points (faces between z-cells)