This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Question concerning the number of integration points

+3 votes

I'm solving Stokes equation plus temperature equation with linear elements for pressure and temperature and quadratic elements for the velocity. From time to time I get:
WARNING: The number of integration points for each cell will be: 125
Consider using the option 'quadrature_degree' to reduce the number of points
What does this mean? How can I avoid it?
If necessary, I could provide the complete example. But I think the warning is not specific to a particular example.

asked Jun 15, 2015 by meipaff FEniCS Novice (320 points)

1 Answer

+3 votes

Hi, the form compiler computes the degree of the integrand and chooses the exact quadrature rule. If the rule uses more than 99 quadrature points you get the warning. The warning message suggests reducing the degree, e.g.

q_degree = 3
dx = dx(metadata={'quadrature_degree': q_degree})

Note that you will be using inexact integration then. If you encountered this while computing the error with errornorm function consider lowering the degree_rise argument which has value 3 by default.

answered Jun 17, 2015 by MiroK FEniCS Expert (80,920 points)

Thank you very much for your helpful answer. I got this warning in particular while computing the norm of a function u:
dot(u,u).
Is the degree-rise argument also available for the dot function and how do I use it?

Consider

from dolfin import *

mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, 'CG', 3)
f = interpolate(Expression('sin(2*pi*(x[0]+x[1]))'), V)

inferred = assemble(inner(f, f)*dx)
print 'FFC inferred quadrature', inferred

for deg in range(1, 7):
    res = assemble(inner(f, f)*dx(metadata={'quadrature_degree': deg}))
    diff = abs(res - inferred)  
    print 'quad. degree = %d, diff = %g' % (deg, diff) 

Thank you, this is the solution of my problem.

...