Ignore:
Timestamp:
05/11/16 14:56:07 (8 years ago)
Author:
ymipsl
Message:

Remapper : manage some floating rounding error leading to some NAN

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/extern/remap/src/intersection_ym.cpp

    r845 r849  
    144144       is->area = polygonarea(intersectPolygon,nv) ; 
    145145//        if (is->area < 1e-12) cout<<"Small intersection : "<<is->area<<endl ; 
    146        is->id = b->id; /* intersection holds id of corresponding source element (see Elt class definition for details about id) */ 
    147        is->src_id = b->src_id; 
    148        is->n = nv; 
    149        (a->is).push_back(is); 
    150        (b->is).push_back(is); 
    151        area=is->area ; 
     146       if (is->area==0.) delete is ; 
     147       else 
     148       {   
     149         is->id = b->id; /* intersection holds id of corresponding source element (see Elt class definition for details about id) */ 
     150         is->src_id = b->src_id; 
     151         is->n = nv; 
     152         (a->is).push_back(is); 
     153         (b->is).push_back(is); 
     154         area=is->area ; 
     155       } 
    152156    } 
    153157    delete[] intersectPolygon ; 
Note: See TracChangeset for help on using the changeset viewer.