add automatic degree detection to assembly routine
Here is a possible example of using this assemble approach:
from ufl import SpatialCoordinate, dot, dx, sin, inner, grad, as_vector
from dune.grid import structuredGrid
from dune.fem.space import lagrange
from dune.fem import assemble
from dune.fem.function import integrate
from ufl.algorithms.estimate_degrees import estimate_total_polynomial_degree as degree
view = structuredGrid([0,0],[1,1],[10,10])
spc = lagrange(view, order=5)
x = SpatialCoordinate(spc)
exact = sin( dot(x,x)**2 )
df = spc.interpolate(exact, name="df")
error = exact-df
print( degree(df), degree(dot(x,x)), degree(sin(x[0])), degree(exact), degree(error), degree(error**2) )
print( assemble(error**2 * dx) )
print( integrate(view, error**2, order=5) )
Edited by Andreas Dedner