Changeset 22935


Ignore:
Timestamp:
07/13/18 14:18:37 (7 years ago)
Author:
Eric.Larour
Message:

CHG: many more warnings and debug statements at runtime.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/mesh/meshintersect.m

    r20126 r22935  
    1212
    1313        %retrieve tolerance:
    14         tolerance=getfieldvalue(options,'tolerance',1e-10);
     14        tolerance=getfieldvalue(options,'tolerance',1e-5);
    1515
    1616        %go through lats,longs and find within tolerance, the index of the corresponding value in lat,long:
     
    1919        for i=1:length(lats),
    2020                distance=sqrt((lat-lats(i)).^2+(long-longs(i)).^2);
    21                 indices(i)=find(distance<tolerance);
     21                s=find(distance<tolerance);
     22                if length(s)>1,
     23                        indices(i)=s(1);
     24                        format long
     25                        [lats(i) longs(i)]
     26                        for j=1:length(s),
     27                                [lat(s(j)) long(s(j))]
     28                        end
     29                        error('one or more vertices on the global mesh were duplicated!');
     30                elseif isempty(s),
     31                        plot(distance)
     32                        min(distance)
     33                        error('could not find vertices in common, relax tolerance?');
     34                else
     35                        indices(i)=s;
     36                end
    2237        end
Note: See TracChangeset for help on using the changeset viewer.