| 904 | } |
| 905 | |
| 906 | void |
| 907 | Level::fillLevelSet (MultiFab& levelset, const Geometry& /*geom*/) const |
| 908 | { |
| 909 | levelset.setVal(-1.0); |
| 910 | levelset.ParallelCopy(m_levelset,0,0,1,IntVect(0),levelset.nGrowVect(), |
| 911 | -m_shift, m_geom.periodicity()); |
| 912 | |
| 913 | std::vector<IntVect> pshifts = m_geom.periodicity().shiftIntVect(); |
| 914 | if (m_shift != 0) { |
| 915 | for (auto& pit : pshifts) { pit += m_shift; } |
| 916 | } |
| 917 | |
| 918 | Real cov_val = 1.0; // for covered cells |
| 919 | |
| 920 | #ifdef AMREX_USE_OMP |
| 921 | #pragma omp parallel if (Gpu::notInLaunchRegion()) |
| 922 | #endif |
| 923 | if (!m_covered_grids.empty()) |
| 924 | { |
| 925 | std::vector<std::pair<int,Box> > isects; |
| 926 | for (MFIter mfi(levelset); mfi.isValid(); ++mfi) |
| 927 | { |
| 928 | const auto& lsfab = levelset.array(mfi); |
| 929 | const Box& ccbx = amrex::enclosedCells(mfi.fabbox()); |
| 930 | for (const auto& iv : pshifts) |
| 931 | { |
| 932 | m_covered_grids.intersections(ccbx+iv, isects); |
| 933 | for (const auto& is : isects) { |
| 934 | const Box& fbx = amrex::surroundingNodes(is.second-iv); |
| 935 | AMREX_HOST_DEVICE_PARALLEL_FOR_3D(fbx, i, j, k, |
| 936 | { |
| 937 | lsfab(i,j,k) = cov_val; |
| 938 | }); |
| 939 | } |
| 940 | } |
| 941 | } |
| 942 | } |
| 943 | } |
| 944 | |
| 945 | void |
| 946 | Level::fillCutCellMask (iMultiFab& cutcellmask, const Geometry&) const |
no test coverage detected