REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticBathymetry_Seamount.H
Go to the documentation of this file.
1 mf_h.setVal(geom.ProbHi(2));
2
3 for ( MFIter mfi(mf_h, TilingIfNotGPU()); mfi.isValid(); ++mfi )
4 {
5
6 Array4<Real> const& h = (mf_h).array(mfi);
7
8 Box bx = mfi.tilebox();
9 // Grow to whatever the target actually has: with hires_grid_level this fab is
10 // vec_h_full_domain, whose grow cells are max(cum_ref_ratios[lev], NGROW+1).
11 Box gbx2 = grow(bx,mf_h.nGrowVect());
12
13 amrex::Real Xsize = Real(320000.0);
14 amrex::Real Esize = Real(320000.0);
15 amrex::Real depth = Real(5000.0);
16
17 ParallelFor(makeSlab(gbx2,2,0), [=] AMREX_GPU_DEVICE (int i, int j, int)
18 {
19 const auto prob_lo = geomdata.ProbLo();
20 const auto dx = geomdata.CellSize();
21
22 const Real x = prob_lo[0] + (i + Real(0.5)) * dx[0];
23 const Real y = prob_lo[1] + (j + Real(0.5)) * dx[1];
24
25 Real val1, val2;
26 val1 = (x-Real(0.5)*Xsize)/Real(40000.0);
27 val2 = (y-Real(0.5)*Esize)/Real(40000.0);
28 h(i,j,0) = depth - Real(4500.0) * std::exp(-(val1*val1+val2*val2));
29 });
30 }
mf_h setVal(geom.ProbHi(2))