How many integration points are included in the tetrahedral grid?

Hello everyone,

I am new to fenics. I would like to ask how many points of integration (Gaussian points) there are in the tetrahedral mesh at different degrees (degree = 1, 2 and 3)?

For example: Vs = FunctionSpace(mesh, ‘P’, 2)

Thanks very much!

Kyy

The number of quadrature (gauss) points is estimated by ufl when you specify your variational form.
See for instance:

from dolfin import *

from ufl.algorithms.compute_form_data import estimate_total_polynomial_degree

mesh = UnitCubeMesh(5, 5, 5)
Vs = FunctionSpace(mesh, "P", 2)
u, v = TrialFunction(Vs), TestFunction(Vs)
a_mass = inner(u, v)*dx
a_stiffness = inner(grad(u), grad(v))*dx
L = inner(Function(Vs), v) * dx


print(estimate_total_polynomial_degree(a_mass))
print(estimate_total_polynomial_degree(a_stiffness))
print(estimate_total_polynomial_degree(a_mass + a_stiffness))
print(estimate_total_polynomial_degree(L))

You can specify the quadrature degree in the integration measure, i.e.:

a_fixed_degree = inner(u, v)*dx(metadata={"quadrature_degree":2})

The schemes for the different degrees can be found at:

4 Likes

Hello dokken,

Thank you very much for your help!

Kyy

Dear Dokken, when I use the function estimate_total_polynomial_degree(), there is an error “ufl_legacy.log.UFLException: Missing degree handler for type Sym”. By the way, I replaced from ufl.algorithms.compute_form_data import estimate_total_polynomial_degree with from ufl_legacy.algorithms.compute_form_data import estimate_total_polynomial_degree since I am using the legacy dolfin.

Please provide a minimal reproducible example.