Changeset 14965


Ignore:
Timestamp:
05/08/13 11:09:11 (12 years ago)
Author:
Eric.Larour
Message:

CHG: modified IsInPoly prototype, which triggered new dependency cyclicalities which had to be fixed.

Location:
issm/trunk-jpl/src
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Container/DataSet.h

    r14957 r14965  
    55#include <cstring>
    66#include "../classes/objects/Contour.h"
     7#include "../shared/Exp/exp.h"
    78
    89/*forward declarations */
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp

    r14656 r14965  
    1010#include "./ContourToMeshx.h"
    1111
    12 int ContourToMeshx(IssmSeqVec<double>** pin_nod,IssmSeqVec<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
     12int ContourToMeshx(double** pin_nod,double** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
    1313
    1414        /*Contour:*/
    15         double*  in_nod_serial;
    1615        double   value;
    1716
     
    2423
    2524        /*output: */
    26         IssmSeqVec<double>* in_nod=NULL;
    27         IssmSeqVec<double>* in_elem=NULL;
    28         in_nod  = new IssmSeqVec<double>(nods);
    29         in_elem = new IssmSeqVec<double>(nel);
     25        double*  in_nod;
     26        double*  in_elem;
     27        in_nod  = xNew<double>(nods);
     28        in_elem  = xNew<double>(nel);
    3029
    3130        /*initialize thread parameters: */
     
    4039        LaunchThread(ContourToMeshxt,(void*)&gate,num);
    4140
    42         /*Assemble in_nod: */
    43         in_nod->Assemble();
    44 
    45         /*Get in_nod serialised for next operation: */
    46         in_nod_serial=in_nod->ToMPISerial();
    47 
    4841        /*Take care of the case where an element interpolation has been requested: */
    4942        if ((strcmp(interptype,"element")==0) || (strcmp(interptype,"element and node")==0)){
    5043                for(int n=0;n<nel;n++){
    51                         if ( (in_nod_serial[ (int)*(index+3*n+0) -1] == 1) && (in_nod_serial[ (int)*(index+3*n+1) -1] == 1) && (in_nod_serial[ (int)*(index+3*n+2) -1] == 1) ){
    52                                 value=1; in_elem->SetValue(n,value,INS_VAL);
     44                        if ( (in_nod[ (int)*(index+3*n+0) -1] == 1) && (in_nod[ (int)*(index+3*n+1) -1] == 1) && (in_nod[ (int)*(index+3*n+2) -1] == 1) ){
     45                                value=1; in_elem[n]=value;
    5346                        }
    5447                }
    5548        }
    56 
    57         /*Assemble vectors: */
    58         in_elem->Assemble();
    5949
    6050        /*Assign output pointers: */
     
    6252        *pin_elem=in_elem;
    6353
    64         /*Free ressources:*/
    65         xDelete<double>(in_nod_serial);
    66 
    6754        return 1;
    6855}
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h

    r14656 r14965  
    1515        int    nods;
    1616        int    edgevalue;
    17         IssmSeqVec<double> *in_nod;
     17        double* in_nod;
    1818        double *x;
    1919        double *y;
     
    2222
    2323/* local prototypes: */
    24 int ContourToMeshx(IssmSeqVec<double>** pin_nods,IssmSeqVec<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
     24int ContourToMeshx(double** pin_nods,double** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
    2525
    2626void* ContourToMeshxt(void* vContourToMeshxThreadStruct);
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp

    r14656 r14965  
    3333        double* x=NULL;
    3434        double* y=NULL;
    35         IssmSeqVec<double>* in_nod=NULL;
     35        double* in_nod=NULL;
    3636
    3737        /*recover handle and gate: */
  • issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp

    r14656 r14965  
    44#include "./ContourToNodesx.h"
    55
    6 int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){
     6int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){
    77
    88        int i;
     
    1515
    1616        /*output: */
    17         IssmSeqVec<IssmPDouble>* flags=NULL;
    18         flags=new IssmSeqVec<IssmPDouble>(nods);
     17        IssmPDouble* flags=NULL;
     18        flags=xNew<IssmPDouble>(nods);
    1919
    2020        /*Loop through all contours: */
     
    2727        }
    2828
    29         /*Assemble vector: */
    30         flags->Assemble();
    31 
    3229        /*Assign output pointers: */
    3330        *pflags=flags;
     
    3532}
    3633
    37 int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
     34int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
    3835
    3936        /*Contour:*/
     
    4340
    4441        /*output: */
    45         IssmSeqVec<IssmPDouble>* flags=NULL;
    46         flags=new IssmSeqVec<IssmPDouble>(nods);
     42        IssmPDouble* flags=NULL;
     43        flags=xNew<IssmPDouble>(nods);
    4744
    4845        /*Loop through all contours: */
     
    5451        }
    5552
    56         /*Assemble vector: */
    57         flags->Assemble();
    58 
    5953        /*Assign output pointers: */
    6054        *pflags=flags;
  • issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h

    r14656 r14965  
    1010
    1111/* local prototypes: */
    12 int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue);
    13 int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
     12int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue);
     13int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
    1414
    1515#endif /* _CONTOURTONODESX_H */
  • issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp

    r14917 r14965  
    2525
    2626        /*contours: */
    27         IssmSeqVec<IssmPDouble> *vec_incontour = NULL;
    2827        double              *incontour     = NULL;
    2928
     
    7776        /*Build indices of contour: */
    7877        if(numcontours){
    79                 ContourToNodesx( &vec_incontour,x_prime,y_prime,nods_prime,contours,numcontours,1);
    80                 incontour=vec_incontour->ToMPISerial();
     78                ContourToNodesx( &incontour,x_prime,y_prime,nods_prime,contours,numcontours,1);
    8179        }
    8280        else{
  • issm/trunk-jpl/src/c/shared/Exp/exp.h

    r14953 r14965  
    88#include <cstring>
    99#include "../Numerics/recast.h"
    10 #include "../../toolkits/toolkits.h"
     10#include "../Exceptions/exceptions.h"
     11#include "../MemOps/MemOps.h"
    1112
    1213int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
     
    1415int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
    1516
    16 template <class doubletype> int IsInPoly(IssmSeqVec<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ /*{{{*/
     17template <class doubletype> int IsInPoly(doubletype* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ /*{{{*/
    1718
    1819        int i;
     
    3637
    3738                //Get current value of value[i] -> do not change it if != 0
    38                 in->GetValue(&value,i);
     39                value=in[i];
    3940                if (reCast<bool,doubletype>(value)){
    4041                        /*this vertex already is inside one of the contours, continue*/
     
    5051                        value=pnpoly(numvertices,xc,yc,x0,y0,edgevalue);
    5152                }
    52                 in->SetValue(i,value,INS_VAL);
     53                in[i]=value;
    5354        }
    5455         return 1;
  • issm/trunk-jpl/src/c/shared/io/Disk/WriteLockFile.cpp

    r14950 r14965  
    22 * \brief
    33 */
    4 #include <stdio.h>
    5 #include "../../shared.h"
     4#include "../../Exceptions/exceptions.h"
     5#include "../Comm/Comm.h"
     6#include "../Print/Print.h"
    67
    78void WriteLockFile(char* filename){
  • issm/trunk-jpl/src/c/shared/shared.h

    r14960 r14965  
    1111#include "./Enum/Enum.h"
    1212#include "./Exceptions/exceptions.h"
     13#include "./io/io.h"
    1314#include "./Exp/exp.h"
    1415#include "./Matrix/matrix.h"
  • issm/trunk-jpl/src/c/toolkits/mpi/patches/DetermineLocalSize.cpp

    r14915 r14965  
    66#include <math.h>
    77#include "../../../shared/shared.h"
    8 #include "../../../shared/Numerics/types.h"
    98
    109int DetermineLocalSize(int global_size,COMM comm){
  • issm/trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.cpp

    r14656 r14965  
    4040
    4141        /* output: */
    42         IssmSeqVec<double> *in_nod  = NULL;
    43         IssmSeqVec<double> *in_elem = NULL;
     42        double *in_nod  = NULL;
     43        double *in_elem = NULL;
    4444
    4545        /*Boot module: */
     
    7272        /* output: */
    7373        if (strcmp(interptype,"node")==0){
    74                 WriteData(PLHS0,in_nod);
     74                WriteData(PLHS0,in_nod,nods);
    7575                WriteData(PLHS1);
    7676        }
    7777        else if (strcmp(interptype,"element")==0){
    78                 WriteData(PLHS0,in_elem);
     78                WriteData(PLHS0,in_elem,nel);
    7979                WriteData(PLHS1);
    8080        }
    8181        else if (strcmp(interptype,"element and node")==0){
    82                 WriteData(PLHS0,in_nod);
    83                 WriteData(PLHS1,in_elem);
     82                WriteData(PLHS0,in_nod,nods);
     83                WriteData(PLHS1,in_elem,nel);
    8484        }
    8585        else _error_("wrong interpolation type");
  • issm/trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.h

    r14950 r14965  
    2525#include "../../c/shared/shared.h"
    2626#include "../../c/shared/io/io.h"
    27 #include "../../c/EnumDefinitions/EnumDefinitions.h"
     27#include "../../c/shared/Enum/Enum.h"
    2828
    2929#undef __FUNCT__
  • issm/trunk-jpl/src/wrappers/ContourToNodes/ContourToNodes.cpp

    r14656 r14965  
    2525
    2626        /* output: */
    27         IssmSeqVec<double> *flags = NULL;
     27        double *flags = NULL;
    2828
    2929        /*Boot module: */
     
    4343
    4444        /* output: */
    45         WriteData(FLAGS,flags);
     45        WriteData(FLAGS,flags,nods);
    4646
    4747        /*end module: */
  • issm/trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.h

    r14950 r14965  
    2525#include "../../c/shared/shared.h"
    2626#include "../../c/shared/io/io.h"
    27 #include "../../c/EnumDefinitions/EnumDefinitions.h"
     27#include "../../c/shared/Enum/Enum.h"
    2828
    2929#undef __FUNCT__
  • issm/trunk-jpl/src/wrappers/ElementConnectivity/ElementConnectivity.h

    r14950 r14965  
    2525#include "../../c/shared/shared.h"
    2626#include "../../c/shared/io/io.h"
    27 #include "../../c/EnumDefinitions/EnumDefinitions.h"
     27#include "../../c/shared/Enum/Enum.h"
    2828
    2929#undef __FUNCT__
  • issm/trunk-jpl/src/wrappers/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h

    r14950 r14965  
    2525#include "../../c/shared/shared.h"
    2626#include "../../c/shared/io/io.h"
    27 #include "../../c/EnumDefinitions/EnumDefinitions.h"
     27#include "../../c/shared/Enum/Enum.h"
    2828
    2929#undef __FUNCT__
  • issm/trunk-jpl/src/wrappers/NodeConnectivity/NodeConnectivity.h

    r14950 r14965  
    2828#include "../../c/shared/shared.h"
    2929#include "../../c/shared/io/io.h"
    30 #include "../../c/EnumDefinitions/EnumDefinitions.h"
     30#include "../../c/shared/Enum/Enum.h"
    3131
    3232#ifdef _HAVE_MATLAB_MODULES_
  • issm/trunk-jpl/src/wrappers/TriMesh/TriMesh.h

    r14950 r14965  
    2525#include "../../c/shared/shared.h"
    2626#include "../../c/shared/io/io.h"
    27 #include "../../c/EnumDefinitions/EnumDefinitions.h"
     27#include "../../c/shared/Enum/Enum.h"
    2828
    2929#undef __FUNCT__
  • issm/trunk-jpl/src/wrappers/python/io/WritePythonData.cpp

    r14917 r14965  
    1515#include "../../c/Container/Container.h"
    1616#include "../../c/shared/shared.h"
    17 #include "../../c/EnumDefinitions/EnumDefinitions.h"
     17#include "../../c/shared/Enum/Enum.h"
    1818
    1919/*Primitive data types*/
Note: See TracChangeset for help on using the changeset viewer.