필터 지우기
필터 지우기

Interpolate values triangular prism mesh on unstructured tetrahedral mesh

조회 수: 3 (최근 30일)
I am trying to interpolate the values of a fine structured triangular prism (=wedge) mesh on a coarser unstructured tetrahedral mesh. For both meshes, I have the x,y,z coordinates of the cell center, so in principle it is just a question of finding the x nearest neighbors of the coarse mesh and assign a weight average of the values of these points to the tetrahedron of the coarse mesh. I actually thought this would be possible with the interp3 function, but it gives me an error message stating that my values are not monotonously increasing. Any clue on how I can efficiently to this interpolation job? Best regards and thanks in advance for your help. Sarah

채택된 답변

John D'Errico
John D'Errico 2016년 7월 25일
interp3 is not designed to solve an interpolation on a scattered set. It REQUIRES a regular, rectangular mesh. If you lack that, then it won't work. Anyway, just finding the nearest set of k neighbors is a bad way to do interpolation, since it need not yield a continuous prediction.
You need to use tools like scatteredInterpolant, or if you already have the tessellated mesh, then something like tsearchn.
  댓글 수: 3
John D'Errico
John D'Errico 2016년 7월 26일
In three dimensions, a tessellated mesh would be that 4 column array of indices for the tetrahedral mesh. Each row of that array indicates one tetrahedron of the mesh. It is the array TRI in the call to tsearchn. Likewise, the existing mesh node coordinates will be the array X in your call to tsearchn.
Sarah Garre
Sarah Garre 2016년 7월 26일
Hi John, I tested your first option with scatteredInterpolant and it seems to work and even fairly fast... F = scatteredInterpolant(MeshHYD.cellmid(:,1),MeshHYD.cellmid(:,2),MeshHYD.cellmid(:,3),MeshHYD.WC(:,ii)); MeshBERT.WC(:,ii) = F(MeshBERT.cellmid(:,1),MeshBERT.cellmid(:,2),MeshBERT.cellmid(:,3)); I'll see whether I can make the other option work too. Thanks for your help!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by