diff --git a/dumux/common/geometry/geometricentityset.hh b/dumux/common/geometry/geometricentityset.hh index 2cc146c57a84ca14a05989fc11860a79b90b795d..9dcebc0afe1c387ad5a4dbf37e50100347f7ed99 100644 --- a/dumux/common/geometry/geometricentityset.hh +++ b/dumux/common/geometry/geometricentityset.hh @@ -39,18 +39,23 @@ namespace Dumux { template <class GridView, int codim = 0, class Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>> class GridViewGeometricEntitySet { + using EntityMap = Dumux::EntityMap<GridView, codim>; public: using Entity = typename GridView::template Codim<codim>::Entity; GridViewGeometricEntitySet(const GridView& gridView) + : GridViewGeometricEntitySet(gridView, Dune::mcmgLayout(Dune::Codim<codim>())) + {} + + GridViewGeometricEntitySet(const GridView& gridView, const Mapper& mapper) : gridView_(gridView) - , mapper_(gridView, Dune::mcmgLayout(Dune::Codim<codim>())) - , entityMap_(std::make_shared<EntityMap<GridView, codim>>(gridView.grid(), mapper_)) + , mapper_(mapper) + , entityMap_(std::make_shared<EntityMap>(gridView.grid(), mapper_)) {} GridViewGeometricEntitySet(const GridView& gridView, const Mapper& mapper, - std::shared_ptr<const EntityMap<GridView, codim>> entityMap) + std::shared_ptr<const EntityMap> entityMap) : gridView_(gridView) , mapper_(mapper) , entityMap_(entityMap) @@ -99,7 +104,7 @@ public: private: GridView gridView_; Mapper mapper_; - std::shared_ptr<const EntityMap<GridView, codim>> entityMap_; + std::shared_ptr<const EntityMap> entityMap_; }; diff --git a/dumux/common/geometry/intersectingentities.hh b/dumux/common/geometry/intersectingentities.hh index eb7189e52e6c63e6685e71518bbfcc9c7b523064..4338cba949b32e598ee590d6818e57eb818f6987 100644 --- a/dumux/common/geometry/intersectingentities.hh +++ b/dumux/common/geometry/intersectingentities.hh @@ -165,7 +165,7 @@ void intersectingEntities(const BoundingBoxTree<EntitySet0>& treeA, if (dimIntersection >= 2) { - const auto triangulation = triangulate<2, dimworld>(intersection); + const auto triangulation = triangulate<dimIntersection, dimworld>(intersection); for (unsigned int i = 0; i < triangulation.size(); ++i) intersections.emplace_back(eIdxA, eIdxB, std::move(triangulation[i])); } diff --git a/dumux/common/geometry/triangulation.hh b/dumux/common/geometry/triangulation.hh index bfb6cde114e5786ac8c710b80f1089919652e389..8bc76f992dcdbbc7231c3a97ebea344cdf00dacd 100644 --- a/dumux/common/geometry/triangulation.hh +++ b/dumux/common/geometry/triangulation.hh @@ -116,13 +116,13 @@ inline Triangulation<dim, dimWorld, typename RandomAccessContainer::value_type:: triangulate(const RandomAccessContainer& points) { using ctype = typename RandomAccessContainer::value_type::value_type; - using Point = Dune::FieldVector<ctype, 3>; + using Point = Dune::FieldVector<ctype, dimWorld>; static_assert(std::is_same<typename RandomAccessContainer::value_type, Point>::value, "Triangulation expects Dune::FieldVector as point type"); if (points.size() == 2) - return Triangulation<dim, dimWorld, ctype>({points[0], points[1]}); + return Triangulation<dim, dimWorld, ctype>({ {points[0], points[1]} }); //! \todo sort points and create polyline assert(points.size() > 1);