59    void update(
const BulkFVG& bulkFvGridGeometry,
 
   60                const LowDimFVG& lowDimFvGridGeometry,
 
   61                std::shared_ptr<const Embeddings> embeddings)
 
   64        auto addCouplingEntryPolicy = [&] (
auto&& adjoinedEntityIndices,
 
   65                                           const LowDimElement& lowDimElement,
 
   66                                           const LowDimFVG& lowDimFvGridGeometry,
 
   67                                           const BulkFVG& bulkFvGridGeometry)
 
   72            const auto lowDimGeometry = lowDimElement.geometry();
 
   73            const auto lowDimElemIdx = lowDimFvGridGeometry.elementMapper().index(lowDimElement);
 
   76            auto fvGeometry = 
localView(bulkFvGridGeometry);
 
   79            for (
auto bulkElemIdx : adjoinedEntityIndices)
 
   81                const auto bulkElement = bulkFvGridGeometry.element(bulkElemIdx);
 
   82                fvGeometry.bindElement(bulkElement);
 
   85                BulkIndexType embeddedScvfIdx;
 
   86                for (
const auto& scvf : scvfs(fvGeometry))
 
   92                        if ( std::find(adjoinedEntityIndices.begin(),
 
   93                                       adjoinedEntityIndices.end(),
 
   94                                       scvf.outsideScvIdx()) != adjoinedEntityIndices.end() )
 
   96                            embeddedScvfIdx = scvf.index();
 
  104                        const auto eps = lowDimGeometry.volume()*1e-8;
 
  105                        const auto diffVec = lowDimGeometry.center()-scvf.center();
 
  107                        if ( Dune::FloatCmp::eq<GlobalPosition, Dune::FloatCmp::CmpStyle::absolute>(diffVec, GlobalPosition(0.0), eps) )
 
  109                            embeddedScvfIdx = scvf.index();
 
  117                    DUNE_THROW(Dune::InvalidStateException, 
"Could not find coupling scvf in embedment");
 
  123                                               : std::vector<LowDimIndexType>( {lowDimElemIdx} );
 
  125                for (
auto dofIdx : lowDimElementDofs)
 
  127                    bulkData.couplingStencil.push_back( dofIdx );
 
  128                    bulkData.dofToCouplingScvfMap[dofIdx].push_back( embeddedScvfIdx );
 
  132                bulkData.couplingElementStencil.push_back(lowDimElemIdx);
 
  133                bulkData.elementToScvfMap[lowDimElemIdx].push_back( embeddedScvfIdx );
 
  136                lowDimData.embedments.emplace_back( bulkElemIdx, std::vector<BulkIndexType>({embeddedScvfIdx}) );
 
  140            lowDimData.couplingStencil = std::move(adjoinedEntityIndices);
 
  144        ParentType::update_(bulkFvGridGeometry, lowDimFvGridGeometry, embeddings, addCouplingEntryPolicy);
 
  149            auto makeStencilUnique = [] (
auto& data)
 
  151                auto& cs = data.second.couplingStencil;
 
  152                std::sort(cs.begin(), cs.end());
 
  153                cs.erase( std::unique(cs.begin(), cs.end()), cs.end() );
 
  157            std::for_each(bulkCouplingData.begin(), bulkCouplingData.end(), makeStencilUnique);