Interpolating at vertices of a mesh

조회 수: 21 (최근 30일)
Sanwar Ahmad
Sanwar Ahmad 2020년 8월 5일
편집: Bruno Luong 2020년 8월 6일
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
Bruno Luong
Bruno Luong 2020년 8월 6일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Robert U
Robert U 2020년 8월 6일
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

추가 답변 (1개)

Bruno Luong
Bruno Luong 2020년 8월 6일
편집: Bruno Luong 2020년 8월 6일
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"

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by