Thanks. I see that the mesh function gives two triangular elements for the square. With the following code
# fristly get the quad points
import ffc
from dolfin import *
degree=4
mesh = UnitSquareMesh(1, 1)
el = FiniteElement("Quadrature", mesh.ufl_cell(), degree=degree, quad_scheme="default")
V = FunctionSpace(mesh, el)
x = V.tabulate_dof_coordinates()
print("\n physical cel")
for cell in cells(mesh):
print("cell",cell.index(),"cell nodes",V.dofmap().cell_dofs(cell.index()),'\n', x[V.dofmap().cell_dofs(cell.index())],'\n')
print("\nreference cel, cell name is " ,mesh.cell_name())
points, weights = ffc.fiatinterface.create_quadrature(mesh.cell_name(), degree=degree, scheme="default")
print("weights of ref cel: \n", weights)
I get the results:
physical cel
cell 0 cell nodes [1 0 2 3 4 5]
[[0.90842379 0.09157621]
[0.90842379 0.81684757]
[0.18315243 0.09157621]
[0.55405151 0.44594849]
[0.55405151 0.10810302]
[0.89189698 0.44594849]]
cell 1 cell nodes [ 7 6 8 9 10 11]
[[0.09157621 0.90842379]
[0.81684757 0.90842379]
[0.09157621 0.18315243]
[0.44594849 0.55405151]
[0.10810302 0.55405151]
[0.44594849 0.89189698]]
reference cel, cell name is triangle
weights of ref cel:
[0.05497587 0.05497587 0.05497587 0.11169079 0.11169079 0.11169079]
Does it mean that I can multiply the weights form the ref cel accordingly with the quad points above? Do the quad points from the physical cell automatically align with the weights from the ref cell?