Changeset 22935
- Timestamp:
- 07/13/18 14:18:37 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/mesh/meshintersect.m
r20126 r22935 12 12 13 13 %retrieve tolerance: 14 tolerance=getfieldvalue(options,'tolerance',1e- 10);14 tolerance=getfieldvalue(options,'tolerance',1e-5); 15 15 16 16 %go through lats,longs and find within tolerance, the index of the corresponding value in lat,long: … … 19 19 for i=1:length(lats), 20 20 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 22 37 end
Note:
See TracChangeset
for help on using the changeset viewer.