-
Notifications
You must be signed in to change notification settings - Fork 9
/
makeNewMesh_multi.m
46 lines (31 loc) · 1.04 KB
/
makeNewMesh_multi.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
% MAKENEWMESH Use new scales to calculate a new triangular mesh using
% MESH2D
%
% Usage:
% Script, no function
%
% Edited June 24, 2010 by WDB
% Cornell University
numtri=[];
clear triCoords triId
triId=[];
patchstructnew=[];
for i=1:nfault
node = [-faultstruct(i).L/2 0; faultstruct(i).L/2 0; faultstruct(i).L/2 faultstruct(i).W; -faultstruct(i).L/2 faultstruct(i).W];
x1 = faultstruct(i).vertices(1,1);
y1 = faultstruct(i).vertices(2,1);
dl = sqrt((xc-x1).^2+(yc-y1).^2)-L/2;
hdata.args = {newscales(numTri(j)+1:numTri(j+1)), dl, [(zc-[faultstruct(i).zt])./sind(faultstruct(i).dip)]};
[triCoords, TriId] = mesh2d(node, [], hdata, options3);
close
ntriid(i)=length(TriId);
sums= sum(ntriid(1:i));
numtri=[numtri sums];
triId= [triId; TriId];
Patchstruct = ver2patchtri(faultstruct(i), triCoords, TriId);
patchstructnew= [patchstructnew Patchstruct];
end
numTri=[0 numtri];
nTri = length(patchstructnew);
% clear patchstructnew
% Patchstructnew = ver2patchtri(faultstruct, triCoords, triId);