From bba8965eb9f311b94fa33095f1e23a09e1afcf7c Mon Sep 17 00:00:00 2001
From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>
Date: Wed, 31 Aug 2016 10:46:55 +0200
Subject: [PATCH] Simplify assembler_routine_name generator

---
 python/dune/perftool/pdelab/localoperator.py | 27 +++-----------------
 1 file changed, 3 insertions(+), 24 deletions(-)

diff --git a/python/dune/perftool/pdelab/localoperator.py b/python/dune/perftool/pdelab/localoperator.py
index 49574c5c..ceab0ba7 100644
--- a/python/dune/perftool/pdelab/localoperator.py
+++ b/python/dune/perftool/pdelab/localoperator.py
@@ -159,31 +159,10 @@ def assembler_routine_name():
     integral_type = get_global_context_value("integral_type")
     form_type = get_global_context_value("form_type")
 
-    if form_type == 'residual':
-        if integral_type == 'cell':
-            return "alpha_volume"
-        if integral_type == 'exterior_facet':
-            return "alpha_boundary"
-        if integral_type == 'interior_facet':
-            return "alpha_skeleton"
+    part1 = {"residual": "alpha"}.get(form_type, form_type)
+    part2 = ufl_measure_to_pdelab_measure(integral_type).lower()
 
-    if form_type == 'jacobian':
-        if integral_type == 'cell':
-            return "jacobian_volume"
-        if integral_type == 'exterior_facet':
-            return "jacobian_boundary"
-        if integral_type == 'interior_facet':
-            return "jacobian_skeleton"
-
-    if form_type == 'jacobian_apply':
-        if integral_type == 'cell':
-            return "jacobian_apply_volume"
-        if integral_type == 'exterior_facet':
-            return "jacobian_apply_boundary"
-        if integral_type == 'interior_facet':
-            return "jacobian_apply_skeleton"
-
-    assert False
+    return "{}_{}".format(part1, part2)
 
 
 def assembly_routine_signature():
-- 
GitLab