Return value meaning of nmm_interpolation_data

As I already stated, there isn’t always a 1-1 correspondence between the points and degrees of freedom. They have to be multiplied by an interpolation matrix for a large set of finite elements, as seen in:

the points are ordered in the following way: (number_of_cells, number_of_interpolation_points).

  1. Take each cell, access its dofmap to get the dofs of interest
  2. Get the interpolation points for the specific cell, (which in your case are those received from rs_owned_points
  3. Pull coefficients in current cell back, see section 8.4.3 of: DOLFINx: The next generation FEniCS problem solving environment
  4. Evaluate basis functions at given points, multiply pulled back dofs by interpolation matrix to get the dof values for given cell.
  5. Insert data in global matrix.

Please note that you could also build a vectorized distance matrix for your double for-loop, i.e. How to represent non-uniform first and second type boundary conditions? - #6 by dokken