51 void update(
const GridGeometry& gridGeometry)
54 map_.resize(gridGeometry.numScv());
56 auto fvGeometry =
localView(gridGeometry);
57 for (
const auto& element : elements(gridGeometry.gridView()))
59 if (element.partitionType() == Dune::InteriorEntity)
62 assert(element.partitionType() == Dune::OverlapEntity);
65 fvGeometry.bind(element);
67 for (
const auto& scvf : scvfs(fvGeometry))
69 if (scvf.isFrontal() && !scvf.boundary() && !scvf.processorBoundary())
71 const auto& ownScv = fvGeometry.scv(scvf.insideScvIdx());
72 const auto& facet = element.template subEntity <1> (ownScv.indexInElement());
73 if (facet.partitionType() == Dune::BorderEntity)
74 map_[ownScv.index()].push_back(scvf.outsideScvIdx());
79 for (
const auto& element : elements(gridGeometry.gridView(), Dune::Partitions::interior))
81 fvGeometry.bind(element);
84 for (
const auto& scvf : scvfs(fvGeometry))
86 assert(!scvf.processorBoundary());
87 const auto& ownScv = fvGeometry.scv(scvf.insideScvIdx());
88 const auto ownDofIndex = ownScv.dofIndex();
89 const auto ownScvIndex = ownScv.index();
94 map_[ownScvIndex].push_back(scvf.outsideScvIdx());
98 for (
const auto& scv : scvs(fvGeometry))
100 const auto otherDofIndex = scv.dofIndex();
101 if (ownDofIndex != otherDofIndex)
102 map_[scv.index()].push_back(ownScvIndex);
114 if (!scvf.boundary())
115 map_[ownScvIndex].push_back(scvf.outsideScvIdx());
126 const auto& orthogonalScvf = fvGeometry.lateralOrthogonalScvf(scvf);
127 assert(orthogonalScvf.isLateral());
128 map_[ownScvIndex].push_back(orthogonalScvf.insideScvIdx());
129 if (!orthogonalScvf.boundary())
130 map_[ownScvIndex].push_back(orthogonalScvf.outsideScvIdx());
136 for (
auto& stencil : map_)
138 std::sort(stencil.begin(), stencil.end());
139 stencil.erase(std::unique(stencil.begin(), stencil.end()), stencil.end());