-
Notifications
You must be signed in to change notification settings - Fork 0
/
del_spurious.m
31 lines (31 loc) · 1.05 KB
/
del_spurious.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
function ptde=del_spurious(ptde,Tri,nslimits,bottom)
% del_spurious:
% Delete spurious values from ptde, setting both NS-limits and bottom depth.
% Usage:
% >>ptde27_evt1=del_spurious(ptde27,TChaman2,[3.39e+6 3.41e+6],-9000);
ptdeorg=ptde;
%
ulimit=1e-8;
%Ibig=find(ptde>ulimit);
Ibig=find(abs(ptde)>ulimit);
if nslimits(2)<nslimits(1)
return
end
%
IbigDeep=find(Tri.Points(Tri.ConnectivityList(Ibig,1),3)<bottom & ...
Tri.Points(Tri.ConnectivityList(Ibig,2),3)<bottom & ...
Tri.Points(Tri.ConnectivityList(Ibig,3),3)<bottom);
ptde(Ibig(IbigDeep))=0;
%
IbigDeep=find(Tri.Points(Tri.ConnectivityList(Ibig,1),2)>nslimits(2) & ...
Tri.Points(Tri.ConnectivityList(Ibig,2),2)>nslimits(2) ...
& Tri.Points(Tri.ConnectivityList(Ibig,3),2)>nslimits(2));
ptde(Ibig(IbigDeep))=0;
%
IbigDeep=find(Tri.Points(Tri.ConnectivityList(Ibig,1),2)<nslimits(1) & ...
Tri.Points(Tri.ConnectivityList(Ibig,2),2)<nslimits(1) & ...
Tri.Points(Tri.ConnectivityList(Ibig,3),2)<nslimits(1));
ptde(Ibig(IbigDeep))=0;
%
% For "unconstrained" solution
ptde(ptde<1e-5)=0;