Replies: 1 comment 9 replies
-
basis.interpolate is for interpolating at the integration points which is the most common interpolation operation required in FEM. Interpolating at other points (defined by a global coordinate x) is cumbersome because it first requires finding in which element x lies in and only then interpolating using its local basis. This has been automated by the function basis.interpolator which returns a function that can be used to get the value at any global coordinate. Your code looks like it should give the correct result but I cannot test it right now on mobile. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I tried to compare interpolation and projection in 1d and would be happy if a few questions could be clarified:
Interpolation is:$f(x)=\sum a_j \phi_j(x)$ with $a_j=\phi_j^*(f)$ (dual basis) and
Projection can be found here : https://scikit-fem.readthedocs.io/en/latest/howto.html
Is there a general interpolate function with a function as input like basis.interpolate(lambda x: ......). For Lagrange functions the coefficients are simply the values of the functions, but for more involved function (e.g. Nedelec) thats different, so a general interpolate function could then be useful
How can$f(x)$ i.e. the sum be calculated for different values of x which would be useful e.g. for P2 functions.
I was wondering why basis.project does not directly give back the$a_j$ . I did a project myself and it was different by a factor of number_of_cells (see following code)
Beta Was this translation helpful? Give feedback.
All reactions