How to obtain the Gauss quadrature degree estimated by the form compiler

I’m following the hyperelasticity demo (https://fenicsproject.org/docs/dolfin/1.4.0/python/demo/documented/hyperelasticity/python/documentation.html) to simulate some hyperelastic material. My understanding is that the form compiler would automatically estimate the gauss quadrature degree. How can I obtain the gauss quadrature degree number estimated by the form compiler? Thanks.

Note that the demo you are considering is quite outdated, and your should consider the latest version

To estimate the polynomial degree, you can use:

from ufl.algorithms.compute_form_data \
    import estimate_total_polynomial_degree

estimate_total_polynomial_degree(form)
2 Likes

Thank you! Do you have insights on how fenics decided on what degree to use when the estimate_total_polynomial_degree failed? For example, when I use estimate_total_polynomial_degree(psi) on the demo example it failed to give an answer due to det(J) and Trace© etc.

Expand the derivatives before estimering the degree:
from ufl.algorithms import expand_derivatives

1 Like