Skip to content

Commit d0b3440

Browse files
committed
ADD: cutoff option in flowlines.m
1 parent a178c10 commit d0b3440

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/m/exp/flowlines.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
% - 'precision': division of each segment (higer precision increases number of segments, default: 1)
1717
% - 'downstream':flow line upstream of the seed points (default: 1)
1818
% - 'upstream': flow line upstream of the seed points (default: 1)
19+
% - 'cutoff': velocity threshold to stop propagating flowlines (default: 0)
1920

2021
%check input
2122
if (length(x)~=length(y) | length(x)~=length(u) | length(x)~=length(v)),
@@ -34,6 +35,8 @@
3435
precision = getfieldvalue(options,'precision',1);
3536
downstream = getfieldvalue(options,'downstream',1);
3637
upstream = getfieldvalue(options,'upstream',1);
38+
cutoff = getfieldvalue(options,'cutoff', 0.0);
39+
cutoff = max(cutoff, 0.0);
3740

3841
%Create triangulation once for all and check seed points
3942
trep = triangulation(index,x,y);
@@ -98,7 +101,7 @@
98101
counter=counter+1;
99102

100103
%remove stagnant point
101-
done(queue(find(ut==0 & vt==0)))=1;
104+
done(queue(find((ut==0 & vt==0) | (normv<=cutoff))))=1;
102105

103106
%build next point
104107
for i=1:length(queue)
@@ -150,7 +153,7 @@
150153
counter=counter+1;
151154

152155
%remove stagnant point
153-
done(queue(find(ut==0 & vt==0)))=1;
156+
done(queue(find((ut==0 & vt==0) | (normv<=cutoff))))=1;
154157

155158
%build next point
156159
for i=1:length(queue)

0 commit comments

Comments
 (0)