From e6fd9495a20e8c420066fa7030014b27e9f25a44 Mon Sep 17 00:00:00 2001 From: Tobias Leibner <tobias.leibner@googlemail.com> Date: Tue, 15 May 2018 09:56:58 +0200 Subject: [PATCH] [walker.apply-on] add singletons for AllEntities and AllIntersections --- dune/xt/grid/walker/apply-on.hh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dune/xt/grid/walker/apply-on.hh b/dune/xt/grid/walker/apply-on.hh index 39563a738..45d715106 100644 --- a/dune/xt/grid/walker/apply-on.hh +++ b/dune/xt/grid/walker/apply-on.hh @@ -80,6 +80,13 @@ public: } }; // class AllEntities +template <class GridLayerImp> +const AllEntities<GridLayerImp>* all_entities() +{ + static const AllEntities<GridLayerImp> all_entities_singleton; + return &all_entities_singleton; +} + /** * \brief Selects entities which have a boundary intersection. @@ -294,9 +301,16 @@ public: } }; // class AllIntersections +template <class GridLayerImp> +const AllIntersections<GridLayerImp>* all_intersections() +{ + static const AllIntersections<GridLayerImp> all_intersections_singleton; + return &all_intersections_singleton; +} + /** - * \brief Selects all intersections. + * \brief Selects no intersections. */ template <class GridLayerImp> class NoIntersections : public internal::WhichIntersectionBase<GridLayerImp, NoIntersections<GridLayerImp>> -- GitLab