makenode.m

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

M
43
字号
function [Node]=MakeNode(Element,Nodelist,g);

%MakeNode Computes the Node data structure for a 2D mesh 
% Function [Node]=MakeNode(Element,Nodelist,g);
% computes the Node data for a mesh.
% Node is a structure including all the nodal coordinates and
% for each node there is information to which nodes (NodeConnection) 
% and elements (ElementConnection) the node is
% connected.  
%
% INPUT
%
% Element = Element structure, see MakeElement.m 
% Nodelist = list of all the faces, see MakeElement.m 
% g = coordinates of the nodes 
%
% OUTPUT
%
% Node = node structure


[rg,cg]=size(g);
msE=max(size(Element));
for ii=1:rg
 ElementConnection=[];
 Node(ii).Coordinate=[g(ii,:)];
  for jj=1:msE
   if find(Element(jj).Topology==ii)
    ElementConnection=[ElementConnection,jj];
   end
  end
  Node(ii).ElementConnection=ElementConnection;
 Nc=[];
 [I,J]=find(Nodelist==ii);
 un=(Nodelist(I,:));
 un=unique(un(:));
 Nc=un(un~=ii);
 Node(ii).NodeConnection=Nc;
end


  

⌨️ 快捷键说明

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