Ignore:
Timestamp:
06/22/12 11:30:03 (13 years ago)
Author:
Mathieu Morlighem
Message:

replaced all printf to _printString and _printLine

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

Legend:

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

    r5208 r12511  
    2424
    2525        // read mesh
    26         if(verbose) printf("Reading mesh\n");
     26        if(verbose) _printLine_("Reading mesh");
    2727        Mesh Th(index,x,y,nods,nels);
    2828
    2929        //write mesh and geometry
    30         if (verbose) printf("Write Geometry\n");
     30        if (verbose) _printLine_("Write Geometry");
    3131        Th.Gh.WriteGeometry(bamggeom,bamgopts);
    32         if (verbose) printf("Write Mesh\n");
     32        if (verbose) _printLine_("Write Mesh");
    3333        Th.WriteMesh(bamgmesh,bamgopts);
    3434
  • issm/trunk-jpl/src/c/modules/Bamgx/Bamgx.cpp

    r12365 r12511  
    4141
    4242                //Step1: generate geometry Gh
    43                 if (verbosity>0) printf("Construction of a mesh from a given geometry\n");
    44                 if (verbosity>1) printf("   Processing geometry...\n");
     43                if (verbosity>0) _printLine_("Construction of a mesh from a given geometry");
     44                if (verbosity>1) _printLine_("   Processing geometry...");
    4545                Geometry Gh(bamggeom_in,bamgopts);
    4646
     
    5050
    5151                //build metric using geometry
    52                 if (verbosity>1) printf("   Generating Metric...\n");
     52                if (verbosity>1) _printLine_("   Generating Metric...");
    5353                for(i=0;i<Gh.nbv;i++){
    5454                        Metric M=Gh[i];
     
    6060
    6161                //generate mesh
    62                 if (verbosity>1) printf("   Generating Mesh...\n");
     62                if (verbosity>1) _printLine_("   Generating Mesh...");
    6363                Mesh Th(maxnbv,Gh,bamgopts);
    6464
     
    7373
    7474                //Build output
    75                 if (verbosity>1) printf("   Write Mesh...\n");
     75                if (verbosity>1) _printLine_("   Write Mesh...");
    7676                Th.WriteMesh(bamgmesh_out,bamgopts);
    77                 if (verbosity>1) printf("   Write Geometry...\n");
     77                if (verbosity>1) _printLine_("   Write Geometry...");
    7878                Gh.WriteGeometry(bamggeom_out,bamgopts);
    7979
     
    8787
    8888                // read background mesh
    89                 if (verbosity>0) printf("Anisotropic mesh adaptation\n");
    90                 if (verbosity>1) printf("   Processing initial mesh and geometry...\n");
     89                if (verbosity>0) _printLine_("Anisotropic mesh adaptation");
     90                if (verbosity>1) _printLine_("   Processing initial mesh and geometry...");
    9191                Mesh BTh(bamggeom_in,bamgmesh_in,bamgopts);
    9292
     
    100100                //Generate initial metric
    101101                if (bamgopts->metric){
    102                         if (verbosity>1) printf("   Processing Metric...\n");
     102                        if (verbosity>1) _printLine_("   Processing Metric...");
    103103                        BTh.ReadMetric(bamgopts);
    104104                }
    105105                else {
    106                         if (verbosity>1) printf("   Generating initial Metric...\n");
     106                        if (verbosity>1) _printLine_("   Generating initial Metric...");
    107107                        Metric Mhmax(bamgopts->hmax);
    108108                        for (int iv=0;iv<BTh.nbv;iv++) BTh[iv].m = Mhmax;
     
    111111                //use present fields to generate metric if present
    112112                if (bamgopts->field){
    113                         if (verbosity>1) printf("   Merge metric with field provided...\n");
     113                        if (verbosity>1) _printLine_("   Merge metric with field provided...");
    114114                        BTh.AddMetric(bamgopts);
    115115                }
     
    117117                // change using hVertices if provided
    118118                if(bamgopts->hVertices && bamgopts->hVerticesSize[0]==BTh.nbv){
    119                         if (verbosity>1) printf("   Merging Metric with hVertices...\n");
     119                        if (verbosity>1) _printLine_("   Merging Metric with hVertices...");
    120120                        for (i=0;i<BTh.nbv;i++){
    121121                                if (!isnan(bamgopts->hVertices[i])){
     
    127127                // change using hminVertices if provided
    128128                if (bamgopts->hminVertices){
    129                         if (verbosity>1) printf("   Merging Metric with hminVertices...\n");
     129                        if (verbosity>1) _printLine_("   Merging Metric with hminVertices...");
    130130                        for (i=0;i<BTh.nbv;i++){
    131131                                if (!isnan(bamgopts->hminVertices[i])){
     
    140140                // change using hmaxVertices if provided
    141141                if (bamgopts->hmaxVertices){
    142                         if (verbosity>1) printf("   Merging Metric with hmaxVertices...\n");
     142                        if (verbosity>1) _printLine_("   Merging Metric with hmaxVertices...");
    143143                        for (i=0;i<BTh.nbv;i++){
    144144                                if (!isnan(bamgopts->hmaxVertices[i])){
     
    164164
    165165                //Build new mesh
    166                 if (verbosity>1) printf("   Generating Mesh...\n");
     166                if (verbosity>1) _printLine_("   Generating Mesh...");
    167167                Thr=&BTh,Thb=0;
    168168                Mesh & Th( *(0 ?  new Mesh(*Thr,&Thr->Gh,Thb,maxnbv) :  new Mesh(maxnbv,BTh,bamgopts,bamgopts->KeepVertices)));
     
    185185                if(verbosity>0) {
    186186                        if (Th.nbt-Th.nbtout-Th.nbq*2){
    187                                 printf("   new number of triangles = %i\n",(Th.nbt-Th.nbtout-Th.nbq*2));
     187                                _printLine_("   new number of triangles = " << (Th.nbt-Th.nbtout-Th.nbq*2));
    188188                        }
    189189                        if (Th.nbq ){
    190                                 printf("   new number of quads = %i\n",Th.nbq);
     190                                _printLine_("   new number of quads = " << Th.nbq);
    191191                        }
    192192                }
    193193
    194194                //Build output
    195                 if (verbosity>1) printf("   Write Mesh...\n");
     195                if (verbosity>1) _printLine_("   Write Mesh...");
    196196                Th.WriteMesh(bamgmesh_out,bamgopts);
    197                 if (verbosity>1) printf("   Write Geometry...\n");
     197                if (verbosity>1) _printLine_("   Write Geometry...");
    198198                Th.Gh.WriteGeometry(bamggeom_out,bamgopts);
    199                 if (verbosity>1) printf("   Write Metric...\n");
     199                if (verbosity>1) _printLine_("   Write Metric...");
    200200                BTh.WriteMetric(bamgopts);
    201201
     
    207207
    208208        /*No error return*/
    209         if (verbosity>1) printf("   Exiting Bamg.\n");
     209        if (verbosity>1) _printLine_("   Exiting Bamg.");
    210210        return noerr;
    211211
  • issm/trunk-jpl/src/c/modules/Chacox/Chacox.cpp

    r11401 r12511  
    6666
    6767        if (DEBUG_TRACE > 0) {
    68                 printf("<Entering main>\n");
     68                _printLine_("<Entering main>");
    6969        }
    7070
    7171        if (PRINT_HEADERS) {
    72                 printf("\n                    Chaco 2.0\n");
    73                 printf("          Sandia National Laboratories\n\n");
     72                _printLine_("\n                    Chaco 2.0");
     73                _printLine_("          Sandia National Laboratories\n");
    7474        }
    7575
     
    177177
    178178        if (DEBUG_MEMORY > 0) {
    179                 printf("\n");
     179                _printLine_("");
    180180                smalloc_stats();
    181181        }
     
    185185
    186186        if (DEBUG_TRACE > 1) {
    187                 printf("<Leaving main>\n");
     187                _printLine_("<Leaving main>");
    188188        }
    189189       
  • issm/trunk-jpl/src/c/modules/Chacox/input_parse.cpp

    r11401 r12511  
    3838
    3939        if (DEBUG_TRACE > 0) {
    40                 printf("<Entering input_parse>\n");
     40                _printLine_("<Entering input_parse>");
    4141        }
    4242
    4343        if (PROMPT) {
    44                 printf("Parallel machine architecture:\n");
    45                 printf("  (0) Hypercube\n");
    46                 printf("  (1) One-dimensional mesh\n");
    47                 printf("  (2) Two-dimensional mesh\n");
    48                 printf("  (3) Three-dimensional mesh\n");
     44                _printLine_("Parallel machine architecture:");
     45                _printLine_("  (0) Hypercube");
     46                _printLine_("  (1) One-dimensional mesh");
     47                _printLine_("  (2) Two-dimensional mesh");
     48                _printLine_("  (3) Three-dimensional mesh");
    4949        }
    5050        *architecture = (int)options[OPT_ARCH];
     
    5757        /* Name output assignment file. */
    5858        if (PROMPT)
    59                 printf("Assignment output file: ");
     59                _printString_("Assignment output file: ");
    6060        outassignname = NULL;
    6161
    6262        /* Name output results file. */
    6363        if (PROMPT)
    64                 printf("File name for saving run results: ");
     64                _printString_("File name for saving run results: ");
    6565        outfilename = NULL;
    6666
     
    7575        else {
    7676                if (PROMPT) {
    77                         printf("Global partitioning method:\n");
    78                         printf("  (1) Multilevel-KL\n");
    79                         printf("  (2) Spectral\n");
    80                         printf("  (3) Inertial\n");
    81                         printf("  (4) Linear\n");
    82                         printf("  (5) Random\n");
    83                         printf("  (6) Scattered\n");
    84                         printf("  (7) Read-from-file\n");
     77                        _printLine_("Global partitioning method:");
     78                        _printLine_("  (1) Multilevel-KL");
     79                        _printLine_("  (2) Spectral");
     80                        _printLine_("  (3) Inertial");
     81                        _printLine_("  (4) Linear");
     82                        _printLine_("  (5) Random");
     83                        _printLine_("  (6) Scattered");
     84                        _printLine_("  (7) Read-from-file");
    8585                }
    8686                *global_method = (int)options[OPT_GLOBAL];
     
    9494        if (*global_method == 7) {      /* Name and open input assignment file. */
    9595                if (PROMPT)
    96                         printf("Assignment input file: ");
     96                        _printString_("Assignment input file: ");
    9797        }
    9898
    9999        else if (*global_method == 3) {
    100100                if (PROMPT)
    101                         printf("Geometry input file name: ");
     101                        _printString_("Geometry input file name: ");
    102102        }
    103103
    104104        else if (*global_method == 2) {
    105105                if (PROMPT) {
    106                         printf("Eigensolver:\n");
    107                         printf("  (1) Multilevel RQI/Symmlq\n");
    108                         printf("  (2) Lanczos\n");
     106                        _printLine_("Eigensolver:");
     107                        _printLine_("  (1) Multilevel RQI/Symmlq");
     108                        _printLine_("  (2) Lanczos");
    109109                }
    110110                eigensolver = (int)options[OPT_RQI];
     
    117117                        if (MATCH_TYPE == 5) {  /* geometric matching */
    118118                                if (PROMPT)
    119                                         printf("Geometry input file name: ");
     119                                        _printString_("Geometry input file name: ");
    120120                        }
    121121                        *rqi_flag = 1;
    122122                        if (PROMPT)
    123                                 printf("Number of vertices to coarsen down to: ");
     123                                _printString_("Number of vertices to coarsen down to: ");
    124124                        *vmax = (int)options[OPT_VMAX];
    125125                        if (*vmax <= 0) {
     
    137137                if (MATCH_TYPE == 5) {          /* geometric matching */
    138138                        if (PROMPT)
    139                                 printf("Geometry input file name: ");
    140                 }
    141                 if (PROMPT)
    142                         printf("Number of vertices to coarsen down to: ");
     139                                _printString_("Geometry input file name: ");
     140                }
     141                if (PROMPT)
     142                        _printString_("Number of vertices to coarsen down to: ");
    143143                *vmax = (int)options[OPT_VMAX];
    144144                if (*vmax <= 0) {
     
    168168        else {
    169169                if (PROMPT) {
    170                         printf("Local refinement method:\n");
    171                         printf("  (1) Kernighan-Lin\n");
    172                         printf("  (2) None\n");
     170                        _printLine_("Local refinement method:");
     171                        _printLine_("  (1) Kernighan-Lin");
     172                        _printLine_("  (2) None");
    173173                }
    174174                *local_method = (int)options[OPT_LOCAL];
     
    185185                *ndims_tot = 0;
    186186                if (PROMPT)
    187                         printf("Total number of target hypercube dimensions: ");
     187                        _printString_("Total number of target hypercube dimensions: ");
    188188                *ndims_tot = nparts[0];
    189189                if (*ndims_tot < 1) {
    190                         printf(" Number of divisions must be at least 1\n");
     190                        _printLine_(" Number of divisions must be at least 1");
    191191                        printf("%s -- Number of divisions %d must be at least 1.\n",
    192192                                   __FUNCT__,nparts[0]);
     
    200200                if (*architecture == 2) {
    201201                        if (PROMPT)
    202                                 printf("X and Y extent of of 2-D mesh: ");
     202                                _printString_("X and Y extent of of 2-D mesh: ");
    203203                        mesh_dims[0] = nparts[0];
    204204                        mesh_dims[1] = nparts[1];
     
    206206                else if (*architecture == 3) {
    207207                        if (PROMPT)
    208                                 printf("X, Y and Z extent of 3-D mesh: ");
     208                                _printString_("X, Y and Z extent of 3-D mesh: ");
    209209                        mesh_dims[0] = nparts[0];
    210210                        mesh_dims[1] = nparts[1];
     
    213213                else {                  /* Anything else => 1-D mesh */
    214214                        if (PROMPT)
    215                                 printf("Size of 1-D mesh: ");
     215                                _printString_("Size of 1-D mesh: ");
    216216                        mesh_dims[0] = nparts[0];
    217217                        *architecture = 1;
     
    227227        else if (*nprocs <= 7) {
    228228                if (PROMPT) {
    229                         printf("Partitioning dimension: \n");
    230                         printf("  (1) Bisection\n");
    231                         printf("  (2) Quadrisection\n");
     229                        _printLine_("Partitioning dimension: ");
     230                        _printLine_("  (1) Bisection");
     231                        _printLine_("  (2) Quadrisection");
    232232                }
    233233                *ndims = (int)options[OPT_NDIMS];
     
    240240        else {
    241241                if (PROMPT) {
    242                         printf("Partitioning dimension: \n");
    243                         printf("  (1) Bisection\n");
    244                         printf("  (2) Quadrisection\n");
    245                         printf("  (3) Octasection\n");
     242                        _printLine_("Partitioning dimension: ");
     243                        _printLine_("  (1) Bisection");
     244                        _printLine_("  (2) Quadrisection");
     245                        _printLine_("  (3) Octasection");
    246246                }
    247247                *ndims = (int)options[OPT_NDIMS];
  • issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp

    r12495 r12511  
    110110        /*Synthesize echo: {{{*/
    111111        if(my_rank==0){
    112                 printf("   responses: %i: ",d_numresponses);
    113                 for(i=0;i<d_numresponses-1;i++)printf("%g|",d_responses[i]);
    114                 printf("%g",d_responses[d_numresponses-1]);
    115                 printf("\n");
     112                _printString_("   responses: " << d_numresponses << ": ");
     113                for(i=0;i<d_numresponses-1;i++)_printString_("" << d_responses[i] << "|");
     114                _printString_("" << d_responses[d_numresponses-1]);
     115                _printLine_("");
    116116        }
    117117        /*}}}*/
  • issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp

    r12493 r12511  
    5858        _printf_(true,"Exp2Kmlx -- Reading %d exp profiles from file \"%s\".\n",nprof,filexp);
    5959//      for (i=0; i<nprof; i++)
    60 //              printf("i=%d; nvert=%d, closed=%d\n",i,pnvert[i],closed[i]);
     60//              _printLine_("i=" << i << "; nvert=" << pnvert[i] << ", closed=" << closed[i]);
    6161
    6262/*  construct kml file  */
  • issm/trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.cpp

    r12507 r12511  
    7676                        }
    7777                }
    78                 printf( "\n" );
    79                 printf("Number of zeroes remaining: %d",lines*samps-counter);
     78                _printLine_( "" );
     79                _printString_("Number of zeroes remaining: " << lines*samps-counter);
    8080                fflush( stdout );
    8181        #endif
     
    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       
    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: %d",lines*samps-counter);
     97                _printString_( "\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                _printString_("Number of zeroes remaining: " << lines*samps-counter);
    9999                fflush( stdout );
    100100        #endif
     
    104104/***************** FIRST RUN *********************/
    105105/*
    106 fprintf ( stdout, "First  Application:  " ); time(&t2); printf( ctime(&t2) );
     106fprintf ( stdout, "First  Application:  " ); time(&t2); _printString_( ctime(&t2) );
    107107*/
    108108        for ( i = 0; i < lines; i++ ){
     
    277277                       
    278278                        #ifdef _DEBUG2_
    279                                 //printf("%g %g %g \n",temp,elev,range);
     279                                //_printLine_("" << temp << " " << elev << " " << range << " ");
    280280                        #endif
    281281
     
    354354       
    355355        #ifdef _DEBUG2_
    356                 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" );
    357                 printf("Number of zeroes remaining:          0\n\n");
     356                _printString_( "\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" );
     357                _printLine_("Number of zeroes remaining:          0\n");
    358358                printf ( "\n");
    359359        #endif
  • issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp

    r12507 r12511  
    175175                                        break;
    176176                                default:
    177                                         printf("Interpolation %s not supported yet\n",EnumToStringx(interpenum));
     177                                        _printLine_("Interpolation " << EnumToStringx(interpenum) << " not supported yet");
    178178                                        return NULL; /*WARNING: no error because it would blow up the multithreading!*/
    179179                        }
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp

    r12493 r12511  
    5454
    5555        /*Initialize output*/
    56         if (verbose) printf("Initializing output vector\n");
     56        if (verbose) _printLine_("Initializing output vector");
    5757        data_interp=xNew<double>(nods_interp*data_cols);
    5858
    5959        // read background mesh
    60         if (verbose) printf("Reading mesh\n");
     60        if (verbose) _printLine_("Reading mesh");
    6161        Mesh Th(index_data,x_data,y_data,nods_data,nels_data);
    6262        Th.CreateSingleVertexToTriangleConnectivity();
    6363
    6464        //Loop over output nodes
    65         if (verbose) printf("Loop over the nodes\n");
     65        if (verbose) _printLine_("Loop over the nodes");
    6666        for(i=0;i<nods_interp;i++){
    6767               
     
    138138
    139139        /*Assign output pointers:*/
    140         if (verbose) printf("Assigning output\n");
     140        if (verbose) _printLine_("Assigning output");
    141141        *pdata_interp=data_interp;
    142142
  • issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp

    r12507 r12511  
    6666                observations->ObservationList(&x,&y,&data,&nobs);
    6767
    68                 printf("Generation Delaunay Triangulation\n");
     68                _printLine_("Generation Delaunay Triangulation");
    6969                BamgTriangulatex(&index,&nel,x,y,nobs);
    7070                indexd =xNewZeroInit<double>(nel*3);
     
    7272                xDelete<int>(index);
    7373
    74                 printf("Interpolating\n");
     74                _printLine_("Interpolating");
    7575                xDelete<double>(predictions);
    7676                InterpFromMeshToMesh2dx(&predictions,indexd,x,y,nobs,nel,data,nobs,1,x_interp,y_interp,n_interp,NULL,0,new DataSet());
  • issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp

    r12470 r12511  
    5757 
    5858  if (itm >= NPDMAX){
    59     printf("increase NPDMAX in massBalance.cpp\n");
     59    _printLine_("increase NPDMAX in massBalance.cpp");
    6060    exit (1);
    6161      }
     
    8383  itm = (int)((PDCUT+2.*siglimc)/DT + 1.5);
    8484  if (itm >= NPDCMAX){
    85     printf("'increase NPDCMAX in p35com'\n");
     85    _printLine_("'increase NPDCMAX in p35com'");
    8686    exit (1);
    8787      }
Note: See TracChangeset for help on using the changeset viewer.