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

pep8

parent 71ff27d2
No related branches found
No related tags found
No related merge requests found
...@@ -1188,6 +1188,7 @@ def compare_dofs(): ...@@ -1188,6 +1188,7 @@ def compare_dofs():
"if (maxerror>{})".format(get_option("compare_dofs")), "if (maxerror>{})".format(get_option("compare_dofs")),
" throw;"] " throw;"]
@symbol @symbol
def type_discrete_grid_function(gfs): def type_discrete_grid_function(gfs):
return "DGF_{}".format(gfs.upper()) return "DGF_{}".format(gfs.upper())
......
...@@ -107,12 +107,12 @@ class Expression(Coefficient): ...@@ -107,12 +107,12 @@ class Expression(Coefficient):
def __mul__(self, other): def __mul__(self, other):
# Allow the combination of Expressions # Allow the combination of Expressions
if isinstance(other, Expression): if isinstance(other, Expression):
from ufl import MixedElement, TensorElement
def get_sub(elem): def get_sub(elem):
if isinstance(elem, MixedElement) and not isinstance(elem, (VectorElement, TensorElement)): if isinstance(elem, MixedElement) and not isinstance(elem, (VectorElement, TensorElement)):
return elem.sub_elements() return elem.sub_elements()
else: else:
return [elem] return [elem]
newelem = MixedElement(*(get_sub(self.element) + get_sub(other.element))) newelem = MixedElement(*(get_sub(self.element) + get_sub(other.element)))
return Expression(cppcode=self.c_expr + other.c_expr, element=newelem) return Expression(cppcode=self.c_expr + other.c_expr, element=newelem)
else: else:
......
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