Changeset 12511 for issm/trunk-jpl/src/c/modules
- Timestamp:
- 06/22/12 11:30:03 (13 years ago)
- 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 24 24 25 25 // read mesh 26 if(verbose) printf("Reading mesh\n");26 if(verbose) _printLine_("Reading mesh"); 27 27 Mesh Th(index,x,y,nods,nels); 28 28 29 29 //write mesh and geometry 30 if (verbose) printf("Write Geometry\n");30 if (verbose) _printLine_("Write Geometry"); 31 31 Th.Gh.WriteGeometry(bamggeom,bamgopts); 32 if (verbose) printf("Write Mesh\n");32 if (verbose) _printLine_("Write Mesh"); 33 33 Th.WriteMesh(bamgmesh,bamgopts); 34 34 -
issm/trunk-jpl/src/c/modules/Bamgx/Bamgx.cpp
r12365 r12511 41 41 42 42 //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..."); 45 45 Geometry Gh(bamggeom_in,bamgopts); 46 46 … … 50 50 51 51 //build metric using geometry 52 if (verbosity>1) printf(" Generating Metric...\n");52 if (verbosity>1) _printLine_(" Generating Metric..."); 53 53 for(i=0;i<Gh.nbv;i++){ 54 54 Metric M=Gh[i]; … … 60 60 61 61 //generate mesh 62 if (verbosity>1) printf(" Generating Mesh...\n");62 if (verbosity>1) _printLine_(" Generating Mesh..."); 63 63 Mesh Th(maxnbv,Gh,bamgopts); 64 64 … … 73 73 74 74 //Build output 75 if (verbosity>1) printf(" Write Mesh...\n");75 if (verbosity>1) _printLine_(" Write Mesh..."); 76 76 Th.WriteMesh(bamgmesh_out,bamgopts); 77 if (verbosity>1) printf(" Write Geometry...\n");77 if (verbosity>1) _printLine_(" Write Geometry..."); 78 78 Gh.WriteGeometry(bamggeom_out,bamgopts); 79 79 … … 87 87 88 88 // 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..."); 91 91 Mesh BTh(bamggeom_in,bamgmesh_in,bamgopts); 92 92 … … 100 100 //Generate initial metric 101 101 if (bamgopts->metric){ 102 if (verbosity>1) printf(" Processing Metric...\n");102 if (verbosity>1) _printLine_(" Processing Metric..."); 103 103 BTh.ReadMetric(bamgopts); 104 104 } 105 105 else { 106 if (verbosity>1) printf(" Generating initial Metric...\n");106 if (verbosity>1) _printLine_(" Generating initial Metric..."); 107 107 Metric Mhmax(bamgopts->hmax); 108 108 for (int iv=0;iv<BTh.nbv;iv++) BTh[iv].m = Mhmax; … … 111 111 //use present fields to generate metric if present 112 112 if (bamgopts->field){ 113 if (verbosity>1) printf(" Merge metric with field provided...\n");113 if (verbosity>1) _printLine_(" Merge metric with field provided..."); 114 114 BTh.AddMetric(bamgopts); 115 115 } … … 117 117 // change using hVertices if provided 118 118 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..."); 120 120 for (i=0;i<BTh.nbv;i++){ 121 121 if (!isnan(bamgopts->hVertices[i])){ … … 127 127 // change using hminVertices if provided 128 128 if (bamgopts->hminVertices){ 129 if (verbosity>1) printf(" Merging Metric with hminVertices...\n");129 if (verbosity>1) _printLine_(" Merging Metric with hminVertices..."); 130 130 for (i=0;i<BTh.nbv;i++){ 131 131 if (!isnan(bamgopts->hminVertices[i])){ … … 140 140 // change using hmaxVertices if provided 141 141 if (bamgopts->hmaxVertices){ 142 if (verbosity>1) printf(" Merging Metric with hmaxVertices...\n");142 if (verbosity>1) _printLine_(" Merging Metric with hmaxVertices..."); 143 143 for (i=0;i<BTh.nbv;i++){ 144 144 if (!isnan(bamgopts->hmaxVertices[i])){ … … 164 164 165 165 //Build new mesh 166 if (verbosity>1) printf(" Generating Mesh...\n");166 if (verbosity>1) _printLine_(" Generating Mesh..."); 167 167 Thr=&BTh,Thb=0; 168 168 Mesh & Th( *(0 ? new Mesh(*Thr,&Thr->Gh,Thb,maxnbv) : new Mesh(maxnbv,BTh,bamgopts,bamgopts->KeepVertices))); … … 185 185 if(verbosity>0) { 186 186 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)); 188 188 } 189 189 if (Th.nbq ){ 190 printf(" new number of quads = %i\n",Th.nbq);190 _printLine_(" new number of quads = " << Th.nbq); 191 191 } 192 192 } 193 193 194 194 //Build output 195 if (verbosity>1) printf(" Write Mesh...\n");195 if (verbosity>1) _printLine_(" Write Mesh..."); 196 196 Th.WriteMesh(bamgmesh_out,bamgopts); 197 if (verbosity>1) printf(" Write Geometry...\n");197 if (verbosity>1) _printLine_(" Write Geometry..."); 198 198 Th.Gh.WriteGeometry(bamggeom_out,bamgopts); 199 if (verbosity>1) printf(" Write Metric...\n");199 if (verbosity>1) _printLine_(" Write Metric..."); 200 200 BTh.WriteMetric(bamgopts); 201 201 … … 207 207 208 208 /*No error return*/ 209 if (verbosity>1) printf(" Exiting Bamg.\n");209 if (verbosity>1) _printLine_(" Exiting Bamg."); 210 210 return noerr; 211 211 -
issm/trunk-jpl/src/c/modules/Chacox/Chacox.cpp
r11401 r12511 66 66 67 67 if (DEBUG_TRACE > 0) { 68 printf("<Entering main>\n");68 _printLine_("<Entering main>"); 69 69 } 70 70 71 71 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"); 74 74 } 75 75 … … 177 177 178 178 if (DEBUG_MEMORY > 0) { 179 printf("\n");179 _printLine_(""); 180 180 smalloc_stats(); 181 181 } … … 185 185 186 186 if (DEBUG_TRACE > 1) { 187 printf("<Leaving main>\n");187 _printLine_("<Leaving main>"); 188 188 } 189 189 -
issm/trunk-jpl/src/c/modules/Chacox/input_parse.cpp
r11401 r12511 38 38 39 39 if (DEBUG_TRACE > 0) { 40 printf("<Entering input_parse>\n");40 _printLine_("<Entering input_parse>"); 41 41 } 42 42 43 43 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"); 49 49 } 50 50 *architecture = (int)options[OPT_ARCH]; … … 57 57 /* Name output assignment file. */ 58 58 if (PROMPT) 59 printf("Assignment output file: ");59 _printString_("Assignment output file: "); 60 60 outassignname = NULL; 61 61 62 62 /* Name output results file. */ 63 63 if (PROMPT) 64 printf("File name for saving run results: ");64 _printString_("File name for saving run results: "); 65 65 outfilename = NULL; 66 66 … … 75 75 else { 76 76 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"); 85 85 } 86 86 *global_method = (int)options[OPT_GLOBAL]; … … 94 94 if (*global_method == 7) { /* Name and open input assignment file. */ 95 95 if (PROMPT) 96 printf("Assignment input file: ");96 _printString_("Assignment input file: "); 97 97 } 98 98 99 99 else if (*global_method == 3) { 100 100 if (PROMPT) 101 printf("Geometry input file name: ");101 _printString_("Geometry input file name: "); 102 102 } 103 103 104 104 else if (*global_method == 2) { 105 105 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"); 109 109 } 110 110 eigensolver = (int)options[OPT_RQI]; … … 117 117 if (MATCH_TYPE == 5) { /* geometric matching */ 118 118 if (PROMPT) 119 printf("Geometry input file name: ");119 _printString_("Geometry input file name: "); 120 120 } 121 121 *rqi_flag = 1; 122 122 if (PROMPT) 123 printf("Number of vertices to coarsen down to: ");123 _printString_("Number of vertices to coarsen down to: "); 124 124 *vmax = (int)options[OPT_VMAX]; 125 125 if (*vmax <= 0) { … … 137 137 if (MATCH_TYPE == 5) { /* geometric matching */ 138 138 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: "); 143 143 *vmax = (int)options[OPT_VMAX]; 144 144 if (*vmax <= 0) { … … 168 168 else { 169 169 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"); 173 173 } 174 174 *local_method = (int)options[OPT_LOCAL]; … … 185 185 *ndims_tot = 0; 186 186 if (PROMPT) 187 printf("Total number of target hypercube dimensions: ");187 _printString_("Total number of target hypercube dimensions: "); 188 188 *ndims_tot = nparts[0]; 189 189 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"); 191 191 printf("%s -- Number of divisions %d must be at least 1.\n", 192 192 __FUNCT__,nparts[0]); … … 200 200 if (*architecture == 2) { 201 201 if (PROMPT) 202 printf("X and Y extent of of 2-D mesh: ");202 _printString_("X and Y extent of of 2-D mesh: "); 203 203 mesh_dims[0] = nparts[0]; 204 204 mesh_dims[1] = nparts[1]; … … 206 206 else if (*architecture == 3) { 207 207 if (PROMPT) 208 printf("X, Y and Z extent of 3-D mesh: ");208 _printString_("X, Y and Z extent of 3-D mesh: "); 209 209 mesh_dims[0] = nparts[0]; 210 210 mesh_dims[1] = nparts[1]; … … 213 213 else { /* Anything else => 1-D mesh */ 214 214 if (PROMPT) 215 printf("Size of 1-D mesh: ");215 _printString_("Size of 1-D mesh: "); 216 216 mesh_dims[0] = nparts[0]; 217 217 *architecture = 1; … … 227 227 else if (*nprocs <= 7) { 228 228 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"); 232 232 } 233 233 *ndims = (int)options[OPT_NDIMS]; … … 240 240 else { 241 241 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"); 246 246 } 247 247 *ndims = (int)options[OPT_NDIMS]; -
issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp
r12495 r12511 110 110 /*Synthesize echo: {{{*/ 111 111 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_(""); 116 116 } 117 117 /*}}}*/ -
issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
r12493 r12511 58 58 _printf_(true,"Exp2Kmlx -- Reading %d exp profiles from file \"%s\".\n",nprof,filexp); 59 59 // 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]); 61 61 62 62 /* construct kml file */ -
issm/trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.cpp
r12507 r12511 76 76 } 77 77 } 78 printf( "\n" );79 printf("Number of zeroes remaining: %d",lines*samps-counter);78 _printLine_( "" ); 79 _printString_("Number of zeroes remaining: " << lines*samps-counter); 80 80 fflush( stdout ); 81 81 #endif … … 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 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); 99 99 fflush( stdout ); 100 100 #endif … … 104 104 /***************** FIRST RUN *********************/ 105 105 /* 106 fprintf ( stdout, "First Application: " ); time(&t2); printf( ctime(&t2) );106 fprintf ( stdout, "First Application: " ); time(&t2); _printString_( ctime(&t2) ); 107 107 */ 108 108 for ( i = 0; i < lines; i++ ){ … … 277 277 278 278 #ifdef _DEBUG2_ 279 // printf("%g %g %g \n",temp,elev,range);279 //_printLine_("" << temp << " " << elev << " " << range << " "); 280 280 #endif 281 281 … … 354 354 355 355 #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"); 358 358 printf ( "\n"); 359 359 #endif -
issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
r12507 r12511 175 175 break; 176 176 default: 177 printf("Interpolation %s not supported yet\n",EnumToStringx(interpenum));177 _printLine_("Interpolation " << EnumToStringx(interpenum) << " not supported yet"); 178 178 return NULL; /*WARNING: no error because it would blow up the multithreading!*/ 179 179 } -
issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
r12493 r12511 54 54 55 55 /*Initialize output*/ 56 if (verbose) printf("Initializing output vector\n");56 if (verbose) _printLine_("Initializing output vector"); 57 57 data_interp=xNew<double>(nods_interp*data_cols); 58 58 59 59 // read background mesh 60 if (verbose) printf("Reading mesh\n");60 if (verbose) _printLine_("Reading mesh"); 61 61 Mesh Th(index_data,x_data,y_data,nods_data,nels_data); 62 62 Th.CreateSingleVertexToTriangleConnectivity(); 63 63 64 64 //Loop over output nodes 65 if (verbose) printf("Loop over the nodes\n");65 if (verbose) _printLine_("Loop over the nodes"); 66 66 for(i=0;i<nods_interp;i++){ 67 67 … … 138 138 139 139 /*Assign output pointers:*/ 140 if (verbose) printf("Assigning output\n");140 if (verbose) _printLine_("Assigning output"); 141 141 *pdata_interp=data_interp; 142 142 -
issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
r12507 r12511 66 66 observations->ObservationList(&x,&y,&data,&nobs); 67 67 68 printf("Generation Delaunay Triangulation\n");68 _printLine_("Generation Delaunay Triangulation"); 69 69 BamgTriangulatex(&index,&nel,x,y,nobs); 70 70 indexd =xNewZeroInit<double>(nel*3); … … 72 72 xDelete<int>(index); 73 73 74 printf("Interpolating\n");74 _printLine_("Interpolating"); 75 75 xDelete<double>(predictions); 76 76 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 57 57 58 58 if (itm >= NPDMAX){ 59 printf("increase NPDMAX in massBalance.cpp\n");59 _printLine_("increase NPDMAX in massBalance.cpp"); 60 60 exit (1); 61 61 } … … 83 83 itm = (int)((PDCUT+2.*siglimc)/DT + 1.5); 84 84 if (itm >= NPDCMAX){ 85 printf("'increase NPDCMAX in p35com'\n");85 _printLine_("'increase NPDCMAX in p35com'"); 86 86 exit (1); 87 87 }
Note:
See TracChangeset
for help on using the changeset viewer.