Commit b7d33143 authored by Pierre Cazenave's avatar Pierre Cazenave

Set the preallocated time step array to infinite values instead of

a very large value.

Minor typos fixed.
parent bf929086
......@@ -61,7 +61,7 @@ tri = Mobj.tri;
nVerts = Mobj.nVerts;
nElems = Mobj.nElems;
ts = ones(nVerts,1)*1e9;
ts = inf(nVerts,1);
lside = zeros(nVerts,1);
for i=1:nElems
n1 = tri(i,1);
......@@ -71,14 +71,14 @@ for i=1:nElems
% Check whether we have x and y values and use great circle
% approximations if we don't.
if Mobj.have_xy
lside(i) = sqrt( (x(n1)-x(n2))^2 + (y(n1)-y(n2))^2);
lside(i) = sqrt((x(n1)-x(n2))^2 + (y(n1)-y(n2))^2);
else
lside(i) = haversine(x(n1),y(n1),x(n2),y(n2));
end
dpth = max(h(nds))+zeta;
dpth = max(dpth,1);
ts(nds) = min(ts(nds),lside(i)/(sqrt(g*dpth) + u));
end;
end
if(ftbverbose); fprintf('minimum time step: %f seconds\n',min(ts)); end;
Mobj.ts = ts;
Mobj.have_ts = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment