From bbaa81b1d328a0a81b9f70f3fc34da417dd163b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20He=C3=9F?= <rene.hess@iwr.uni-heidelberg.de>
Date: Thu, 18 Jan 2018 14:32:56 +0100
Subject: [PATCH] Solve some issues due to rebasing

---
 python/dune/perftool/options.py                        |  5 +++++
 python/dune/perftool/pdelab/driver/constraints.py      | 10 ++++++++--
 python/dune/perftool/pdelab/driver/instationary.py     |  9 ++++-----
 .../navier-stokes/navierstokes_2d_dg_quadrilateral.ufl |  4 ++--
 .../navier-stokes/navierstokes_3d_dg_quadrilateral.ufl |  2 +-
 5 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/python/dune/perftool/options.py b/python/dune/perftool/options.py
index 7afd80e1..1b1900fa 100644
--- a/python/dune/perftool/options.py
+++ b/python/dune/perftool/options.py
@@ -161,3 +161,8 @@ def option_switch(opt):
         else:
             return "default"
     return _switch
+
+
+def set_option_dependencies():
+    if get_option("overlapping"):
+        set_option("parallel", True)
diff --git a/python/dune/perftool/pdelab/driver/constraints.py b/python/dune/perftool/pdelab/driver/constraints.py
index b6782295..901133c8 100644
--- a/python/dune/perftool/pdelab/driver/constraints.py
+++ b/python/dune/perftool/pdelab/driver/constraints.py
@@ -24,13 +24,19 @@ def name_assembled_constraints():
     return name
 
 
+def has_dirichlet_constraints(is_dirichlet):
+    if isinstance(is_dirichlet, (list, tuple)):
+        return any(bool(d) for d in is_dirichlet)
+    else:
+        return bool(is_dirichlet)
+
+
 @preamble
 def assemble_constraints(name):
     element = get_trial_element()
     gfs = name_trial_gfs()
     is_dirichlet = preprocess_leaf_data(element, "is_dirichlet")
-    from dune.perftool.pdelab.driver.interpolate import _do_interpolate
-    if _do_interpolate(is_dirichlet):
+    if has_dirichlet_constraints(is_dirichlet):
         bctype_function = name_bctype_function(element, is_dirichlet)
         return "Dune::PDELab::constraints({}, {}, {});".format(bctype_function,
                                                                gfs,
diff --git a/python/dune/perftool/pdelab/driver/instationary.py b/python/dune/perftool/pdelab/driver/instationary.py
index ae4f3eb2..3ed2635b 100644
--- a/python/dune/perftool/pdelab/driver/instationary.py
+++ b/python/dune/perftool/pdelab/driver/instationary.py
@@ -14,7 +14,8 @@ from dune.perftool.pdelab.driver.gridfunctionspace import (name_trial_gfs,
 from dune.perftool.pdelab.driver.gridoperator import (name_gridoperator,
                                                       name_parameters,
                                                       type_gridoperator,)
-from dune.perftool.pdelab.driver.constraints import (name_bctype_function,
+from dune.perftool.pdelab.driver.constraints import (has_dirichlet_constraints,
+                                                     name_bctype_function,
                                                      name_constraintscontainer,
                                                      )
 from dune.perftool.pdelab.driver.interpolate import (interpolate_dirichlet_data,
@@ -58,10 +59,8 @@ def time_loop():
     interpolate_dirichlet_data(vector)
 
     is_dirichlet = preprocess_leaf_data(element, "is_dirichlet")
-    from dune.perftool.pdelab.driver.interpolate import _do_interpolate
     assemble_new_constraints = ""
-    dirichlet_constraints = _do_interpolate(is_dirichlet)
-    if dirichlet_constraints:
+    if has_dirichlet_constraints(is_dirichlet):
         bctype = name_bctype_function(element, is_dirichlet)
         gfs = name_trial_gfs()
         cc = name_constraintscontainer()
@@ -78,7 +77,7 @@ def time_loop():
         apply_call = "{}.apply(time, dt, {}, {}new);".format(osm, vector, vector)
     else:
         osm = name_onestepmethod()
-    if dirichlet_constraints:
+    if has_dirichlet_constraints(is_dirichlet):
         dirichlet = preprocess_leaf_data(element, "interpolate_expression")
         boundary = name_boundary_function(element, dirichlet)
         apply_call = "{}.apply(time, dt, {}, {}, {}new);".format(osm, vector, boundary, vector)
diff --git a/test/navier-stokes/navierstokes_2d_dg_quadrilateral.ufl b/test/navier-stokes/navierstokes_2d_dg_quadrilateral.ufl
index 0797acc7..fc8a1505 100644
--- a/test/navier-stokes/navierstokes_2d_dg_quadrilateral.ufl
+++ b/test/navier-stokes/navierstokes_2d_dg_quadrilateral.ufl
@@ -5,7 +5,7 @@ degree = 2
 dim = 2
 
 x = SpatialCoordinate(cell)
-time = variable(Constant(cell, count=2))
+time = get_time(cell)
 
 P2 = VectorElement("DG", cell, degree)
 P1 = FiniteElement("DG", cell, degree-1)
@@ -44,5 +44,5 @@ r = mu * inner(grad(u), grad(v))*dx \
   - avg(q)*inner(jump(u), n)*dS \
 
 forms = [mass,r]
-dirichlet_expression = g_v, g_p
+interpolate_expression = g_v, g_p
 exact_solution = g_v, g_p
diff --git a/test/navier-stokes/navierstokes_3d_dg_quadrilateral.ufl b/test/navier-stokes/navierstokes_3d_dg_quadrilateral.ufl
index 76efb2fe..9eff4518 100644
--- a/test/navier-stokes/navierstokes_3d_dg_quadrilateral.ufl
+++ b/test/navier-stokes/navierstokes_3d_dg_quadrilateral.ufl
@@ -56,7 +56,7 @@ r = mu * inner(grad(u), grad(v))*dx \
   + q*inner(u-g_v, n)*ds
 
 forms = [mass,r]
-dirichlet_expression = g_v, g_p
+interpolate_expression = g_v, g_p
 
 t_end = 0.5
 v_end = as_vector((-a*exp(-d*d*t_end)*(exp(a*x[0])*sin(d*x[2]+a*x[1])+cos(d*x[1]+a*x[0])*exp(a*x[2])),
-- 
GitLab