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

Can I adjust Quadrature rule in FENICS by supplying a specific Gauss points and weights?

+1 vote

More Precisely, I have this code :
mesh = UnitSquareMesh(nx, ny)
V = VectorFunctionSpace(mesh, "Lagrange", 2)
Q = FunctionSpace(mesh, "Lagrange", 1)
W = V*Q
(u, p) = TrialFunctions(W)
(v, q) = TestFunctions(W)
u_1 = Function(V)
The system that i want to resolve is :

M u + C p = K u_1
transpose(C) u = 0

M is the Mass Matrix, C is the divergence matrix and K is the stiffness matrix

the variational form is :
a( (u, p),(v, q) )= L(v,q)

a = inner(u, v)dx - inner(div(v), p)dx + inner(q, div(u))dx
L = inner( nabla_grad(u1), nabla_grad(v) )
dx
A, b = assemble_system(a, L)

I want that the Bloc M in the Matrix in left hand side will be lumped (i.e. diagonalized). it can be do through:
-Summarize the absolute value of all rows for each line and place the sum in the diagonal row
-apply a quadrature rule based on specific Gauss points and weights. for the finite elements of order 2 we choose 7 points of integration

(0, 0),(0, 1),(1, 0); w_s = 1/20
(1/2, 0),(0, 1/2),(1/2, 1/2); w_m = 2/15
(1/3, 1/3) ; w_g = 9/20

is it possible to do one of diagonalization method on fenics ?

Thanks.
Hamoudee

asked Dec 20, 2013 by Hamoudee FEniCS Novice (160 points)

Please use Markdown to format your code correctly.

1 Answer

+1 vote
 
Best answer

It is possible to specify the quadrature scheme, see the answer to this question:

http://fenicsproject.org/qa/2216/is-possible-to-specify-custom-integration-schemes-in-fenics

answered Jan 22, 2014 by Marie E. Rognes FEniCS User (5,380 points)
selected Jan 23, 2014 by Jan Blechta
...