el_in_mesh2.m

来自「MATLAB二维电阻抗断层成像算法!用于医学成像,里面包括有限元剖分正问题,及反」· M 代码 · 共 32 行

M
32
字号
function Ind = el_in_mesh2(H1,g1,H2,g2)

%el_in_mesh2 Makes the element connectivity data matrix between the two meshes 
% Function Ind = el_in_mesh2(H1,g1,H2,g2) 
% makes the element connectivity data matrix between the two meshes  defined by 
% H1, g1 and H2, g2. 
%
% INPUT
%
% H1 = connectivity of the coarse mesh
% g1 = coordinates of the nodes of the coarse mesh
% H2 = connectivity of the dense mesh
% g2 = coordinates of the nodes of the dense mesh
%
% OUTPUT
%
% Ind = element connectivity data matrix
 

S1 = size(H2,1);
S2 = size(H1,1);
Ind = zeros(S1,S2);
for i = 1:S1
  g = g2(H2(i,:),:);
  g11 = (1/3)*sum(g,1);
  T = tsearch(g1(:,1),g1(:,2),H1,g11(1,1),g11(1,2));
  Ind(i,T) = 1;
end
Ind = sparse(Ind);


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?