Interpolating at vertices of a mesh

20 vues (au cours des 30 derniers jours)
Sanwar Ahmad
Sanwar Ahmad le 5 Août 2020
Modifié(e) : Bruno Luong le 6 Août 2020
I have created a mesh using the initmesh in 2D, which gives the nodes (p), boundary (e) and triangular elements (t). I have a function/vector calculated at each triangular elements, I need to interpolate the function at the vertices of the mesh. How do I do it?
  1 commentaire
Bruno Luong
Bruno Luong le 6 Août 2020
In theory you cannot.
A function that is piecewise constant on elements is discontinuos at the vertices and you cannot speak about value at the vertices. So there is no interpolation that can provide you this value.

Connectez-vous pour commenter.

Réponse acceptée

Robert U
Robert U le 6 Août 2020
Hi Sanwar Ahmad,
for interpolation between meshes you can have a look at the built-in function scatteredinterpolant().
More information on interpolating scattered data can be found in the Matlab documentation: https://de.mathworks.com/help/matlab/math/interpolating-scattered-data.html
Kind regards,
Robert

Plus de réponses (1)

Bruno Luong
Bruno Luong le 6 Août 2020
Modifié(e) : Bruno Luong le 6 Août 2020
In theory you cannot.
A function that is piecewise constant on elements is discontinuos at the vertices and you cannot speak about value at the vertices. So there is no interpolation that can provide you this value.
Now you might be able to make a fake discrete weighted mean at the vertices v for all elements Ti that share this vertice. There is two common strategies is take the weight as
f(v) = sum (wi*f(Ti)) / sum(wi)
  • wi = surface of the elements
  • wi = angle at the vertice
This link might be helpful, in their pseudo code just replace "facte normal" by "facet value"

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by