Accessing the value of basis functions and quadrature points

Hello,

  1. I want to integrate the Nedelec basis function on the mesh (for example, any triangular mesh) by applying the Gaussian quadrature rule on Fenicsx. Are there any functions that will allow me to access Gaussian points and weights for any triangle and enable me to perform this integration process? I saw a tutorial on how to integrate any function in the reference triangle, and some questions asked for old Fenics, but I want to ask how to apply it to this problem. I want to integrate any Nedelec basis function I created before by applying a Gaussian quadrature rule on any cell, not only reference/ master triangle.

  2. How can I access the numerical value of any basis function (for example, V = FunctionSpace(mesh, (“Nedelec 1st kind H(curl)”, 1)) at any point on/inside the cell? For example, I want to access the value of the Nedelec basis function on the (0.25,0.25) point for the master triangle.

Thank you

See: Creating and tabulating an element — Basix 0.8.0.0 documentation
and
Creating and using a quadrature rule — Basix 0.8.0.0 documentation
If you want to use it with dolfinx, you can use the pull back if you know what cell you are in, see for instance:
Point Sources (Redux) - #6 by dokken
ie.

 # Pull owning points back to reference cell
    mesh_nodes = mesh.geometry.x
    cmap = mesh.geometry.cmaps[0]
    ref_x = np.zeros((len(cells), mesh.geometry.dim),
                     dtype=mesh.geometry.x.dtype)
    for i, (point, cell) in enumerate(zip(owning_points, cells)):
        geom_dofs = mesh.geometry.dofmap[cell]
        ref_x[i] = cmap.pull_back(point.reshape(-1, 3), mesh_nodes[geom_dofs])

Hi everyone,

I have a similar problem. With the Basix documentation, I can calculate the points and weights for the master element (for example, unit triangle). But what should I do to apply this to all triangles? I want to find the Gaussian points and weights of any triangle.
With this code, I get the correct point and basis function values for the reference triangle, but what should I do to generalize this to any triangle?
import basic
import numpy as np
from basix import CellType, ElementFamily, LagrangeVariant
wht = basix.create_element(basix.ElementFamily.N1E, CellType.triangle, 1)
print(wht.dim)
points = np.array([[0.0, 0.0], [0.1, 0.1], [0.2, 0.3], [0.3, 0.6], [0.4, 1.0]])
tab = wht.tabulate(0, points)
print(tab)
print(tab.shape)

Thanks

See: Accessing the basis function of a Finite Element - #13 by dokken