フィルターのクリア

how to calculate the area of each triangle of the mesh in the pdetool box?

3 ビュー (過去 30 日間)
gui
gui 2016 年 8 月 4 日
回答済み: Alan Weiss 2016 年 8 月 8 日
how to calculate the area of each triangle of the mesh in the pdetool box?

回答 (2 件)

KSSV
KSSV 2016 年 8 月 4 日
If you have nodal connectivity matrix and coordinates in hand, use the below code:
function A = triarea(p,t)
% TRIAREA: Area of triangles assuming counter-clockwise (CCW) node
% ordering.
%
% P : Nx2 array of XY node co-ordinates
% T : Mx3 array of triangles as indices into P
% A : Mx1 array of triangle areas
% Darren Engwirda - 2007
d12 = p(t(:,2),:)-p(t(:,1),:);
d13 = p(t(:,3),:)-p(t(:,1),:);
A = (d12(:,1).*d13(:,2)-d12(:,2).*d13(:,1));
end % triarea()

Alan Weiss
Alan Weiss 2016 年 8 月 8 日
You can use the pdetrg function on the p,e,t representation of the mesh. If you are using the PDEModel framework, use meshToPet to extract the appropriate data structures.
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by