How to get Gaussian integration point directly on a mesh element/cell?

I found the following code to get quadrature points and weights in the standard simplex. But I want to get the quadrature points on mesh elements/cells directly. Is any way in Fenics to do this? What are the choices for scheme (what are the candidate input strings)?


from ffc.fiatinterface import create_quadrature as cquad

shape = "interval"
deg = 2
scheme = "default"

points, weights = cquad(shape, deg, scheme)

print(points, weights)

I am using dolfin, and the 2019 old version of Fenics.

See:

See: Bitbucket

Thanks! This code gives a list of integration points, but how to get the weights? Can I get the points and weights arranged by elements/cells? What is the default integration scheme?

Please read the docstring of the function i referred you to

Thanks! I have read the doc and want to use this function to get integration points and weights. The following code gives some error. How to construct FIAT cell with mesh?

from FIAT import *
cell =  Cell(mesh, 0)
print(create_quadrature(cell,2))

AttributeError: ‘dolfin.cpp.mesh.Cell’ object has no attribute ‘get_shape’

Use the ffc.fiatinterface:

import ffc
import dolfin as d
mesh = d.UnitSquareMesh(10, 10)
points, weights = ffc.fiatinterface.create_quadrature(mesh.cell_name(), degree=1, scheme="default")
print(points, weights)

Thanks ! And how can I specify which mesh cell to be input?

Im not sure what you want with this question.

In the other post ive already shown you how to get the quadrature points in any cell. The weights does not change from cell to cell.

Yes the weights do not change, but to align it with the nodes correctly need the information of integration scheme, the distribution, and the order of the integration nodes. If I align them manually, I am afraid of using the wrong information and get bugs that are hard to realize.

Isn’t there a way to get both the integration points and weights of a mesh cell directly? Dolfin or dolfinx will be OK for me. I just installed both versions.