39 void update(
const GridGeometry& gridGeometry)
42 map_.resize(gridGeometry.numScv());
44 auto fvGeometry =
localView(gridGeometry);
45 for (
const auto& element : elements(gridGeometry.gridView()))
47 if (element.partitionType() == Dune::InteriorEntity)
50 assert(element.partitionType() == Dune::OverlapEntity);
53 fvGeometry.bind(element);
55 for (
const auto& scvf : scvfs(fvGeometry))
57 if (scvf.isFrontal() && !scvf.boundary() && !scvf.processorBoundary())
59 const auto& ownScv = fvGeometry.scv(scvf.insideScvIdx());
60 const auto& facet = element.template subEntity <1> (ownScv.indexInElement());
61 if (facet.partitionType() == Dune::BorderEntity)
62 map_[ownScv.index()].push_back(scvf.outsideScvIdx());
67 for (
const auto& element : elements(gridGeometry.gridView(), Dune::Partitions::interior))
69 fvGeometry.bind(element);
72 for (
const auto& scvf : scvfs(fvGeometry))
74 assert(!scvf.processorBoundary());
75 const auto& ownScv = fvGeometry.scv(scvf.insideScvIdx());
76 const auto ownDofIndex = ownScv.dofIndex();
77 const auto ownScvIndex = ownScv.index();
82 map_[ownScvIndex].push_back(scvf.outsideScvIdx());
86 for (
const auto& scv : scvs(fvGeometry))
88 const auto otherDofIndex = scv.dofIndex();
89 if (ownDofIndex != otherDofIndex)
90 map_[scv.index()].push_back(ownScvIndex);
102 if (!scvf.boundary())
103 map_[ownScvIndex].push_back(scvf.outsideScvIdx());
114 const auto& orthogonalScvf = fvGeometry.lateralOrthogonalScvf(scvf);
115 assert(orthogonalScvf.isLateral());
116 map_[ownScvIndex].push_back(orthogonalScvf.insideScvIdx());
117 if (!orthogonalScvf.boundary())
118 map_[ownScvIndex].push_back(orthogonalScvf.outsideScvIdx());
124 for (
auto& stencil : map_)
126 std::sort(stencil.begin(), stencil.end());
127 stencil.erase(std::unique(stencil.begin(), stencil.end()), stencil.end());