source: issm/oecreview/Archive/12321-12677/ISSM-12506-12507.diff@ 12679

Last change on this file since 12679 was 12679, checked in by Mathieu Morlighem, 13 years ago

Added 12321-12677

File size: 27.0 KB
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h

     
    4949/* _printLine_ {{{*/
    5050/* macro to print a line, adds std::endl */
    5151#define _printLine_(StreamArgs)\
    52    {std::cout << StreamArgs << std::endl;}
     52   do{std::cout << StreamArgs << std::endl;}while(0)
    5353/*}}}*/
    5454/* _printString_ {{{*/
    5555/* macro to print some string, adds std::ends */
    5656#define _printString_(StreamArgs)\
    57    {std::cout << StreamArgs;}
     57   do{std::cout << StreamArgs;}while(0)
    5858/*}}}*/
    5959/* _assert_ {{{*/
    6060/*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp

     
    1414#include "../../io/io.h"
    1515#include "../../shared/shared.h"
    1616#include <float.h>
     17#include <iomanip>
    1718
    1819void BrentSearch(IssmDouble* psearch_scalar,IssmDouble* pJ,OptPars* optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs* optargs){
    1920
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h

     
    2929#endif
    3030
    3131inline void printarray(IssmDouble* array,int lines,int cols=1){
    32         printf("\n");
     32        _printLine_("");
    3333        for(int i=0;i<lines;i++){ 
    34                 printf("   [ ");
    35                 for(int j=0;j<cols;j++) printf(" %12.7g ",array[i*cols+j]);
    36                 printf(" ]\n");
     34                _printString_("   [ ");
     35                for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
     36                _printLine_(" ]");
    3737        } 
    38         printf("\n");
     38        _printLine_("");
    3939}
    4040inline void printarray(int* array,int lines,int cols=1){
    41         printf("\n");
     41        _printLine_("");
    4242        for(int i=0;i<lines;i++){ 
    43                 printf("   [ ");
    44                 for(int j=0;j<cols;j++) printf(" %6i",array[i*cols+j]);
    45                 printf(" ]\n");
     43                _printString_("   [ ");
     44                for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
     45                _printLine_(" ]");
    4646        } 
    47         printf("\n");
     47        _printLine_("");
    4848}
    4949inline void printbinary(int n) {
    5050        unsigned int i=1L<<(sizeof(n)*8-1);
    51 
    5251        while (i>0) {
    5352                if (n&i)
    54                  printf("1");
     53                 _printString_("1");
    5554                else
    56                  printf("0");
     55                 _printString_("0");
    5756                i>>=1;
    5857        }
    5958}
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp

     
    1616        int interpolation_type;
    1717        bool debug;
    1818        int  nels_data;
    19         double* index_data=NULL;
    20         double* x_data=NULL;
    21         double* y_data=NULL;
    22         double* data=NULL;
    23         double xmin,xmax;
    24         double ymin,ymax;
    25         int    nods_prime;
    26         Vector*    data_prime=NULL;
    27         double* x_prime=NULL;
    28         double* y_prime=NULL;
    29         double* default_values=NULL;
     19        double *index_data         = NULL;
     20        double *x_data             = NULL;
     21        double *y_data             = NULL;
     22        double *data               = NULL;
     23        double  xmin                 ,xmax;
     24        double  ymin                 ,ymax;
     25        int     nods_prime;
     26        Vector *data_prime         = NULL;
     27        double *x_prime            = NULL;
     28        double *y_prime            = NULL;
     29        double *default_values     = NULL;
    3030        int     num_default_values;
    31         double*    incontour=NULL;
     31        double *incontour          = NULL;
    3232
    3333        /*intermediary: */
    3434        int     i0;
     
    4545        num_threads=handle->num;
    4646       
    4747        /*recover parameters :*/
    48         interpolation_type=gate->interpolation_type;
    49         debug=gate->debug;
    50         nels_data=gate->nels_data;
    51         index_data=gate->index_data;
    52         x_data=gate->x_data;
    53         y_data=gate->y_data;
    54         data=gate->data;
    55         xmin=gate->xmin;
    56         xmax=gate->xmax;
    57         ymin=gate->ymin;
    58         ymax=gate->ymax;
    59         nods_prime=gate->nods_prime;
    60         data_prime=gate->data_prime;
    61         x_prime=gate->x_prime;
    62         y_prime=gate->y_prime;
    63         default_values=gate->default_values;
    64         num_default_values=gate->num_default_values;
    65         incontour=gate->incontour;
     48        interpolation_type = gate->interpolation_type;
     49        debug              = gate->debug;
     50        nels_data          = gate->nels_data;
     51        index_data         = gate->index_data;
     52        x_data             = gate->x_data;
     53        y_data             = gate->y_data;
     54        data               = gate->data;
     55        xmin               = gate->xmin;
     56        xmax               = gate->xmax;
     57        ymin               = gate->ymin;
     58        ymax               = gate->ymax;
     59        nods_prime         = gate->nods_prime;
     60        data_prime         = gate->data_prime;
     61        x_prime            = gate->x_prime;
     62        y_prime            = gate->y_prime;
     63        default_values     = gate->default_values;
     64        num_default_values = gate->num_default_values;
     65        incontour          = gate->incontour;
    6666
    6767        /*partition loop across threads: */
    6868        PartitionRange(&i0,&i1,nels_data,num_threads,my_thread);
    6969
    7070        /*Loop over the elements*/
    71         if (debug && my_thread==0) printf("      interpolation progress:   %5.2lf %%",0.0);
    72 
    7371        for (i=i0;i<i1;i++){
    7472
    7573                /*display current iteration*/
    76                 if (debug && my_thread==0 && fmod((double)i,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100*num_threads);
     74                if (debug && my_thread==0 && fmod((double)i,(double)100)==0)
     75                 _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<double(i-i0)/double(i1-i0)*100<<"%");
    7776
    7877                /*if there is no point inside the domain, go to next iteration*/
    7978                if ( (x_data[(int)index_data[3*i+0]-1]<xmin) && (x_data[(int)index_data[3*i+1]-1]<xmin) && (x_data[(int)index_data[3*i+2]-1]<xmin)) continue;
     
    124123                        }
    125124                }
    126125        }
    127         if (debug && my_thread==0) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
    128        
     126        if(debug && my_thread==0)
     127         _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    129128        return NULL;
    130 
    131129}
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp

     
    8484        }
    8585
    8686        /*Loop over the elements*/
    87         if (debug) printf("      interpolation progress:   %5.2lf %%",0.0);
    8887        for (n=0;n<nels;n++){
    8988
    9089                /*display current iteration*/
    91                 if (debug && fmod((double)n,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)n/nels*100);
     90                if (debug && fmod((double)n,(double)100)==0)
     91                 _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<double(n)/double(nels)*100<<"%");
    9292
    9393                /*Get extrema coordinates of current elements*/
    9494                x_tria_min=x_mesh[(int)index_mesh[3*n+0]-1]; x_tria_max=x_tria_min;
     
    167167                        }
    168168                }
    169169        }
    170         if (debug) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
     170        if (debug)
     171         _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    171172
    172173        /*Assign output pointers:*/
    173174        *pgriddata=griddata;
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.cpp

     
    7676                        }
    7777                }
    7878                printf( "\n" );
    79                 printf("Number of zeroes remaining: %10ld",lines*samps-counter);
     79                printf("Number of zeroes remaining: %d",lines*samps-counter);
    8080                fflush( stdout );
    8181        #endif
    8282
     
    9595                }
    9696                //        n u m b e r   o f   z e r o e s   r e m a i n i n g :   1 2 3 4 5 6 7 8 9 10       
    9797                printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
    98                 printf("Number of zeroes remaining: %10ld",lines*samps-counter);
     98                printf("Number of zeroes remaining: %d",lines*samps-counter);
    9999                fflush( stdout );
    100100        #endif
    101101       
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp

     
    9595
    9696                /*launch the thread manager with Krigingxt as a core: */
    9797                LaunchThread(NearestNeighbort,(void*)&gate,num);
    98                 printf("\r      interpolation progress:  100.00%%\n");
     98                _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    9999                xDelete<double>(gate.percent);
    100100        }
    101101        else if(strcmp(output,"idw")==0){ //Inverse distance weighting
     
    114114
    115115                /*launch the thread manager with Krigingxt as a core: */
    116116                LaunchThread(idwt,(void*)&gate,num);
    117                 printf("\r      interpolation progress:  100.00%%\n");
     117                _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    118118                xDelete<double>(gate.percent);
    119119        }
    120120        else if(strcmp(output,"prediction")==0){
     
    134134
    135135                /*launch the thread manager with Krigingxt as a core: */
    136136                LaunchThread(Krigingxt,(void*)&gate,num);
    137                 printf("\r      interpolation progress:  100.00%%\n");
     137                _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    138138                xDelete<double>(gate.percent);
    139139        }
    140140        else{
     
    189189                percent[my_thread]=double(idx-i0)/double(i1-i0)*100.;
    190190                localpercent=percent[0];
    191191                for(int i=1;i<num_threads;i++) localpercent=min(localpercent,percent[i]);
    192                 printf("\r      interpolation progress: %5.2lf%%",localpercent);
     192                _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<localpercent<<"%");
    193193
    194194                /*Kriging interpolation*/
    195195                observations->InterpolationKriging(&predictions[idx],&error[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,variogram);
     
    238238                percent[my_thread]=double(idx-i0)/double(i1-i0)*100.;
    239239                localpercent=percent[0];
    240240                for(i=1;i<num_threads;i++) localpercent=min(localpercent,percent[i]);
    241                 printf("\r      interpolation progress: %5.2lf%%",localpercent);
     241                _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<localpercent<<"%");
    242242
    243243                observations->InterpolationNearestNeighbor(&predictions[idx],x_interp[idx],y_interp[idx],radius);
    244244        }
     
    286286                percent[my_thread]=double(idx-i0)/double(i1-i0)*100.;
    287287                localpercent=percent[0];
    288288                for(int i=1;i<num_threads;i++) localpercent=min(localpercent,percent[i]);
    289                 printf("\r      interpolation progress: %5.2lf%%",localpercent);
     289                _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<localpercent<<"%");
    290290
    291291                observations->InterpolationIDW(&predictions[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,power);
    292292        }
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp

     
    5757        for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_value,INS_VAL);
    5858
    5959        /*Loop over the elements*/
    60         if (debug) printf("      interpolation progress:   %5.2lf %%",0.0);
    6160        for (i=0;i<nels_data;i++){
    6261
    6362                /*display current iteration*/
    64                 if (debug && fmod((double)i,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100);
     63                if (debug && fmod((double)i,(double)100)==0)
     64                 _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<double(i)/double(nels_data)*100<<"%");
    6565
    6666                /*Get extrema coordinates of current elements*/
    6767                x_tria_min=x_data[(int)index_data[6*i+0]-1]; x_tria_max=x_tria_min;
     
    131131                        }
    132132                }
    133133        }
    134         if (debug) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
     134        if (debug)
     135         _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    135136
    136137        /*Assign output pointers:*/
    137138        *pdata_prime=data_prime;
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp

     
    123123        double *x             = gate->x;
    124124        double *y             = gate->y;
    125125        int     nods          = gate->nods;
    126         Vector*     data_mesh     = gate->data_mesh;
     126        Vector *data_mesh     = gate->data_mesh;
    127127        double *data          = gate->data;
    128128        double  default_value = gate->default_value;
    129129        int     interpenum    = gate->interp;
    130130        int     M             = gate->M;
    131131        int     N             = gate->N;
    132132
     133        bool debug = M*N>1? true:false;
     134        debug = true;
     135
    133136        /*partition loop across threads: */
    134137        PartitionRange(&i0,&i1,nods,num_threads,my_thread);
    135138        for (i=i0;i<i1;i++) {
    136139
     140                if(debug && my_thread==0)
     141                 _printLine_("\r      interpolation progress: "<<setw(5)<<setprecision(2)<<double(i-i0)/double(i1-i0)*100<<"%%");
    137142                x_grid=*(x_mesh+i);
    138143                y_grid=*(y_mesh+i);
    139144
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp

     
    4444        PartitionRange(&i0,&i1,nods,num_threads,my_thread);
    4545
    4646        /*Loop over the nodes*/
    47         if (my_thread==0) printf("      loop progress:   %5.2lf %%",0.0);
    48 
    4947        for (i=i0;i<i1;i++){
    5048
    5149                /*display current iteration*/
    52                 if (my_thread==0 && fmod((double)i,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nods*100*num_threads);
     50                if (my_thread==0 && fmod((double)i,(double)100)==0)
     51                 _printString_("\r      loop progress: "<<setw(6)<<setprecision(2)<<double(i-i0)/double(i1-i0)*100<<"%");
    5352
    5453                distance=mindistance+100; //make sure initialization respects min distance criterion.
    5554                for (j=0;j<nods;j++){
     
    6968                        }
    7069                }
    7170        }
    72         if (my_thread==0) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
     71        if (my_thread==0)
     72         _printLine_("\r      loop progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    7373
    7474        /*Free ressources:*/
    7575        xDelete<bool>(already);
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp

     
    376376void ElementMatrix::Echo(void){
    377377
    378378        int i,j;
    379         printf("Element Matrix echo: \n");
    380         printf("   nrows: %i\n",nrows);
    381         printf("   ncols: %i\n",ncols);
    382         printf("   dofsymmetrical: %s\n",dofsymmetrical?"true":"false");
     379        _printLine_("Element Matrix echo:");
     380        _printLine_("   nrows: " << nrows);
     381        _printLine_("   ncols: " << nrows);
     382        _printLine_("   dofsymmetrical: " << (dofsymmetrical?"true":"false"));
    383383
    384         printf("   values: \n");
     384        _printLine_("   values:");
    385385        for(i=0;i<nrows;i++){
    386                 printf("      %i: ",i);
    387                 for(j=0;j<ncols;j++) printf("%10g ",*(values+ncols*i+j));
    388                 printf("\n");
     386                _printString_(setw(4) << right << i << ": ");
     387                for(j=0;j<ncols;j++) _printString_( " " << setw(11) << setprecision (5) << right << values[i*ncols+j]);
     388                _printLine_("");
    389389        }
    390390
    391         printf("   gglobaldoflist (%p): ",gglobaldoflist);
    392         if(gglobaldoflist) for(i=0;i<nrows;i++)printf("%i ",gglobaldoflist[i]); printf("\n");
     391        _printString_("   gglobaldoflist (" << gglobaldoflist << "): ");
     392        if(gglobaldoflist) for(i=0;i<nrows;i++) _printString_(" " << gglobaldoflist[i]); _printLine_("");
    393393
    394         printf("   row_fsize: %i\n",row_fsize);
    395         printf("   row_flocaldoflist (%p): ",row_flocaldoflist);
    396         if(row_flocaldoflist) for(i=0;i<row_fsize;i++)printf("%i ",row_flocaldoflist[i]); printf("\n");
    397         printf("   row_fglobaldoflist (%p): ",row_fglobaldoflist);
    398         if(row_fglobaldoflist)for(i=0;i<row_fsize;i++)printf("%i ",row_fglobaldoflist[i]); printf("\n");
     394        _printLine_("   row_fsize: " << row_fsize);
     395        _printString_("   row_flocaldoflist  (" << row_flocaldoflist << "): ");
     396        if(row_flocaldoflist) for(i=0;i<row_fsize;i++) _printString_(" " << row_flocaldoflist[i]); _printLine_(" ");
     397        _printString_("   row_fglobaldoflist  (" << row_fglobaldoflist << "): ");
     398        if(row_fglobaldoflist) for(i=0;i<row_fsize;i++) _printString_(" " << row_fglobaldoflist[i]); _printLine_(" ");
    399399
    400         printf("   row_ssize: %i\n",row_ssize);
    401         printf("   row_slocaldoflist (%p): ",row_slocaldoflist);
    402         if(row_slocaldoflist)for(i=0;i<row_ssize;i++)printf("%i ",row_slocaldoflist[i]); printf("\n");
    403         printf("   row_sglobaldoflist (%p): ",row_sglobaldoflist);
    404         if(row_sglobaldoflist)for(i=0;i<row_ssize;i++)printf("%i ",row_sglobaldoflist[i]); printf("\n");
     400        _printLine_("   row_ssize: " << row_ssize);
     401        _printString_("   row_slocaldoflist  (" << row_slocaldoflist << "): ");
     402        if(row_slocaldoflist) for(i=0;i<row_ssize;i++) _printString_(" " << row_slocaldoflist[i]); _printLine_(" ");
     403        _printString_("   row_sglobaldoflist  (" << row_sglobaldoflist << "): ");
     404        if(row_sglobaldoflist) for(i=0;i<row_ssize;i++) _printString_(" " << row_sglobaldoflist[i]); _printLine_(" ");
    405405
    406406        if(!dofsymmetrical){
    407                 printf("   col_fsize: %i\n",col_fsize);
    408                 printf("   col_flocaldoflist (%p): ",col_flocaldoflist);
    409                 if(col_flocaldoflist)for(i=0;i<col_fsize;i++)printf("%i ",col_flocaldoflist[i]); printf("\n");
    410                 printf("   col_fglobaldoflist (%p): ",col_fglobaldoflist);
    411                 if(col_fglobaldoflist)for(i=0;i<col_fsize;i++)printf("%i ",col_fglobaldoflist[i]); printf("\n");
     407                _printLine_("   col_fsize: " << col_fsize);
     408                _printString_("   col_flocaldoflist  (" << col_flocaldoflist << "): ");
     409                if(col_flocaldoflist) for(i=0;i<col_fsize;i++) _printString_(" " << col_flocaldoflist[i]); _printLine_(" ");
     410                _printString_("   col_fglobaldoflist  (" << col_fglobaldoflist << "): ");
     411                if(col_fglobaldoflist) for(i=0;i<col_fsize;i++) _printString_(" " << col_fglobaldoflist[i]); _printLine_(" ");
    412412
    413                 printf("   col_ssize: %i\n",col_ssize);
    414                 printf("   col_slocaldoflist (%p): ",col_slocaldoflist);
    415                 if(col_slocaldoflist)for(i=0;i<col_ssize;i++)printf("%i ",col_slocaldoflist[i]); printf("\n");
    416                 printf("   col_sglobaldoflist (%p): ",col_sglobaldoflist);
    417                 if(col_sglobaldoflist)for(i=0;i<col_ssize;i++)printf("%i ",col_sglobaldoflist[i]); printf("\n");
     413                _printLine_("   col_ssize: " << col_ssize);
     414                _printString_("   col_slocaldoflist  (" << col_slocaldoflist << "): ");
     415                if(col_slocaldoflist) for(i=0;i<col_ssize;i++) _printString_(" " << col_slocaldoflist[i]); _printLine_(" ");
     416                _printString_("   col_sglobaldoflist  (" << col_sglobaldoflist << "): ");
     417                if(col_sglobaldoflist) for(i=0;i<col_ssize;i++) _printString_(" " << col_sglobaldoflist[i]); _printLine_(" ");
    418418        }
    419419}
    420420/*}}}*/
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementVector.cpp

     
    221221        int i,j;
    222222        _printLine_("Element Vector echo:");
    223223        _printLine_("   nrows: " << nrows);
    224 
    225         _printLine_("   test:");
    226         for(i=0;i<nrows;i++) _printString_(" " << i);
    227         _printLine_("HERE");
    228 
    229224        _printLine_("   values:");
    230225        for(i=0;i<nrows;i++){
    231226                _printLine_(setw(4) << right << i << ": " << setw(10) << values[i]);
     
    236231        _printLine_(" ");
    237232
    238233        _printLine_("   fsize: " << fsize);
    239         printf("   flocaldoflist (%p): ",flocaldoflist);
    240         if(flocaldoflist) for(i=0;i<fsize;i++)printf("%i ",flocaldoflist[i]); printf("\n");
    241         printf("   fglobaldoflist (%p): ",fglobaldoflist);
    242         if(fglobaldoflist)for(i=0;i<fsize;i++)printf("%i ",fglobaldoflist[i]); printf("\n");
     234        _printString_("   flocaldoflist  (" << flocaldoflist << "): ");
     235        if(flocaldoflist) for(i=0;i<fsize;i++) _printString_(" " << flocaldoflist[i] );
     236        _printLine_(" ");
     237        _printString_("   fglobaldoflist (" << fglobaldoflist << "): ");
     238        if(fglobaldoflist) for(i=0;i<fsize;i++) _printString_(" " << fglobaldoflist[i] );
     239        _printLine_(" ");
    243240}
    244241/*}}}*/
    245242/*FUNCTION ElementVector::Init{{{*/
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp

     
    7676        printf("   time: %g\n",this->time);
    7777        printf("   matrix size: %i-%i\n",this->M,this->N);
    7878        for (i=0;i<this->M;i++){ 
    79                 printf("   [ ");
     79                _printString_("   [ ");
    8080                for (j=0;j<this->N;j++){
    81                         printf(" %12.6g ",this->values[i*this->N+j]);
     81                        _printString_( " " << setw(11) << setprecision (5) << this->values[i*this->N+j]);
    8282                } 
    83                 printf(" ]\n");
     83                _printLine_(" ]");
    8484        } 
    85         printf("\n");
    8685
    8786}
    8887/*}}}*/
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp

     
    24042404                printf("   nbq = %i\n",nbq);
    24052405                printf("   index:\n");
    24062406                for (i=0;i<nbt;i++){
    2407                         printf("   %4i: [%4i %4i %4i]\n",i+1,
    2408                                                 ((BamgVertex *)triangles[i](0))?GetId(triangles[i][0])+1:0,
    2409                                                 ((BamgVertex *)triangles[i](1))?GetId(triangles[i][1])+1:0,
    2410                                                 ((BamgVertex *)triangles[i](2))?GetId(triangles[i][2])+1:0);
     2407                        _printLine_("   " << setw(4) << i+1 << ": ["
     2408                                                << setw(4) << (((BamgVertex *)triangles[i](0))?GetId(triangles[i][0])+1:0) << " "
     2409                                                << setw(4) << (((BamgVertex *)triangles[i](0))?GetId(triangles[i][1])+1:0) << " "
     2410                                                << setw(4) << (((BamgVertex *)triangles[i](0))?GetId(triangles[i][2])+1:0) << "]");
    24112411                }
    24122412                printf("   coordinates:\n");
    24132413                for (i=0;i<nbv;i++){
    2414                         printf("   %4i: [%g %g]\n",i+1,vertices[i].r.x,vertices[i].r.y);
     2414                        _printLine_("   " << setw(4) << i+1 << ": [" << vertices[i].r.x << " " << vertices[i].r.y << "]");
    24152415                }
    24162416
    24172417        }
     
    40664066        printf("      length of edge in   | %% of edge  | Nb of edges \n");
    40674067        printf("      --------------------+-------------+-------------\n");
    40684068        for   (i=0;i<=kmax;i++){
    4069                 if (i==0) printf("      %10i",0);
    4070                 else      printf("      %10g",exp(lmin+i/delta));
     4069                if (i==0) _printString_( "      " << setw(10) << 0.);
     4070                else      _printString_( "      " << setw(10) << exp(lmin+i/delta));
    40714071                if (i==kmax) printf("          +inf   ");
    4072                 else printf("      %10g",exp(lmin+(i+1)/delta));
    4073                 printf("|  %10g |\n",((long)  ((10000.0 * histo[i])/ nbedges))/100.0);
     4072                else      _printString_( "      " << setw(10) << exp(lmin+(i+1)/delta));
     4073                _printLine_("|  " << setw(10) << (long((10000. * histo[i])/ nbedges)/100.) << " |");
    40744074                printf("  %i\n",histo[i]);
    40754075        }
    40764076        printf("      --------------------+-------------+-------------\n");
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp

     
    6565        if (!(  (nlhs==6) || (nrhs==5))){
    6666                mexPrintf("   %s format error.\n", __FUNCT__);
    6767                TriMeshProcessRiftsUsage();
    68                 printf("   ");
    69                 mexErrMsgTxt(" ");
     68                _error_("bad usage");
    7069        }
    7170
    7271        /*Fetch index_in: */
     
    8180                }
    8281        }
    8382        else{
    84                 printf("%s%s\n",__FUNCT__," error message: first argument should be the element list!");
    85                 mexErrMsgTxt(" ");
     83                _error_("first argument should be the element list");
    8684        }
    8785
    8886        /*Fetch x_in: */
     
    9593                }
    9694        }
    9795        else{
    98                 printf("%s%s\n",__FUNCT__," error message: second argument should be the x corrdinate list!");
    99                 mexErrMsgTxt(" ");
     96                _error_("second argument should be the x corrdinate list");
    10097        }
    10198
    10299        /*Fetch y_in: */
     
    108105                }
    109106        }
    110107        else{
    111                 printf("%s%s\n",__FUNCT__," error message: third argument should be the y corrdinate list!");
    112                 mexErrMsgTxt(" ");
     108                _error_("third argument should be the y corrdinate list");
    113109        }       
    114110
    115111        /*Fetch segments_in: */
     
    124120                }
    125121        }
    126122        else{
    127                 printf("%s%s\n",__FUNCT__," error message: fourth argument should be the segments list!");
    128                 mexErrMsgTxt(" ");
     123                _error_("fourth argument should be the segments list");
    129124        }
    130125
    131126        /*Fetch segment markers: */
     
    137132                }
    138133        }
    139134        else{
    140                 printf("%s%s\n",__FUNCT__," error message: fourth argument should be the segmentmarkers list!");
    141                 mexErrMsgTxt(" ");
     135                _error_("fourth argument should be the segmentmarkers list");
    142136        }
    143137
    144         /*
    145         printf("Index: \n");
    146         for (i=0;i<nel;i++){
    147                 for(j=0;j<3;j++){
    148                         printf("%lf ",*(index_in+3*i+j));
    149                 }
    150                 printf("\n");
    151         }
    152         printf("x,y: \n");
    153         for (i=0;i<nods;i++){
    154                 printf("%16.16lf %16.16lf\n",x_in[i],y_in[i]);
    155         }
    156         printf("segments:\n");
    157         for (i=0;i<num_seg;i++){
    158                 for(j=0;j<3;j++){
    159                         printf("%lf ",*(segments_in+3*i+j));
    160                 }
    161                 printf("%lf ",segmentmarkers_in[i]);
    162                 printf("\n");
    163         }
    164         */
    165 
    166138        /*First, do some fixing on the existing mesh: we do not want any element belonging entirely to the segment list (ie:
    167139         *all the nodes of this element belong to the segments (tends to happen when there are corners: */
    168140        RemoveCornersFromRifts(&index_in,&nel,&x_in,&y_in,&nods,segments_in,segmentmarkers_in,num_seg);
Note: See TracBrowser for help on using the repository browser.