diff --git a/dumux/assembly/coloring.hh b/dumux/assembly/coloring.hh index cbe0251ae96bff6239b9b44549998293feac3a22..98d7d757984652ac817164188e778a120a91c8fa 100644 --- a/dumux/assembly/coloring.hh +++ b/dumux/assembly/coloring.hh @@ -110,6 +110,10 @@ computeConnectedElements(const GridGeometry& gg) } } + // nothing has to be precomputed here as only immediate face neighbors are connected + else if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcdiamond) + return connectedElements; + else DUNE_THROW(Dune::NotImplemented, "Missing coloring scheme implementation for this discretization method" @@ -173,6 +177,16 @@ void addNeighborColors(const GridGeometry& gg, neighborColors.push_back(colors[eIdx]); } + else if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcdiamond) + { + // we modify neighbor faces during the assembly + // check who else modifies these neighbor elements + const auto& eMapper = gg.elementMapper(); + for (const auto& intersection : intersections(gg.gridView(), element)) + if (intersection.neighbor()) + neighborColors.push_back(colors[eMapper.index(intersection.outside())]); + } + else DUNE_THROW(Dune::NotImplemented, "Missing coloring scheme implementation for this discretization method" @@ -291,6 +305,7 @@ template<> struct SupportsColoring<DiscretizationMethods::CCTpfa> : public std:: template<> struct SupportsColoring<DiscretizationMethods::CCMpfa> : public std::true_type {}; template<> struct SupportsColoring<DiscretizationMethods::Box> : public std::true_type {}; template<> struct SupportsColoring<DiscretizationMethods::FCStaggered> : public std::true_type {}; +template<> struct SupportsColoring<DiscretizationMethods::FCDiamond> : public std::true_type {}; } // end namespace Dumux