Changeset 291


Ignore:
Timestamp:
05/07/09 08:32:18 (16 years ago)
Author:
Mathieu Morlighem
Message:

Fixed Geography (keep previous value of several contours) + cosmetics

Location:
issm/trunk/src/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ContourToMeshx/ContourToMeshx.cpp

    r1 r291  
    3131        for (i=0;i<numcontours;i++){
    3232                #ifdef _DEBUG_
    33                         printf("Handling contour %i/%i\n",i,numcontours);
     33                        printf("\nHandling contour %i/%i\n",i,numcontours);
    3434                #endif
    3535                contouri=*(contours+i);
  • issm/trunk/src/c/shared/Exp/IsInPoly.cpp

    r1 r291  
    66#include "../../toolkits/toolkits.h"
    77#include "./exp.h"
     8#include "../shared.h"
     9
    810
    911
    1012int IsInPoly(Vec in,double* xc,double* yc,int numgrids,double* x,double* y,int nods, int edgevalue){
    1113
    12         int i,j;
     14        int i;
    1315        double x0,y0;
    1416        double value;
     
    1618        /*Go through all grids of the mesh:*/
    1719        for (i=MPI_Lowerrow(nods);i<MPI_Upperrow(nods);i++){
    18                 /*pick up grid: */
    19                 x0=x[i];
    20                 y0=y[i];
    21                 if (pnpoly(numgrids,xc,yc,x0,y0,edgevalue)){
    22                         value=1;
     20
     21                //Get current value of value[i] -> do not change it if != 0
     22                VecGetValues(in,1,&i,&value);
     23                if (value){
     24                        /*this grid already is inside one of the contours, continue*/
     25                        continue;
    2326                }
    24                 else{
    25                         value=0;
    26                 }
     27
     28                /*pick up grid (x[i],y[i]) and figure out if located inside contour (xc,yc)*/
     29                x0=x[i]; y0=y[i];
     30                value=pnpoly(numgrids,xc,yc,x0,y0,edgevalue);
    2731                VecSetValues(in,1,&i,&value,INSERT_VALUES);
    2832        }
Note: See TracChangeset for help on using the changeset viewer.