5
$\begingroup$

For the numerical integration of reaction terms in my PDE on a 2D triangular mesh, I would like to use the scheme $$ \int_T \Phi(x) \approx \frac{|T|}{3} (\Phi(x_0) + \Phi(x_1) + \Phi(x_2)) $$ where the $x_i$ are the triangle nodes.

How to specify this when assembleing the system?

$\endgroup$

2 Answers 2

3
$\begingroup$

Actually you don't specify quadrature rule to assembler but to form compiler. You can tweak ffc/quadrature_schemes.py for your needs or you can adjust generated code. In both cases you just supply your quadrature points and weights.

$\endgroup$
3
  • $\begingroup$ Luckily, assemble() has an form_compiler_parameters argument. $\endgroup$ Commented May 17, 2013 at 13:25
  • $\begingroup$ @Nico: Yes, but FFC seems to accept only default and canonical which is a scheme supplied by FIAT. $\endgroup$ Commented May 17, 2013 at 13:28
  • $\begingroup$ Indeed, quadrature_schemes.py doesn't seem to permit custom schemes. $\endgroup$ Commented May 17, 2013 at 13:55
2
$\begingroup$

You can adjust the quadrature degree by setting

parameters["form_compiler_parameters"]["quadrature_degree"] = q

This will change the quadrature degree such that polynomials of degree q are integrated exactly.

FEniCS will try to autodetect the necessary quadrature degree so this should normally not be needed. However, in some cases you might want to underintegrate by setting a lower value of q.

$\endgroup$
1
  • $\begingroup$ I skimmed through FFC/ffc/quadrature_schemes.py to see what schemes are used for the particular degrees, but the "lumping" scheme that I'd like to use is not implemented. $\endgroup$ Commented May 17, 2013 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.