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

Add missing include and AD support

parent 59afe332
No related branches found
No related tags found
No related merge requests found
......@@ -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)
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