source:
issm/oecreview/Archive/12321-12677/ISSM-12506-12507.diff@
12679
Last change on this file since 12679 was 12679, checked in by , 13 years ago | |
---|---|
File size: 27.0 KB |
-
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h
49 49 /* _printLine_ {{{*/ 50 50 /* macro to print a line, adds std::endl */ 51 51 #define _printLine_(StreamArgs)\ 52 {std::cout << StreamArgs << std::endl;}52 do{std::cout << StreamArgs << std::endl;}while(0) 53 53 /*}}}*/ 54 54 /* _printString_ {{{*/ 55 55 /* macro to print some string, adds std::ends */ 56 56 #define _printString_(StreamArgs)\ 57 {std::cout << StreamArgs;}57 do{std::cout << StreamArgs;}while(0) 58 58 /*}}}*/ 59 59 /* _assert_ {{{*/ 60 60 /*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/ -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp
14 14 #include "../../io/io.h" 15 15 #include "../../shared/shared.h" 16 16 #include <float.h> 17 #include <iomanip> 17 18 18 19 void BrentSearch(IssmDouble* psearch_scalar,IssmDouble* pJ,OptPars* optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs* optargs){ 19 20 -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h
29 29 #endif 30 30 31 31 inline void printarray(IssmDouble* array,int lines,int cols=1){ 32 printf("\n");32 _printLine_(""); 33 33 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_(" ]"); 37 37 } 38 printf("\n");38 _printLine_(""); 39 39 } 40 40 inline void printarray(int* array,int lines,int cols=1){ 41 printf("\n");41 _printLine_(""); 42 42 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_(" ]"); 46 46 } 47 printf("\n");47 _printLine_(""); 48 48 } 49 49 inline void printbinary(int n) { 50 50 unsigned int i=1L<<(sizeof(n)*8-1); 51 52 51 while (i>0) { 53 52 if (n&i) 54 printf("1");53 _printString_("1"); 55 54 else 56 printf("0");55 _printString_("0"); 57 56 i>>=1; 58 57 } 59 58 } -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp
16 16 int interpolation_type; 17 17 bool debug; 18 18 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; 30 30 int num_default_values; 31 double * incontour=NULL;31 double *incontour = NULL; 32 32 33 33 /*intermediary: */ 34 34 int i0; … … 45 45 num_threads=handle->num; 46 46 47 47 /*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; 66 66 67 67 /*partition loop across threads: */ 68 68 PartitionRange(&i0,&i1,nels_data,num_threads,my_thread); 69 69 70 70 /*Loop over the elements*/ 71 if (debug && my_thread==0) printf(" interpolation progress: %5.2lf %%",0.0);72 73 71 for (i=i0;i<i1;i++){ 74 72 75 73 /*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<<"%"); 77 76 78 77 /*if there is no point inside the domain, go to next iteration*/ 79 78 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; … … 124 123 } 125 124 } 126 125 } 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.<<"%"); 129 128 return NULL; 130 131 129 } -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp
84 84 } 85 85 86 86 /*Loop over the elements*/ 87 if (debug) printf(" interpolation progress: %5.2lf %%",0.0);88 87 for (n=0;n<nels;n++){ 89 88 90 89 /*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<<"%"); 92 92 93 93 /*Get extrema coordinates of current elements*/ 94 94 x_tria_min=x_mesh[(int)index_mesh[3*n+0]-1]; x_tria_max=x_tria_min; … … 167 167 } 168 168 } 169 169 } 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.<<"%"); 171 172 172 173 /*Assign output pointers:*/ 173 174 *pgriddata=griddata; -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.cpp
76 76 } 77 77 } 78 78 printf( "\n" ); 79 printf("Number of zeroes remaining: % 10ld",lines*samps-counter);79 printf("Number of zeroes remaining: %d",lines*samps-counter); 80 80 fflush( stdout ); 81 81 #endif 82 82 … … 95 95 } 96 96 // 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 97 97 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); 99 99 fflush( stdout ); 100 100 #endif 101 101 -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
95 95 96 96 /*launch the thread manager with Krigingxt as a core: */ 97 97 LaunchThread(NearestNeighbort,(void*)&gate,num); 98 printf("\r interpolation progress: 100.00%%\n");98 _printLine_("\r interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%"); 99 99 xDelete<double>(gate.percent); 100 100 } 101 101 else if(strcmp(output,"idw")==0){ //Inverse distance weighting … … 114 114 115 115 /*launch the thread manager with Krigingxt as a core: */ 116 116 LaunchThread(idwt,(void*)&gate,num); 117 printf("\r interpolation progress: 100.00%%\n");117 _printLine_("\r interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%"); 118 118 xDelete<double>(gate.percent); 119 119 } 120 120 else if(strcmp(output,"prediction")==0){ … … 134 134 135 135 /*launch the thread manager with Krigingxt as a core: */ 136 136 LaunchThread(Krigingxt,(void*)&gate,num); 137 printf("\r interpolation progress: 100.00%%\n");137 _printLine_("\r interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%"); 138 138 xDelete<double>(gate.percent); 139 139 } 140 140 else{ … … 189 189 percent[my_thread]=double(idx-i0)/double(i1-i0)*100.; 190 190 localpercent=percent[0]; 191 191 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<<"%"); 193 193 194 194 /*Kriging interpolation*/ 195 195 observations->InterpolationKriging(&predictions[idx],&error[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,variogram); … … 238 238 percent[my_thread]=double(idx-i0)/double(i1-i0)*100.; 239 239 localpercent=percent[0]; 240 240 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<<"%"); 242 242 243 243 observations->InterpolationNearestNeighbor(&predictions[idx],x_interp[idx],y_interp[idx],radius); 244 244 } … … 286 286 percent[my_thread]=double(idx-i0)/double(i1-i0)*100.; 287 287 localpercent=percent[0]; 288 288 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<<"%"); 290 290 291 291 observations->InterpolationIDW(&predictions[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,power); 292 292 } -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
57 57 for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_value,INS_VAL); 58 58 59 59 /*Loop over the elements*/ 60 if (debug) printf(" interpolation progress: %5.2lf %%",0.0);61 60 for (i=0;i<nels_data;i++){ 62 61 63 62 /*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<<"%"); 65 65 66 66 /*Get extrema coordinates of current elements*/ 67 67 x_tria_min=x_data[(int)index_data[6*i+0]-1]; x_tria_max=x_tria_min; … … 131 131 } 132 132 } 133 133 } 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.<<"%"); 135 136 136 137 /*Assign output pointers:*/ 137 138 *pdata_prime=data_prime; -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
123 123 double *x = gate->x; 124 124 double *y = gate->y; 125 125 int nods = gate->nods; 126 Vector *data_mesh = gate->data_mesh;126 Vector *data_mesh = gate->data_mesh; 127 127 double *data = gate->data; 128 128 double default_value = gate->default_value; 129 129 int interpenum = gate->interp; 130 130 int M = gate->M; 131 131 int N = gate->N; 132 132 133 bool debug = M*N>1? true:false; 134 debug = true; 135 133 136 /*partition loop across threads: */ 134 137 PartitionRange(&i0,&i1,nods,num_threads,my_thread); 135 138 for (i=i0;i<i1;i++) { 136 139 140 if(debug && my_thread==0) 141 _printLine_("\r interpolation progress: "<<setw(5)<<setprecision(2)<<double(i-i0)/double(i1-i0)*100<<"%%"); 137 142 x_grid=*(x_mesh+i); 138 143 y_grid=*(y_mesh+i); 139 144 -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp
44 44 PartitionRange(&i0,&i1,nods,num_threads,my_thread); 45 45 46 46 /*Loop over the nodes*/ 47 if (my_thread==0) printf(" loop progress: %5.2lf %%",0.0);48 49 47 for (i=i0;i<i1;i++){ 50 48 51 49 /*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<<"%"); 53 52 54 53 distance=mindistance+100; //make sure initialization respects min distance criterion. 55 54 for (j=0;j<nods;j++){ … … 69 68 } 70 69 } 71 70 } 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.<<"%"); 73 73 74 74 /*Free ressources:*/ 75 75 xDelete<bool>(already); -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp
376 376 void ElementMatrix::Echo(void){ 377 377 378 378 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")); 383 383 384 printf(" values: \n");384 _printLine_(" values:"); 385 385 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_(""); 389 389 } 390 390 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_(""); 393 393 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_(" "); 399 399 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_(" "); 405 405 406 406 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_(" "); 412 412 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_(" "); 418 418 } 419 419 } 420 420 /*}}}*/ -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementVector.cpp
221 221 int i,j; 222 222 _printLine_("Element Vector echo:"); 223 223 _printLine_(" nrows: " << nrows); 224 225 _printLine_(" test:");226 for(i=0;i<nrows;i++) _printString_(" " << i);227 _printLine_("HERE");228 229 224 _printLine_(" values:"); 230 225 for(i=0;i<nrows;i++){ 231 226 _printLine_(setw(4) << right << i << ": " << setw(10) << values[i]); … … 236 231 _printLine_(" "); 237 232 238 233 _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_(" "); 243 240 } 244 241 /*}}}*/ 245 242 /*FUNCTION ElementVector::Init{{{*/ -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp
76 76 printf(" time: %g\n",this->time); 77 77 printf(" matrix size: %i-%i\n",this->M,this->N); 78 78 for (i=0;i<this->M;i++){ 79 printf(" [ ");79 _printString_(" [ "); 80 80 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]); 82 82 } 83 printf(" ]\n");83 _printLine_(" ]"); 84 84 } 85 printf("\n");86 85 87 86 } 88 87 /*}}}*/ -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp
2404 2404 printf(" nbq = %i\n",nbq); 2405 2405 printf(" index:\n"); 2406 2406 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) << "]"); 2411 2411 } 2412 2412 printf(" coordinates:\n"); 2413 2413 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 << "]"); 2415 2415 } 2416 2416 2417 2417 } … … 4066 4066 printf(" length of edge in | %% of edge | Nb of edges \n"); 4067 4067 printf(" --------------------+-------------+-------------\n"); 4068 4068 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)); 4071 4071 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.) << " |"); 4074 4074 printf(" %i\n",histo[i]); 4075 4075 } 4076 4076 printf(" --------------------+-------------+-------------\n"); -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp
65 65 if (!( (nlhs==6) || (nrhs==5))){ 66 66 mexPrintf(" %s format error.\n", __FUNCT__); 67 67 TriMeshProcessRiftsUsage(); 68 printf(" "); 69 mexErrMsgTxt(" "); 68 _error_("bad usage"); 70 69 } 71 70 72 71 /*Fetch index_in: */ … … 81 80 } 82 81 } 83 82 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"); 86 84 } 87 85 88 86 /*Fetch x_in: */ … … 95 93 } 96 94 } 97 95 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"); 100 97 } 101 98 102 99 /*Fetch y_in: */ … … 108 105 } 109 106 } 110 107 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"); 113 109 } 114 110 115 111 /*Fetch segments_in: */ … … 124 120 } 125 121 } 126 122 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"); 129 124 } 130 125 131 126 /*Fetch segment markers: */ … … 137 132 } 138 133 } 139 134 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"); 142 136 } 143 137 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 166 138 /*First, do some fixing on the existing mesh: we do not want any element belonging entirely to the segment list (ie: 167 139 *all the nodes of this element belong to the segments (tends to happen when there are corners: */ 168 140 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.