📄 triangle_definition.m
字号:
function triangles=triangle_definition(mv_x,mv_y)
%% generate the Grid Table, which defines the grid topology
%% mv_x: horizontal coordinates of the grids
%% mv_y: vertical coordinates of the grids
%% triangles: Nodes of all triangular meshes, i.e., the grid topology
[M,N]=size(mv_x);
period=(M-1);
total_tri=2*period*(N-1);
triangles=zeros(total_tri,3);
for i=1:N-1
for j=1:period
k=(i-1)*period+j;
start=floor((k-1)/period)*M+mod(k-1,period)+1;
triangles(2*k-1,:)=[start,start+M+1,start+M];
triangles(2*k,:)=[start,start+1,start+M+1];
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -