REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_BoundaryConditions_cons.cpp
Go to the documentation of this file.
1#include "AMReX_PhysBCFunct.H"
3
4using namespace amrex;
5
6/**
7 * @param[inout] dest_arr data on which to apply BCs
8 * @param[in ] bx box to update on
9 * @param[in ] valid_bx valid box
10 * @param[in ] domain domain box
11 * @param[in ] dxInv pm or pn
12 * @param[in ] mskr land-sea mask on rho-points
13 * @param[in ] msku land-sea mask on u-points
14 * @param[in ] mskv land-sea mask on v-points
15 * @param[in ] calc_arr_in data to use in the RHS of calculations
16 * @param[in ] icomp component to update
17 * @param[in ] ncomp number of components to update, starting from icomp
18 * @param[in ] time current time
19 * @param[in ] bccomp index into both domain_bcs_type_bcr and bc_extdir_vals for icomp=0
20 * @param[in ] n_not_fill perimter of cells in x and y where BCs are not applied for non-ext_dir conditions
21 */
22void REMORAPhysBCFunct::impose_cons_bcs (const Array4<Real>& dest_arr, const Box& bx, const Box& valid_bx, const Box& domain,
26 int icomp, int ncomp, Real /*time*/, int bccomp, int n_not_fill)
27{
28 BL_PROFILE_VAR("impose_cons_bcs()",impose_cons_bcs);
29 const auto& dom_lo = amrex::lbound(domain);
30 const auto& dom_hi = amrex::ubound(domain);
31
32 // Based on BCRec for the domain, we need to make BCRec for this Box
33 // bccomp is used as starting index for m_domain_bcs_type
34 // 0 is used as starting index for bcrs
36 amrex::setBC(bx, domain, bccomp, 0, ncomp, m_domain_bcs_type, bcrs);
37
38 // xlo: ori = 0
39 // ylo: ori = 1
40 // zlo: ori = 2
41 // xhi: ori = 3
42 // yhi: ori = 4
43 // zhi: ori = 5
44
45 amrex::Gpu::DeviceVector<BCRec> bcrs_d(ncomp);
46#ifdef AMREX_USE_GPU
47 Gpu::htod_memcpy_async(bcrs_d.data(), bcrs.data(), sizeof(BCRec)*ncomp);
48#else
49 std::memcpy(bcrs_d.data(), bcrs.data(), sizeof(BCRec)*ncomp);
50#endif
51 const amrex::BCRec* bc_ptr = bcrs_d.data();
52 const auto* bc_extdir_vals_ptr = m_bc_extdir_vals_d.data();
53
54 GeometryData const& geomdata = m_geom.data();
55 bool is_periodic_in_x = geomdata.isPeriodic(0);
56 bool is_periodic_in_y = geomdata.isPeriodic(1);
57 const Real eps= Real(1.0e-20);
58 // If calc_arr isn't passed in, we actually just want to use dest_arr values instead.
59 // That matches ROMS.
61
62 // If we're doing zeta, then calc_arr only has a single component
63 // corresponding to the component to be used in calculating the boundary
64 // value. If it's another variable, either we aren't using calc_arr
65 // or the components correspond to salt, temp, etc and we loop over ncomp
66 // so we leave icomp as is
68
69 Box dest_arr_box = Box(dest_arr);
70 // First do all ext_dir bcs
72 {
73 Box bx_xlo(bx); bx_xlo.setBig (0,dom_lo.x-1);
74 bx_xlo.setSmall(1,std::max(valid_bx.smallEnd(1)-1,dom_lo.y)); bx_xlo.setBig(1,std::min(valid_bx.bigEnd(1)+1,dom_hi.y));
75 Box bx_xhi(bx); bx_xhi.setSmall(0,dom_hi.x+1);
76 bx_xhi.setSmall(1,std::max(valid_bx.smallEnd(1)-1,dom_lo.y)); bx_xhi.setBig(1,std::min(valid_bx.bigEnd(1)+1,dom_hi.y));
78 bx_xlo & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
79 if (bc_ptr[n].lo(0) == REMORABCType::ext_dir) {
80 dest_arr(i,j,k,icomp+n) = bc_extdir_vals_ptr[bccomp+n][0] * mskr(i,j,0);
81 } else if (bc_ptr[n].lo(0) == REMORABCType::orlanski_rad) {
82 Real grad_lo = (calc_arr(dom_lo.x ,j ,k,icomp_calc+n) - calc_arr(dom_lo.x ,j-1,k,icomp_calc+n)) * mskv(dom_lo.x,j ,0);
83 Real grad_lo_jp1 = (calc_arr(dom_lo.x ,j+1,k,icomp_calc+n) - calc_arr(dom_lo.x ,j ,k,icomp_calc+n)) * mskv(dom_lo.x,j+1,0);
84 Real dTdt = calc_arr(dom_lo.x,j,k,icomp_calc+n) - dest_arr(dom_lo.x ,j,k,icomp+n);
85 Real dTdx = dest_arr(dom_lo.x,j,k,icomp+n) - dest_arr(dom_lo.x+1,j,k,icomp+n);
86 if (dTdt*dTdx < zero) dTdt = zero;
88 Real cff = std::max(dTdx*dTdx+dTde*dTde,eps);
89 Real Cx = dTdt * dTdx;
90 dest_arr(i,j,k,icomp+n) = (cff * calc_arr(dom_lo.x-1,j,k,icomp_calc+n) + Cx * dest_arr(dom_lo.x,j,k,icomp+n)) * mskr(i,j,0) / (cff+Cx);
91 }
92 },
93 bx_xhi & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
94 if (bc_ptr[n].hi(0) == REMORABCType::ext_dir) {
95 dest_arr(i,j,k,icomp+n) = bc_extdir_vals_ptr[bccomp+n][3] * mskr(i,j,0);
96 } else if (bc_ptr[n].hi(0) == REMORABCType::orlanski_rad) {
97 Real grad_hi = (calc_arr(dom_hi.x ,j ,k,icomp_calc+n) - calc_arr(dom_hi.x ,j-1,k,icomp_calc+n)) * mskv(dom_hi.x,j ,0);
98 Real grad_hi_jp1 = (calc_arr(dom_hi.x ,j+1,k,icomp_calc+n) - calc_arr(dom_hi.x ,j ,k,icomp_calc+n)) * mskv(dom_hi.x,j+1,0);
99 Real dTdt = calc_arr(dom_hi.x,j,k,icomp_calc+n) - dest_arr(dom_hi.x ,j,k,icomp+n);
100 Real dTdx = dest_arr(dom_hi.x,j,k,icomp+n) - dest_arr(dom_hi.x-1,j,k,icomp+n);
101 if (dTdt * dTdx < zero) dTdt = zero;
102 Real dTde = (dTdt * (grad_hi + grad_hi_jp1) > zero) ? grad_hi : grad_hi_jp1;
103 Real cff = std::max(dTdx*dTdx + dTde*dTde,eps);
104 Real Cx = dTdt * dTdx;
105 dest_arr(i,j,k,icomp+n) = (cff * calc_arr(dom_hi.x+1,j,k,icomp_calc+n) + Cx * dest_arr(dom_hi.x,j,k,icomp+n)) * mskr(i,j,0) / (cff+Cx);
106 }
107 }
108 );
109 }
110
111 if (!is_periodic_in_y)
112 {
113 Box bx_ylo(bx); bx_ylo.setBig (1,dom_lo.y-1);
114 bx_ylo.setSmall(0,std::max(valid_bx.smallEnd(0)-1,dom_lo.x)); bx_ylo.setBig(0,std::min(valid_bx.bigEnd(0)+1,dom_hi.x));
115 Box bx_yhi(bx); bx_yhi.setSmall(1,dom_hi.y+1);
116 bx_yhi.setSmall(0,std::max(valid_bx.smallEnd(0)-1,dom_lo.x)); bx_yhi.setBig(0,std::min(valid_bx.bigEnd(0)+1,dom_hi.x));
118 bx_ylo & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
119 if (bc_ptr[n].lo(1) == REMORABCType::ext_dir) {
120 dest_arr(i,j,k,icomp+n) = bc_extdir_vals_ptr[bccomp+n][1] * mskr(i,j,0);
121 } else if (bc_ptr[n].lo(1) == REMORABCType::orlanski_rad) {
122 Real grad_lo = (calc_arr(i ,dom_lo.y, k,icomp_calc+n) - calc_arr(i-1,dom_lo.y ,k,icomp_calc+n)) * msku(i ,dom_lo.y,0);
123 Real grad_lo_ip1 = (calc_arr(i+1,dom_lo.y ,k,icomp_calc+n) - calc_arr(i ,dom_lo.y ,k,icomp_calc+n)) * msku(i+1,dom_lo.y,0);
124 Real dTdt = calc_arr(i,dom_lo.y,k,icomp_calc+n) - dest_arr(i,dom_lo.y ,k,icomp+n);
125 Real dTde = dest_arr(i,dom_lo.y,k,icomp+n) - dest_arr(i,dom_lo.y+1,k,icomp+n);
126 if (dTdt * dTde < zero) dTdt = zero;
127 Real dTdx = (dTdt * (grad_lo + grad_lo_ip1) > zero) ? grad_lo : grad_lo_ip1;
128 Real cff = std::max(dTdx*dTdx + dTde*dTde, eps);
129 Real Ce = dTdt*dTde;
130 dest_arr(i,j,k,icomp+n) = (cff * calc_arr(i,dom_lo.y-1,k,icomp_calc+n) + Ce * dest_arr(i,dom_lo.y,k,icomp+n)) * mskr(i,j,0) / (cff+Ce);
131 }
132 },
133 bx_yhi & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
134 if (bc_ptr[n].hi(1) == REMORABCType::ext_dir) {
135 dest_arr(i,j,k,icomp+n) = bc_extdir_vals_ptr[bccomp+n][4] * mskr(i,j,0);
136 } else if (bc_ptr[n].hi(1) == REMORABCType::orlanski_rad) {
137 Real grad_hi = (calc_arr(i ,dom_hi.y ,k,icomp_calc+n) - calc_arr(i-1,dom_hi.y ,k,icomp_calc+n)) * msku(i ,dom_hi.y,0);
138 Real grad_hi_ip1 = (calc_arr(i+1,dom_hi.y ,k,icomp_calc+n) - calc_arr(i ,dom_hi.y ,k,icomp_calc+n)) * msku(i+1,dom_hi.y,0);
139 Real dTdt = calc_arr(i,dom_hi.y,k,icomp_calc+n) - dest_arr(i,dom_hi.y ,k,icomp+n);
140 Real dTde = dest_arr(i,dom_hi.y,k,icomp+n) - dest_arr(i,dom_hi.y-1,k,icomp+n);
141 if (dTdt * dTde < zero) dTdt = zero;
142 Real dTdx = (dTdt * (grad_hi + grad_hi_ip1) > zero) ? grad_hi : grad_hi_ip1;
143 Real cff = std::max(dTdx*dTdx + dTde*dTde, eps);
144 Real Ce = dTdt*dTde;
145 dest_arr(i,j,k,icomp+n) = (cff*calc_arr(i,dom_hi.y+1,k,icomp_calc+n) + Ce*dest_arr(i,dom_hi.y,k,icomp+n)) * mskr(i,j,0) / (cff+Ce);
146 }
147 }
148 );
149 }
150
151 {
152 Box bx_zlo(bx); bx_zlo.setBig (2,dom_lo.z-1);
153 Box bx_zhi(bx); bx_zhi.setSmall(2,dom_hi.z+1);
155 bx_zlo & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
156 if (bc_ptr[n].lo(2) == REMORABCType::ext_dir) {
157 dest_arr(i,j,k,icomp+n) = bc_extdir_vals_ptr[bccomp+n][2] * mskr(i,j,0);
158 }
159 },
160 bx_zhi & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
161 if (bc_ptr[n].hi(2) == REMORABCType::ext_dir) {
162 dest_arr(i,j,k,icomp+n) = bc_extdir_vals_ptr[bccomp+n][5] * mskr(i,j,0);
163 }
164 }
165 );
166 }
167
168 Box bx_xlo(bx); bx_xlo.setBig (0,dom_lo.x-1-n_not_fill);
169 bx_xlo.setSmall(2,std::max(dom_lo.z,bx.smallEnd(2)));
170 bx_xlo.setBig (2,std::min(dom_hi.z,bx.bigEnd(2)));
171 Box bx_xhi(bx); bx_xhi.setSmall(0,dom_hi.x+1+n_not_fill);
172 bx_xhi.setSmall(2,std::max(dom_lo.z,bx.smallEnd(2)));
173 bx_xhi.setBig (2,std::min(dom_hi.z,bx.bigEnd(2)));
174 Box bx_ylo(bx); bx_ylo.setBig (1,dom_lo.y-1-n_not_fill);
175 bx_ylo.setSmall(2,std::max(dom_lo.z,bx.smallEnd(2)));
176 bx_ylo.setBig (2,std::min(dom_hi.z,bx.bigEnd(2)));
177 Box bx_yhi(bx); bx_yhi.setSmall(1,dom_hi.y+1+n_not_fill);
178 bx_yhi.setSmall(2,std::max(dom_lo.z,bx.smallEnd(2)));
179 bx_yhi.setBig (2,std::min(dom_hi.z,bx.bigEnd(2)));
180 // Calculate intersections for corners before adjusting to exclude them
181 Box xlo_ylo = bx_xlo & bx_ylo;
182 Box xhi_ylo = bx_xhi & bx_ylo;
183 Box xlo_yhi = bx_xlo & bx_yhi;
184 Box xhi_yhi = bx_xhi & bx_yhi;
185// bx_xlo.setSmall(1,valid_bx.smallEnd(1)); bx_xlo.setBig(1,valid_bx.bigEnd(1));
186// bx_xhi.setSmall(1,valid_bx.smallEnd(1)); bx_xhi.setBig(1,valid_bx.bigEnd(1));
187// bx_ylo.setSmall(0,valid_bx.smallEnd(0)); bx_ylo.setBig(0,valid_bx.bigEnd(0));
188// bx_yhi.setSmall(0,valid_bx.smallEnd(0)); bx_yhi.setBig(0,valid_bx.bigEnd(0));
189 // ROMS masks the wall values of the tracers and the free surface (t3dbc, zetabc),
190 // but not those of the fields it fills with bc_r2d/bc_r3d, the foextrap types
191 // here. Without the mask, land on the boundary would carry the interior value.
192 const int ncons_wall = m_ncons;
194
195 // Next do ghost cells in x-direction but not reaching out in y
196 // The corners we miss here will be covered in the y-loop below or by periodicity
198 {
199 // Populate ghost cells on lo-x and hi-x domain boundaries
200 ParallelFor(bx_xlo & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
201 const int bcc = bccomp + n;
202 const bool masked = (bcc < ncons_wall || bcc == zeta_bccomp)
203 && mskr.contains(i,j,0);
204 const bool land = masked && mskr(i,j,0) == Real(0.0);
205 int iflip = dom_lo.x - 1 - i;
206 int inner = (bc_ptr[n].lo(0) == REMORABCType::orlanski_rad) ? 1 : 0;
209 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : dest_arr(dom_lo.x-n_not_fill-inner,j,k,icomp+n);
210 } else if (bc_ptr[n].lo(0) == REMORABCType::reflect_even) {
211 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : dest_arr(iflip,j,k,icomp+n);
212 } else if (bc_ptr[n].lo(0) == REMORABCType::reflect_odd) {
213 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : -dest_arr(iflip,j,k,icomp+n);
214 }
215 },
216 bx_xhi & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
217 const int bcc = bccomp + n;
218 const bool masked = (bcc < ncons_wall || bcc == zeta_bccomp)
219 && mskr.contains(i,j,0);
220 const bool land = masked && mskr(i,j,0) == Real(0.0);
221 int iflip = 2*dom_hi.x + 1 - i;
222 int inner = (bc_ptr[n].hi(0) == REMORABCType::orlanski_rad) ? 1 : 0;
225 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : dest_arr(dom_hi.x+n_not_fill+inner,j,k,icomp+n);
226 } else if (bc_ptr[n].hi(0) == REMORABCType::reflect_even) {
227 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : dest_arr(iflip,j,k,icomp+n);
228 } else if (bc_ptr[n].hi(0) == REMORABCType::reflect_odd) {
229 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : -dest_arr(iflip,j,k,icomp+n);
230 }
231 }
232 );
233 }
234
236 {
237 // Populate ghost cells on lo-y and hi-y domain boundaries
239 bx_ylo & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
240 const int bcc = bccomp + n;
241 const bool masked = (bcc < ncons_wall || bcc == zeta_bccomp)
242 && mskr.contains(i,j,0);
243 const bool land = masked && mskr(i,j,0) == Real(0.0);
244 int jflip = dom_lo.y - 1 - j;
245 int inner = (bc_ptr[n].lo(1) == REMORABCType::orlanski_rad) ? 1 : 0;
248 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : dest_arr(i,dom_lo.y-n_not_fill-inner,k,icomp+n);
249 } else if (bc_ptr[n].lo(1) == REMORABCType::reflect_even) {
250 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : dest_arr(i,jflip,k,icomp+n);
251 } else if (bc_ptr[n].lo(1) == REMORABCType::reflect_odd) {
252 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : -dest_arr(i,jflip,k,icomp+n);
253 }
254 },
255 bx_yhi & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
256 const int bcc = bccomp + n;
257 const bool masked = (bcc < ncons_wall || bcc == zeta_bccomp)
258 && mskr.contains(i,j,0);
259 const bool land = masked && mskr(i,j,0) == Real(0.0);
260 int jflip = 2*dom_hi.y + 1 - j;
261 int inner = (bc_ptr[n].hi(1) == REMORABCType::orlanski_rad) ? 1 : 0;
264 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : dest_arr(i,dom_hi.y+n_not_fill+inner,k,icomp+n);
265 } else if (bc_ptr[n].hi(1) == REMORABCType::reflect_even) {
266 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : dest_arr(i,jflip,k,icomp+n);
267 } else if (bc_ptr[n].hi(1) == REMORABCType::reflect_odd) {
268 dest_arr(i,j,k,icomp+n) = land ? Real(0.0) : -dest_arr(i,jflip,k,icomp+n);
269 }
270 }
271 );
272 }
273
274 {
275 Box bx_zlo(bx); bx_zlo.setBig (2,std::max(dom_lo.z-1,bx.smallEnd(2)));
276 Box bx_zhi(bx); bx_zhi.setSmall(2,std::min(dom_hi.z+1,bx.bigEnd(2)));
277 // Populate ghost cells on lo-z and hi-z domain boundaries
278
279 if (bx_zlo.ok()) {
280 ParallelFor(bx_zlo & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
281 {
282 int kflip = dom_lo.z - 1 - k;
283 if (bc_ptr[n].lo(2) == REMORABCType::foextrap) {
284 dest_arr(i,j,k,icomp+n) = dest_arr(i,j,dom_lo.z,icomp+n);
285 } else if (bc_ptr[n].lo(2) == REMORABCType::reflect_even) {
286 dest_arr(i,j,k,icomp+n) = dest_arr(i,j,kflip,icomp+n);
287 } else if (bc_ptr[n].lo(2) == REMORABCType::reflect_odd) {
288 dest_arr(i,j,k,icomp+n) = -dest_arr(i,j,kflip,icomp+n);
289 }
290 });
291 }
292
293 if (bx_zhi.ok()) {
294 ParallelFor(bx_zhi & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
295 {
296 int kflip = 2*dom_hi.z + 1 - k;
297 if (bc_ptr[n].hi(2) == REMORABCType::foextrap) {
298 dest_arr(i,j,k,icomp+n) = dest_arr(i,j,dom_hi.z,icomp+n);
299 } else if (bc_ptr[n].hi(2) == REMORABCType::reflect_even) {
300 dest_arr(i,j,k,icomp+n) = dest_arr(i,j,kflip,icomp+n);
301 } else if (bc_ptr[n].hi(2) == REMORABCType::reflect_odd) {
302 dest_arr(i,j,k,icomp+n) = -dest_arr(i,j,kflip,icomp+n);
303 }
304 });
305 }
306 }
308 // If we've applied boundary conditions to either side, update the corner
309 if (!xlo_ylo.isEmpty()) {
310 ParallelFor(xlo_ylo & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
311 {
312 if (!(bc_ptr[n].lo(0) == REMORABCType::clamped || bc_ptr[n].lo(0) == REMORABCType::flather ||
314 && !(bc_ptr[n].lo(1) == REMORABCType::clamped || bc_ptr[n].lo(1) == REMORABCType::flather ||
316 dest_arr(i,j,k,icomp+n) = Real(0.5) * (dest_arr(i,dom_lo.y,k,icomp+n)
317 + dest_arr(dom_lo.x,j,k,icomp+n));
318 }
319 });
320 }
321 if (!xlo_yhi.isEmpty()) {
322 ParallelFor(xlo_yhi & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
323 {
324 if (!(bc_ptr[n].lo(0) == REMORABCType::clamped || bc_ptr[n].lo(0) == REMORABCType::flather ||
326 && !(bc_ptr[n].hi(1) == REMORABCType::clamped || bc_ptr[n].hi(1) == REMORABCType::flather ||
328 dest_arr(i,j,k,icomp+n) = Real(0.5) * (dest_arr(i,dom_hi.y,k,icomp+n)
329 + dest_arr(dom_lo.x,j,k,icomp+n));
330 }
331 });
332 }
333 if (!xhi_ylo.isEmpty()) {
334 ParallelFor(xhi_ylo & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
335 {
336 if (!(bc_ptr[n].hi(0) == REMORABCType::clamped || bc_ptr[n].hi(0) == REMORABCType::flather ||
338 && !(bc_ptr[n].lo(1) == REMORABCType::clamped || bc_ptr[n].lo(1) == REMORABCType::flather ||
340 dest_arr(i,j,k,icomp+n) = Real(0.5) * (dest_arr(i,dom_lo.y,k,icomp+n)
341 + dest_arr(dom_hi.x,j,k,icomp+n));
342 }
343 });
344 }
345 if (!xhi_yhi.isEmpty()) {
346 ParallelFor(xhi_yhi & dest_arr_box, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
347 {
348 if (!(bc_ptr[n].hi(0) == REMORABCType::clamped || bc_ptr[n].hi(0) == REMORABCType::flather ||
350 && !(bc_ptr[n].hi(1) == REMORABCType::clamped || bc_ptr[n].hi(1) == REMORABCType::flather ||
352 dest_arr(i,j,k,icomp+n) = Real(0.5) * (dest_arr(i,dom_hi.y,k,icomp+n)
353 + dest_arr(dom_hi.x,j,k,icomp+n));
354 }
355 });
356 }
357 }
358
359 Gpu::streamSynchronize();
360}
constexpr amrex::Real zero
mf_h setVal(geomdata.ProbHi(2))
amrex::Vector< amrex::BCRec > m_domain_bcs_type
void impose_cons_bcs(const amrex::Array4< amrex::Real > &mf, const amrex::Box &bx, const amrex::Box &valid_bx, const amrex::Box &domain, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, const amrex::Array4< const amrex::Real > &mskr, const amrex::Array4< const amrex::Real > &msku, const amrex::Array4< const amrex::Real > &mskv, const amrex::Array4< const amrex::Real > &calc_arr, int icomp, int ncomp, amrex::Real time, int bccomp, int n_not_fill)
apply scalar type boundary conditions
amrex::Geometry m_geom
amrex::Gpu::DeviceVector< amrex::GpuArray< amrex::Real, AMREX_SPACEDIM *2 > > m_bc_extdir_vals_d
int foextrap_bc(int ncons) noexcept
int zeta_bc(int ncons) noexcept