From 884f5579a92e3d4261d9faf2ac79e080ae208feb Mon Sep 17 00:00:00 2001 From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de> Date: Thu, 6 Sep 2018 16:24:17 +0200 Subject: [PATCH] Add missing include and AD support --- python/dune/perftool/ufl/preprocess.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/dune/perftool/ufl/preprocess.py b/python/dune/perftool/ufl/preprocess.py index 5d7c93a3..a376f97c 100644 --- a/python/dune/perftool/ufl/preprocess.py +++ b/python/dune/perftool/ufl/preprocess.py @@ -3,6 +3,9 @@ import ufl.classes as uc import ufl.algorithms.apply_function_pullbacks as afp import ufl.algorithms.apply_algebra_lowering as aal +import ufl.algorithms.apply_derivatives as ad + +from dune.perftool.options import get_form_option from pytools import memoize @@ -60,4 +63,6 @@ def apply_default_transformations(form): # Monkey patch UFL, such that we invert matrices in C++ instead of Python. # The latter only works for very small matrices. If this causes a problem at # some point, we should guard this monkey patch with an option. + aal.LowerCompoundAlgebra.inverse = lambda s, o, A: s.reuse_if_untouched(o, A) +ad.GenericDerivativeRuleset.inverse = lambda s, o, A: -uc.Dot(uc.Dot(o, A), o) -- GitLab