- Thank you received: 0
Interpolate values to grid function in 2D
5 years 3 months ago #1803
by pgangl
Interpolate values to grid function in 2D was created by pgangl
Hi,
I am given coordinates (x_i, y_j) of points in my computational domain together with the corresponding function values z_ij. I would like to interpolate the function values and assign the interpolated function to a GridFunction. For 1D domains this works fine using BSplines which return a CoefficientFunction.
Is it possible to interpolate my data using a Bspline surface which I can then assign to the GridFunction living on a 2D domain?
I tried scipy.interpolate.interp2d ( docs.scipy.org/doc/scipy/reference/gener...interpolate.interp2d ), but I cannot assign the resulting interpolating function to a GridFunction.
Thank you very much in advance for your help!
Best regards,
Peter
I am given coordinates (x_i, y_j) of points in my computational domain together with the corresponding function values z_ij. I would like to interpolate the function values and assign the interpolated function to a GridFunction. For 1D domains this works fine using BSplines which return a CoefficientFunction.
Is it possible to interpolate my data using a Bspline surface which I can then assign to the GridFunction living on a 2D domain?
I tried scipy.interpolate.interp2d ( docs.scipy.org/doc/scipy/reference/gener...interpolate.interp2d ), but I cannot assign the resulting interpolating function to a GridFunction.
Thank you very much in advance for your help!
Best regards,
Peter
5 years 3 months ago #1807
by joachim
Replied by joachim on topic Interpolate values to grid function in 2D
Hi Peter,
you can use a GridFunction on a secondary finite element mesh (maybe structured) to represent your given data.
This GridFunction you can use as a coefficient in your formulation, or you can interpolate this data onto your unstructured finite element mesh.
Interpolating between different meshes obviously has some costs, but we use geometric search trees to keep the asymptotic costs low.
Hope this helps,
Joachim
you can use a GridFunction on a secondary finite element mesh (maybe structured) to represent your given data.
This GridFunction you can use as a coefficient in your formulation, or you can interpolate this data onto your unstructured finite element mesh.
Interpolating between different meshes obviously has some costs, but we use geometric search trees to keep the asymptotic costs low.
Hope this helps,
Joachim
Attachments:
Time to create page: 0.095 seconds