www.pudn.com > 87361026FEA.rar > lstest2.m, change:2002-10-01,size:734b


clf

[node,connectivities,elemType]=msh2mlab('square.msh'); 
node=node(:,1:2);
[connectivities,node]=t3tot6(connectivities,node);
conn=connectivities{9};

numNode=size(node,1);
numElem=size(conn,1);
numStep=100;
delt=0.125;

x=node(:,1);
y=node(:,2);
x0=10/2;
y0=x0;
bw=1.0;

phi=1.25*(node(:,2)-5);

% plot level set
plot_field(node,conn,'T6',phi);
hold on
plot_mesh(node,conn,'T6','g-')
contura(node(:,1),node(:,2),phi,[0 0],'k')
pause(0.1)

% get near elements
[nearNode,nearConn,nnMap]=findNearElements(node,conn,phi,bw);

% reinitialize level set
phi=lsreinitT6(node,conn,phi,bw/2,10);

% plot level set
plot_field(node,conn,'T6',phi);
hold on
plot_mesh(node,conn,'T6','g-')
contura(node(:,1),node(:,2),phi,[0 0],'k')
pause(0.1)