How can I find a Element from Mesh, when I have only one point.

조회 수: 1 (최근 30일)
Andreas Nick
Andreas Nick 2018년 5월 7일
답변: Siju Thomas 2019년 9월 17일
Hallo, I'm trying to find a element in the PDE-Model. I mean, how kan I get the nomber of Element when i have only a point region.x and region.y. I tried:
for i=1:ne
EN=findElements(mesh,'attached',[region.x(i);region.y(i)]);
end
sorry for my English
  댓글 수: 4
KSSV
KSSV 2018년 5월 7일
Does the point lie inside the element? Or it is a node?
Andreas Nick
Andreas Nick 2018년 5월 7일
The point lie inside the element and it is not a node.

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

답변 (1개)

Siju Thomas
Siju Thomas 2019년 9월 17일
Please try this and see if this works you:
N_ID = findNodes(mesh,'nearest',[region.x(i);region.y(i)]);
En = findElements(mesh,'attached',N_ID);

Community Treasure Hunt

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

Start Hunting!

Translated by