Changeset 12121


Ignore:
Timestamp:
04/24/12 21:45:58 (13 years ago)
Author:
Eric.Larour
Message:

Added new ContourToNodesx prototype to handle same functionality, but with DataSet* contours in input instead of just a simple Contour struct
Adapted InterpFromMeshToMesh2dx accordingly.

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

Legend:

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

    r11695 r12121  
    3838        return 1;
    3939}
     40
     41int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
     42
     43        int i;
     44        int m,n;
     45
     46        /*Contour:*/
     47        Contour* contouri=NULL;
     48        int      numnodes;
     49        double*  xc=NULL;
     50        double*  yc=NULL;
     51        double   value;
     52
     53        /*output: */
     54        Vector* flags=NULL;
     55
     56        flags=new Vector(nods);
     57
     58        /*Loop through all contours: */
     59        if(contours){
     60                for (i=0;i<contours->Size();i++){
     61                        Contour* contour=(Contour*)contours->GetObjectByOffset(i);
     62                        IsInPoly(flags,contour->x,contour->y,contour->nods,x,y,0,nods,edgevalue);
     63                }
     64        }
     65
     66        /*Assemble vector: */
     67        flags->Assemble();
     68
     69        /*Assign output pointers: */
     70        *pflags=flags;
     71       
     72        return 1;
     73}
  • TabularUnified issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h

    r11695 r12121  
    1212/* local prototypes: */
    1313int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
     14int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
    1415
    1516#endif /* _CONTOURTONODESX_H */
  • TabularUnified issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp

    r11695 r12121  
    1414
    1515int InterpFromMeshToMesh2dx(double** pdata_interp,double* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
    16                         double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values, Contour** contours, int numcontours){
     16                        double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values, DataSet* contours){
    1717       
    1818        /*Output*/
     
    3636        bool   skip_bamg=false;
    3737
    38 
    3938        /*Checks*/
    4039        if (data_cols<=0){
     
    5049        /*If default values supplied, figure out which nodes are inside the contour, including the border of the contour: */
    5150        if(num_default_values){
    52                 ContourToNodesx( &vec_incontour,x_interp,y_interp,nods_interp,contours,numcontours,1);
     51                ContourToNodesx( &vec_incontour,x_interp,y_interp,nods_interp,contours,1);
    5352                incontour=vec_incontour->ToMPISerial();
    5453        }
  • TabularUnified issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h

    r5032 r12121  
    1010/* local prototypes: */
    1111int InterpFromMeshToMesh2dx(double** pdata_interp,double* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
    12                         double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values,Contour** contours, int numcontours );
     12                        double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values,DataSet* contours);
    1313
    1414#endif
Note: See TracChangeset for help on using the changeset viewer.