Ignore:
Timestamp:
09/02/12 01:29:13 (13 years ago)
Author:
Eric.Larour
Message:

CHG: adjustments to compile the Matlab and Python modules when ADOLC is on.
Had to template MeshPartitionx, because it's used in both modules and the core code.
Had to template Contour too, same reason.
Had to default to ISSMPDouble type for modules such as InterpFromMesh2d* InterpFromGridToMeshx*, etc ..., which
only show up in the Matlab modules.

File:
1 edited

Legend:

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

    r13216 r13220  
    2020/*}}}*/
    2121
    22 void TriMeshx(Matrix<IssmDouble>** pindex,Vector<IssmDouble>** px,Vector<IssmDouble>** py,Matrix<IssmDouble>** psegments,Vector<IssmDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
     22void TriMeshx(Matrix<IssmPDouble>** pindex,Vector<IssmPDouble>** px,Vector<IssmPDouble>** py,Matrix<IssmPDouble>** psegments,Vector<IssmPDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
    2323
    2424        /*indexing: */
     
    2626
    2727        /*output: */
    28         double* index=NULL;
    29         Matrix<IssmDouble>* index_matrix=NULL;
     28        IssmPDouble* index=NULL;
     29        Matrix<IssmPDouble>* index_matrix=NULL;
    3030        double* x=NULL;
    3131        double* y=NULL;
    3232        double* segments=NULL;
    33         Matrix<IssmDouble>* segments_matrix=NULL;
     33        Matrix<IssmPDouble>* segments_matrix=NULL;
    3434        double* segmentmarkerlist=NULL;
    3535
    3636        /*intermediary: */
    3737        int      counter,counter2,backcounter;
    38         Contour* contour=NULL;
     38        Contour<IssmPDouble>* contour=NULL;
    3939
    4040        /* Triangle structures needed to call Triangle library routines: */
     
    4545        in.numberofpoints=0;
    4646        for (i=0;i<domain->Size();i++){
    47                 contour=(Contour*)domain->GetObjectByOffset(i);
     47                contour=(Contour<IssmPDouble>*)domain->GetObjectByOffset(i);
    4848                in.numberofpoints+=contour->nods-1;
    4949        }
    5050        for (i=0;i<rifts->Size();i++){
    51                 contour=(Contour*)rifts->GetObjectByOffset(i);
     51                contour=(Contour<IssmPDouble>*)rifts->GetObjectByOffset(i);
    5252                in.numberofpoints+=contour->nods;
    5353        }
     
    6161        counter=0;
    6262        for (i=0;i<domain->Size();i++){
    63                 contour=(Contour*)domain->GetObjectByOffset(i);
     63                contour=(Contour<IssmPDouble>*)domain->GetObjectByOffset(i);
    6464                for (j=0;j<contour->nods-1;j++){
    6565                        in.pointlist[2*counter+0]=contour->x[j];
     
    6969        }
    7070        for (i=0;i<rifts->Size();i++){
    71                 contour=(Contour*)rifts->GetObjectByOffset(i);
     71                contour=(Contour<IssmPDouble>*)rifts->GetObjectByOffset(i);
    7272                for (j=0;j<contour->nods;j++){
    7373                        in.pointlist[2*counter+0]=contour->x[j];
     
    8888        in.numberofsegments=0;
    8989        for (i=0;i<domain->Size();i++){
    90                 contour=(Contour*)domain->GetObjectByOffset(i);
     90                contour=(Contour<IssmPDouble>*)domain->GetObjectByOffset(i);
    9191                in.numberofsegments+=contour->nods-1;
    9292        }
    9393        for(i=0;i<rifts->Size();i++){
    94                 contour=(Contour*)rifts->GetObjectByOffset(i);
     94                contour=(Contour<IssmPDouble>*)rifts->GetObjectByOffset(i);
    9595                /*for rifts, we have one less segment as we have vertices*/
    9696                in.numberofsegments+=contour->nods-1;
     
    102102        backcounter=0;
    103103        for (i=0;i<domain->Size();i++){
    104                 contour=(Contour*)domain->GetObjectByOffset(i);
     104                contour=(Contour<IssmPDouble>*)domain->GetObjectByOffset(i);
    105105                for (j=0;j<contour->nods-2;j++){
    106106                        in.segmentlist[2*counter+0]=counter;
     
    118118        counter2=counter;
    119119        for (i=0;i<rifts->Size();i++){
    120                 contour=(Contour*)rifts->GetObjectByOffset(i);
     120                contour=(Contour<IssmPDouble>*)rifts->GetObjectByOffset(i);
    121121                for (j=0;j<(contour->nods-1);j++){
    122122                        in.segmentlist[2*counter2+0]=counter;
     
    137137                in.holelist = xNew<REAL>(in.numberofholes*2);
    138138                for (i=0;i<domain->Size()-1;i++){
    139                         contour=(Contour*)domain->GetObjectByOffset(i+1);
     139                        contour=(Contour<IssmPDouble>*)domain->GetObjectByOffset(i+1);
    140140                        GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],contour->nods-1,contour->x,contour->y);
    141141                }
     
    192192
    193193        /*Output : */
    194         index_matrix=new Matrix<IssmDouble>(index,out.numberoftriangles,3,1,SeqMatType);
     194        index_matrix=new Matrix<IssmPDouble>(index,out.numberoftriangles,3,1.0,SeqMatType);
    195195        *pindex=index_matrix;
    196196       
    197         segments_matrix=new Matrix<IssmDouble>(segments,out.numberofsegments,3,1,SeqMatType);
     197        segments_matrix=new Matrix<IssmPDouble>(segments,out.numberofsegments,3,1.0,SeqMatType);
    198198        *psegments=segments_matrix;
    199199
    200         *px=new Vector<IssmDouble>(x,out.numberofpoints,SeqMatType);
    201         *py=new Vector<IssmDouble>(y,out.numberofpoints,SeqMatType);
    202         *psegmentmarkerlist=new Vector<IssmDouble>(segmentmarkerlist,out.numberofsegments,SeqMatType);
     200        *px=new Vector<IssmPDouble>(x,out.numberofpoints,SeqMatType);
     201        *py=new Vector<IssmPDouble>(y,out.numberofpoints,SeqMatType);
     202        *psegmentmarkerlist=new Vector<IssmPDouble>(segmentmarkerlist,out.numberofsegments,SeqMatType);
    203203}
Note: See TracChangeset for help on using the changeset viewer.