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

Method fillLevelSet

Src/EB/AMReX_EB2_Level.cpp:906–943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

904}
905
906void
907Level::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
945void
946Level::fillCutCellMask (iMultiFab& cutcellmask, const Geometry&) const

Callers 3

FillSignedDistanceFunction · 0.80
EBDataCollectionMethod · 0.80
prepareForCoarseningMethod · 0.80

Calls 10

periodicityMethod · 0.80
shiftIntVectMethod · 0.80
intersectionsMethod · 0.80
setValMethod · 0.45
ParallelCopyMethod · 0.45
nGrowVectMethod · 0.45
emptyMethod · 0.45
isValidMethod · 0.45
arrayMethod · 0.45
fabboxMethod · 0.45

Tested by

no test coverage detected