I want to get interpolation points to construct a graph for ML computation, and the value/derivate of the interpolation function on integration points (such as Gaussian points), and integration weights to integrate residual over elements to get the loss function.
It corresponds to the following three questions. I am using dolfin rather than dolfinx.
- I use the following code to get the interpolation points of each cell. I am wondering if there is a global list of interpolation points and indices to them of each cell? And correspondingly, is there a global list of DOF and indices to them of each cell?
# Define a function space on the mesh
V = FunctionSpace(mesh, "Lagrange", 2)
# Get the finite element
element = V.element()
# Get the coordinates of the interpolation points
points = element.tabulate_dof_coordinates(Cell(mesh, 0))
# points = np.array([element.tabulate_dof_coordinates(cell) for cell in cells(mesh)])
# Print the coordinates
for i, point in enumerate(points):
print("Interpolation point %d: %s" % (i, point))
-
How to get the integration points of elements (cells), such as Gaussian points and weights?
-
How to get the value of the interpolation function and its derivatives on integration points?