keep expression2GF
This is used twice in the tutorial and we should consider deprecating i
./laplace-dwr.py:111:eh = expression2GF( uh.space.gridView, abs(exact-uh), order=order+1 )
./lineplot.py:89:absGrad = expression2GF(gridView3d, sqrt(dot(grad(uh3d),grad(uh3d))), 2 )
./lineplot.py:100:absGrad = expression2GF(gridView3d, grad(uh3d), 2 )
This can be done in the same way using uflFunction. The implementation is simply
def expression2GF(grid,expression,order,name=None):
try:
if expression.gf is not None:
return expression.gf
except:
pass
from dune.fem.function import localFunction, uflFunction
return uflFunction(grid, "expr" if name is None else name, order, expression)
Edited by Andreas Dedner