Changeset 6965
- Timestamp:
- 01/06/11 09:13:32 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/shared/Exp/IsInPoly.cpp
r5016 r6965 22 22 double x0,y0; 23 23 double value; 24 double xmin=xc[0]; 25 double xmax=xc[0]; 26 double ymin=yc[0]; 27 double ymax=yc[0]; 28 29 /*Get extrema*/ 30 for (i=1;i<numgrids;i++){ 31 if(xc[i]<xmin) xmin=xc[i]; 32 if(xc[i]>xmax) xmax=xc[i]; 33 if(yc[i]<ymin) ymin=yc[i]; 34 if(yc[i]>ymax) ymax=yc[i]; 35 } 24 36 25 37 /*Go through all grids of the mesh:*/ … … 35 47 /*pick up grid (x[i],y[i]) and figure out if located inside contour (xc,yc)*/ 36 48 x0=x[i]; y0=y[i]; 37 value=pnpoly(numgrids,xc,yc,x0,y0,edgevalue); 49 if(x0<xmin || x0>xmax || y0<ymin || y0>ymax){ 50 value=0; 51 } 52 else{ 53 value=pnpoly(numgrids,xc,yc,x0,y0,edgevalue); 54 } 38 55 VecSetValues(in,1,&i,&value,INSERT_VALUES); 39 56 }
Note:
See TracChangeset
for help on using the changeset viewer.