Skip to content
Snippets Groups Projects
Commit cfed3318 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Finish driver.py for now

parent c44ec24a
No related branches found
No related tags found
No related merge requests found
""" 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment