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

Remove Expression

It is badly implemented as is and does not offer value over
writing symbolic functions.
parent 6e0836d1
No related branches found
No related tags found
No related merge requests found
......@@ -91,17 +91,11 @@ def name_bctype_lambda(name, func):
@preamble
def define_intersection_lambda(name, func):
from dune.perftool.ufl.execution import Expression
from ufl.classes import Expr
if func is None:
func = 0.
if isinstance(func, (int, float)):
return "auto {} = [&](const auto& x){{ return {}; }};".format(name, float(func))
elif isinstance(func, Expression):
if expression.is_global:
return "auto {} = [&](const auto& x){{ {} }};".format(name, func.c_expr[0])
else:
return "auto {} = [&](const auto& is, const auto& x){{ {} }};".format(name, func.c_expr[0])
elif isinstance(func, Expr):
# Set up a visitor
with global_context(integral_type="exterior_facet", formdata=get_formdata(), driver=True):
......
......@@ -94,15 +94,9 @@ def name_boundary_lambda(boundary):
@preamble
def define_boundary_lambda(name, boundary):
from dune.perftool.ufl.execution import Expression
from ufl.classes import Expr
if boundary is None:
return "auto {} = [&](const auto& x){{ return 0.0; }};".format(name)
elif isinstance(boundary, Expression):
if boundary.is_global:
return "auto {} = [&](const auto& x){{ {} }};".format(name, boundary.c_expr[0])
else:
return "auto {} = [&](const auto& e, const auto& x){{ {} }};".format(name, boundary.c_expr[0])
elif isinstance(boundary, Expr):
# Set up a visitor
with global_context(integral_type="exterior_facet", formdata=get_formdata(), driver=True):
......
dim = 2
degree = 1
cell = "quadrilateral"
......
__name = poisson_matrix_free
lowerleft = 0.0 0.0
upperright = 1.0 1.0
elements = 32 32
elementType = simplical
[wrapper.vtkcompare]
name = {__name}
reference = poisson_ref
extension = vtu
[formcompiler]
matrix_free = 1
compare_l2errorsquared = 1e-7
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