필터 지우기
필터 지우기

How to calculate the average within a mesh element

조회 수: 6 (최근 30일)
Shengyue Shan
Shengyue Shan 2018년 12월 11일
댓글: KSSV 2018년 12월 12일
Hello,
I am wondering about how to take the average value of all the nodes on the edges and corners of a 2-D quadratic element. I used PED tool box to build a model. Each one of the nodes has three categories of values as a_i, b_i, c_i. And I would like to get the average of the 6 nodes in one element for a, b, and c. Are there any ways to do it? And also. how can I output the area for each one of the element or use it for caluculations with a, b, and c?
Thank you very much!
Best regards,
Shengyue Shan

답변 (1개)

KSSV
KSSV 2018년 12월 12일
N = 10 ;
x = rand(N,1) ; y = rand(N,1) ;
dt = delaunayTriangulation(x(:),y(:)) ;
tri = dt.ConnectivityList ;
p = dt.Points ;
% some physical property/ get mean
V = rand(N,1) ;
V = V(tri) ;
Vm = mean(V,2) ;
  댓글 수: 2
Shengyue Shan
Shengyue Shan 2018년 12월 12일
Hello KSSV,
Thank you very much for your answer! But is the delaunayTriangulation used to generate a triangle based on the the node coordinates? For my case, it is that I have already generated the triangular mesh elements, and and need to do the calculation with the nodes on the triangle. Do you have any idea of how to do this?
Thanks!
KSSV
KSSV 2018년 12월 12일
YOu will be having a nodal connectivity matrix i.e tri and the coordinates i.e p in your hand already. YOu need to get these and solve what you want.

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by