Improve degree estimation by considering tensor component degrees are not equal

Issue #24 on hold
Martin Sandve Alnæs created an issue

Illustrated by this snippet from Jan Blechta:

from dolfin import *
from ufl.algorithms import estimate_total_polynomial_degree as est

mesh = UnitSquareMesh(42, 42)
P2 = FunctionSpace(mesh, 'CG', 2)
P1 = FunctionSpace(mesh, 'CG', 1)
V = P2*P1

u = Function(V)
print est(u[1]) # 2
print est(split(u)[1]) # 2
print est(u.split()[1]) # 1 - this is only correct

u0, u1 = TrialFunctions(V)
print est(u1) # 2

u0, u1 = TestFunctions(V)
print est(u1) # 2

This is a long standing issue, here's the text from launchpad:

The degree estimation algorithm can be improved by looking at the degrees of components of functions instead of the max degrees.

See fixmes in and calls to degree() in estimate_degrees.py.

The improved algorithm is probably easier to implement with some utilities from the uflacs project, holding until that is considered.

Comments (2)

  1. Martin Sandve Alnæs reporter

    On hold pending integration of some utilities from uflacs which may make this easier to implement correctly.

  2. Martin Sandve Alnæs reporter

    Note to future implementer of this enhancement: In addition to varying degrees between components of mixed functions, functions in product elements will have varying degrees depending of the direction you take the derivative in.

  3. Log in to comment