allow for custom quadrature rules

Issue #33 resolved
Nico Schlömer created an issue

Right now, when assembling a system, Dolfin offers a number of quadrature rules to select from by degree through FFC, https://bitbucket.org/fenics-project/ffc/src/3403ddd0cabdf8cdebcca2fb17595f10c6cd1369/ffc/quadrature_schemes.py?at=master.

In some cases, though, it is required to use certain specific quadrature rules to retain certain properties in the resulting matrix. One example is the M-matrix property for reaction-diffusion systems (which is not present in the discretized system when using the regular quadrature).

A future-proof workaround would be to allow for custom quadrature rules to be specified by the user. Another option would be to extend quadrature_schemes.py with named schemes that can specifically be selected (disregarding the degree argument, then).

Comments (3)

  1. Jan Blechta

    Interface for QuadratureRule class could be specified. It would take degree as an constructor argument and have methods returning weights and quadrature points (these are expressed in barycentric coordinates in quadrature_schemes.py, are they?). User could subclass it and pass it to form compiler.

    Actual subclassing and passing to form compiler would be done in UFL (to be feasible with C++ DOLFIN) so this may require changes in UFL apart from changes in FFC.

  2. Log in to comment