From cfed33187c8ea8d75681713c6ca2399e19d7f072 Mon Sep 17 00:00:00 2001
From: Dominic Kempf <dominic.r.kempf@gmail.com>
Date: Wed, 2 Sep 2015 15:40:52 +0200
Subject: [PATCH] Finish driver.py for now

---
 python/dune/perftool/driver.py | 25 ++++++++-----------------
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/python/dune/perftool/driver.py b/python/dune/perftool/driver.py
index 8df2f262..da8c8e9f 100644
--- a/python/dune/perftool/driver.py
+++ b/python/dune/perftool/driver.py
@@ -1,4 +1,11 @@
-""" The module that drives the generation of the pdelab driver """
+"""
+The module that provides generating methods for all parts
+of the pdelab driver.
+
+Currently, these are hardcoded as strings. It would be possible
+to switch these to cgen expression. OTOH, there is not much to be
+gained there.
+"""
 
 from dune.perftool.generation import dune_include, dune_preamble, dune_symbol
 
@@ -302,14 +309,12 @@ def define_gfs(expr, name):
     if isinstance(expr, RestrictedElement):
         raise NotImplementedError("Dune does not support restricted elements!")
 
-
 @dune_symbol
 def name_gfs(expr):
     name = "{}_gfs".format(FEM_name_mangling(expr)).lower()
     define_gfs(expr, name)
     return name
 
-
 @dune_preamble
 def define_dofestimate(name):
     # Provide a worstcase estimate for the number of entries per row based on the given gridfunction space and cell geometry
@@ -531,17 +536,3 @@ def vtkoutput():
     dune_solve()
     return ["Dune::PDELab::addSolutionToVTKWriter({}, {}, {});".format(vtkwriter, gfs, vec),
             "{}.write({}, Dune::VTK::appendedraw);".format(vtkwriter, vtkfile)]
-
-
-def generate_driver(formdata):
-    # Set the global data:
-    global _formdata
-    _formdata = formdata
-
-    # This should trigger everything IMO
-    vtkoutput()
-
-    # Print the results:
-    from dune.perftool.generation import cache_preambles
-    for p in sorted(cache_preambles(), key=lambda x : x[0]):
-        print p
-- 
GitLab