From ef1333fc3e21a4cd82fee303a57e8a759c68910b Mon Sep 17 00:00:00 2001
From: Felix Schindler <felix.schindler@wwu.de>
Date: Tue, 6 Aug 2019 17:48:31 +0200
Subject: [PATCH] [grids] add some more available grid tuples

---
 dune/xt/grid/grids.hh | 101 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 99 insertions(+), 2 deletions(-)

diff --git a/dune/xt/grid/grids.hh b/dune/xt/grid/grids.hh
index ea1117a61..16b97aaa0 100644
--- a/dune/xt/grid/grids.hh
+++ b/dune/xt/grid/grids.hh
@@ -65,13 +65,62 @@ typedef Dune::AlbertaGrid<3, 3> ALBERTA_3D;
 namespace Dune {
 namespace XT {
 namespace Grid {
+namespace internal {
 
 
+// To give better error messages, required below.
+template <size_t d>
+class ThereIsNoSimplexGridAvailableInDimension
+{};
+
+
+} // namespace internal
+
+
+/**
+ * \note Alberta grids are missing here on purpose, these cannot be handled automatically very well.
+ */
+using Available1dGridTypes = boost::tuple<ONED_1D, YASP_1D_EQUIDISTANT_OFFSET>;
+
+/**
+ * \note Alberta grids are missing here on purpose, these cannot be handled automatically very well.
+ */
+using Available2dGridTypes = boost::tuple<YASP_2D_EQUIDISTANT_OFFSET
+#if HAVE_DUNE_ALUGRID
+                                          ,
+                                          ALU_2D_SIMPLEX_CONFORMING,
+                                          ALU_2D_SIMPLEX_NONCONFORMING,
+                                          ALU_2D_CUBE
+#endif
+#if HAVE_DUNE_UGGRID || HAVE_UG
+                                          ,
+                                          UG_2D
+#endif
+                                          >;
+
+/**
+ * \note Alberta grids are missing here on purpose, these cannot be handled automatically very well.
+ */
+using Available3dGridTypes = boost::tuple<YASP_3D_EQUIDISTANT_OFFSET
+#if HAVE_DUNE_ALUGRID
+                                          ,
+                                          ALU_3D_SIMPLEX_CONFORMING,
+                                          ALU_3D_SIMPLEX_NONCONFORMING,
+                                          ALU_3D_CUBE
+#endif
+#if HAVE_DUNE_UGGRID || HAVE_UG
+                                          ,
+                                          UG_3D
+#endif
+                                          >;
+
+/**
+ * \note Alberta grids are missing here on purpose, these cannot be handled automatically very well.
+ */
 using AvailableGridTypes = boost::tuple<ONED_1D,
                                         YASP_1D_EQUIDISTANT_OFFSET,
                                         YASP_2D_EQUIDISTANT_OFFSET,
-                                        YASP_3D_EQUIDISTANT_OFFSET,
-                                        YASP_4D_EQUIDISTANT_OFFSET
+                                        YASP_3D_EQUIDISTANT_OFFSET
 #if HAVE_DUNE_ALUGRID
                                         ,
                                         ALU_2D_SIMPLEX_CONFORMING,
@@ -94,4 +143,52 @@ using AvailableGridTypes = boost::tuple<ONED_1D,
 } // namespace Dune
 
 
+using SIMPLEXGRID_1D = ONED_1D;
+using SIMPLEXGRID_2D =
+#if HAVE_DUNE_ALUGRID
+    ALU_2D_SIMPLEX_CONFORMING;
+#elif HAVE_DUNE_UGGRID || HAVE_UG
+    UG_2D;
+#else
+    Dune::XT::Grid::internal::ThereIsNoSimplexGridAvailableInDimension<2>;
+#endif
+using SIMPLEXGRID_3D =
+#if HAVE_DUNE_ALUGRID
+    ALU_3D_SIMPLEX_CONFORMING;
+#elif HAVE_DUNE_UGGRID || HAVE_UG
+    UG_3D;
+#else
+    Dune::XT::Grid::internal::ThereIsNoSimplexGridAvailableInDimension<3>;
+#endif
+
+
+using CUBEGRID_1D = ONED_1D;
+using CUBEGRID_2D = YASP_2D_EQUIDISTANT_OFFSET;
+using CUBEGRID_3D = YASP_3D_EQUIDISTANT_OFFSET;
+
+
+#if HAVE_DUNE_ALUGRID || HAVE_DUNE_UGGRID || HAVE_UG
+#  define SIMPLEXGRID_2D_AVAILABLE 1
+#  define SIMPLEXGRID_3D_AVAILABLE 1
+#else
+#  define SIMPLEXGRID_2D_AVAILABLE 0
+#  define SIMPLEXGRID_3D_AVAILABLE 0
+#endif
+
+
+using GRID_1D = ONED_1D;
+using GRID_2D =
+#if SIMPLEXGRID_2D_AVAILABLE
+    SIMPLEXGRID_2D;
+#else
+    YASP_2D_EQUIDISTANT_OFFSET;
+#endif
+using GRID_3D =
+#if SIMPLEXGRID_3D_AVAILABLE
+    SIMPLEXGRID_3D;
+#else
+    YASP_3D_EQUIDISTANT_OFFSET;
+#endif
+
+
 #endif // DUNE_XT_GRID_GRIDS_HH
-- 
GitLab