Changeset 21314


Ignore:
Timestamp:
10/26/16 11:01:48 (8 years ago)
Author:
Mathieu Morlighem
Message:

BUG: was not working properly when the exp file has multiple contours'

Location:
issm/trunk-jpl/src/c/modules/ExpToLevelSetx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/ExpToLevelSetx/ExpToLevelSetx.cpp

    r19010 r21314  
    1717        /*output: */
    1818        double*  distance;
    19         distance   = xNewZeroInit<double>(nods);
     19        distance = xNew<double>(nods);
     20        for(int i=0;i<nods;i++) distance[i]=1e50;
    2021
    2122        /*initialize thread parameters: */
     
    2324        gate.contours  = contours;
    2425        gate.nods      = nods;
    25         gate.distance    = distance;
     26        gate.distance  = distance;
    2627        gate.x         = x;
    2728        gate.y         = y;
  • issm/trunk-jpl/src/c/modules/ExpToLevelSetx/ExpToLevelSetxt.cpp

    r19010 r21314  
    5858
    5959                /*Figure out distance from (x0,y0) to contour: */
    60                 mind=INFINITY;
     60                mind=1e+50;
    6161                for (j=0;j<contournods-1;j++){
    6262                        x1=contourx[j]; y1=contoury[j];
     
    6464                        mind=min(mind,minimum_distance(x1,y1,x2,y2,x0,y0));
    6565                }
    66                 dist[i]=mind;
     66                dist[i]=min(dist[i],mind);
    6767        }
    6868
Note: See TracChangeset for help on using the changeset viewer.