From 6ccba85c29a6cf00d0c3c32f03b8a87780c142a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20He=C3=9F?= <rene.hess@iwr.uni-heidelberg.de>
Date: Tue, 10 Jul 2018 10:40:17 +0200
Subject: [PATCH] Add option to generate quadrilateral UG Grid

Note: This is still structured for now
---
 python/dune/perftool/options.py                         | 1 +
 python/dune/perftool/pdelab/driver/gridfunctionspace.py | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/python/dune/perftool/options.py b/python/dune/perftool/options.py
index 96617371..5b5a6d15 100644
--- a/python/dune/perftool/options.py
+++ b/python/dune/perftool/options.py
@@ -47,6 +47,7 @@ class PerftoolGlobalOptionsArray(ImmutableRecord):
     project_basedir = PerftoolOption(helpstr="The base (build) directory of the dune-perftool project")
     architecture = PerftoolOption(default="haswell", helpstr="The architecture to optimize for. Possible values: haswell|knl|skylake")
     yaspgrid_offset = PerftoolOption(default=False, helpstr="Set to true if you want a yasp grid where the lower left corner is not in the origin.")
+    grid_unstructured = PerftoolOption(default=False, helpstr="Set to true if you want to use an unstructured grid.")
     precision_bits = PerftoolOption(default=64, helpstr="The number of bits for the floating point type")
     overlapping = PerftoolOption(default=False, helpstr="Use an overlapping solver and constraints. You still need to make sure to construct a grid with overlap! The parallel option will be set automatically.")
     operators = PerftoolOption(default="r", helpstr="A comma separated list of operators, each name will be interpreted as a subsection name within the formcompiler section")
diff --git a/python/dune/perftool/pdelab/driver/gridfunctionspace.py b/python/dune/perftool/pdelab/driver/gridfunctionspace.py
index a956855a..83913fdc 100644
--- a/python/dune/perftool/pdelab/driver/gridfunctionspace.py
+++ b/python/dune/perftool/pdelab/driver/gridfunctionspace.py
@@ -51,7 +51,10 @@ def typedef_grid(name):
     dim = get_dimension()
     if isQuadrilateral(get_trial_element().cell()):
         range_type = type_range()
-        if get_option("yaspgrid_offset"):
+        if get_option("grid_unstructured"):
+            gridt = "Dune::UGGrid<{}>".format(dim)
+            include_file("dune/grid/uggrid.hh", filetag="driver")
+        elif get_option("yaspgrid_offset"):
             gridt = "Dune::YaspGrid<{0}, Dune::EquidistantOffsetCoordinates<{1}, {0}>>".format(dim, range_type)
         else:
             gridt = "Dune::YaspGrid<{0}, Dune::EquidistantCoordinates<{1}, {0}>>".format(dim, range_type)
-- 
GitLab