MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / updateIntercept

Method updateIntercept

Src/EB/AMReX_EB_STL_utils.cpp:1273–1328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1271}
1272
1273void
1274STLtools::updateIntercept (Array<Array4<Real>,AMREX_SPACEDIM> const& inter_arr,
1275 Array<Array4<EB2::Type_t const>,AMREX_SPACEDIM> const& type_arr,
1276 Array4<Real const> const& lst, Geometry const& geom)
1277{
1278 auto const& dx = geom.CellSizeArray();
1279 auto const& problo = geom.ProbLoArray();
1280 for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
1281 Array4<Real> const& inter = inter_arr[idim];
1282 Array4<EB2::Type_t const> const& type = type_arr[idim];
1283 const Box bx{inter};
1284 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k)
1285 {
1286 if (type(i,j,k) == EB2::Type::irregular) {
1287 bool is_nan = amrex::isnan(inter(i,j,k));
1288 if (idim == 0) {
1289 if (lst(i,j,k) == Real(0.0) ||
1290 (lst(i,j,k) > Real(0.0) && is_nan))
1291 {
1292 // interp might still be quiet_nan because lst that
1293 // was set to zero has been changed by FillBoundary
1294 // at periodic boundaries.
1295 inter(i,j,k) = problo[0] + static_cast<Real>(i)*dx[0];
1296 }
1297 else if (lst(i+1,j,k) == Real(0.0) ||
1298 (lst(i+1,j,k) > Real(0.0) && is_nan))
1299 {
1300 inter(i,j,k) = problo[0] + static_cast<Real>(i+1)*dx[0];
1301 }
1302 } else if (idim == 1) {
1303 if (lst(i,j,k) == Real(0.0) ||
1304 (lst(i,j,k) > Real(0.0) && is_nan))
1305 {
1306 inter(i,j,k) = problo[1] + static_cast<Real>(j)*dx[1];
1307 }
1308 else if (lst(i,j+1,k) == Real(0.0) ||
1309 (lst(i,j+1,k) > Real(0.0) && is_nan))
1310 {
1311 inter(i,j,k) = problo[1] + static_cast<Real>(j+1)*dx[1];
1312 }
1313 } else {
1314 if (lst(i,j,k) == Real(0.0) ||
1315 (lst(i,j,k) > Real(0.0) && is_nan))
1316 {
1317 inter(i,j,k) = problo[2] + static_cast<Real>(k)*dx[2];
1318 }
1319 else if (lst(i,j,k+1) == Real(0.0) ||
1320 (lst(i,j,k+1) > Real(0.0) && is_nan))
1321 {
1322 inter(i,j,k) = problo[2] + static_cast<Real>(k+1)*dx[2];
1323 }
1324 }
1325 }
1326 });
1327 }
1328}
1329
1330void

Callers 1

define_fineMethod · 0.45

Calls 3

CellSizeArrayMethod · 0.80
ProbLoArrayMethod · 0.80
ParallelForFunction · 0.50

Tested by

no test coverage detected