Changeset 12513
- Timestamp:
- 06/22/12 16:26:04 (13 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/include/macros.h
r12512 r12513 69 69 do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \ 70 70 aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \ 71 PrintfFunction (aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)71 PrintfFunction2(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0) 72 72 /*}}}*/ 73 73 /* _assert_ {{{*/ -
issm/trunk-jpl/src/c/io/PrintfFunction.cpp
r12512 r12513 57 57 } 58 58 } 59 int PrintfFunction2(const string & message){ 60 extern int my_rank; 61 if(my_rank==0){ 62 printf("%s",message.c_str()); 63 } 64 } -
issm/trunk-jpl/src/c/io/io.h
r12512 r12513 16 16 int PrintfFunction(const char* format,...); 17 17 int PrintfFunction(const string & message); 18 int PrintfFunction2(const string & message); 18 19 19 20 #endif /* _IO_H_ */ -
issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp
r12493 r12513 46 46 void KML_GroundOverlay::Echo(){ 47 47 48 bool flag=true; 49 50 _printf_(flag,"KML_GroundOverlay:\n"); 48 _printLine_("KML_GroundOverlay:"); 51 49 KML_Overlay::Echo(); 52 50 53 _printf_(flag," altitude: %0.16g\n" ,altitude); 54 _printf_(flag," altmode: \"%s\"\n" ,altmode); 55 _printf_(flag," llbox: %p\n" ,llbox); 56 57 return; 51 _printLine_(" altitude: " << altitude); 52 _printLine_(" altmode: " << altmode); 53 _printLine_(" llbox: " << llbox); 58 54 } 59 55 /*}}}*/ 60 61 56 /*FUNCTION KML_GroundOverlay::DeepEcho {{{*/ 62 57 void KML_GroundOverlay::DeepEcho(){ … … 69 64 } 70 65 /*}}}*/ 71 72 66 /*FUNCTION KML_GroundOverlay::DeepEcho {{{*/ 73 67 void KML_GroundOverlay::DeepEcho(const char* indent){ … … 92 86 } 93 87 /*}}}*/ 94 95 88 /*FUNCTION KML_GroundOverlay::Write {{{*/ 96 89 void KML_GroundOverlay::Write(FILE* filout,const char* indent){ … … 119 112 } 120 113 /*}}}*/ 121 122 114 /*FUNCTION KML_GroundOverlay::Read {{{*/ 123 115 void KML_GroundOverlay::Read(FILE* fid,char* kstr){ … … 174 166 } 175 167 /*}}}*/ 176 -
issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp
r12512 r12513 67 67 /*FUNCTION KML_LatLonBox::DeepEcho {{{*/ 68 68 void KML_LatLonBox::DeepEcho(const char* indent){ 69 70 bool flag=true;71 69 72 70 _printLine_(indent << "KML_LatLonBox:"); -
issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp
r12493 r12513 42 42 fx1= (*f)(x1,optargs); 43 43 if (isnan(fx1)) _error2_("Function evaluation returned NaN"); 44 _printf_(VerboseControl(),"\n Iteration x f(x) Tolerance\n\n"); 45 _printf_(VerboseControl()," %s %12.6g %12.6g %s"," N/A",x1,fx1," N/A\n"); 44 cout<<setprecision(5); 45 if(VerboseControl()) _pprintLine_(""); 46 if(VerboseControl()) _pprintLine_(" Iteration x f(x) Tolerance"); 47 if(VerboseControl()) _pprintLine_(""); 48 if(VerboseControl()) _pprintLine_(" N/A "<<setw(12)<<x1<<" "<<setw(12)<<fx1<<" N/A"); 46 49 47 50 //update tolerances … … 55 58 fx2 = (*f)(x2,optargs); 56 59 if (isnan(fx2)) _error2_("Function evaluation returned NaN"); 57 _printf_(VerboseControl()," %5i %12.6g %12.6g %12.6g\n",iter,x2,fx2,fabs(x2-x1)>fabs(fx2-fx1)?fabs(fx2-fx1):fabs(x2-x1)); 60 if(VerboseControl()) 61 _pprintLine_(" "<<setw(5)<<iter<<" "<<setw(12)<<x2<<" "<<setw(12)<<fx2<<" "<<(fabs(x2-x1)>fabs(fx2-fx1)?fabs(fx2-fx1):fabs(x2-x1))); 58 62 59 63 //Stop the optimization? -
issm/trunk-jpl/src/c/solutions/controltao_core.cpp
r12493 r12513 30 30 int nsteps,maxiter; 31 31 AppCtx user; 32 TaoSolver tao ;32 TaoSolver tao = 0; 33 33 IssmDouble *dummy = NULL; 34 34 int *control_list = NULL; … … 53 53 54 54 /*Initialize TAO*/ 55 TaoCreate(PETSC_COMM_WORLD,&tao); 55 56 _printf_(VerboseControl(),"%s\n"," Initializing the Toolkit for Advanced Optimization (TAO)"); 56 TaoCreate(PETSC_COMM_WORLD,&tao);57 57 TaoSetFromOptions(tao); 58 58 TaoSetType(tao,"tao_blmvm"); … … 165 165 if(its==0) _printf_(true,"Iter Function Residual | List of contributions\n"); 166 166 if(its==0) _printf_(true,"-----------------------------------+-----------------------\n"); 167 _p rintf_(true,"%4i %12.7g %12.7g | ",its,f,gnorm);167 _pprintString_(setw(4)<<its<<" "<<setw(12)<<setprecision(7)<<f<<" "<<setw(12)<<setprecision(7)<<gnorm<<" | "); 168 168 169 169 /*Retrieve objective functions independently*/ 170 170 for(i=0;i<num_responses;i++){ 171 171 Responsex(&f,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,EnumToStringx(responses[i]),false,i); 172 _p rintf_(true," %12.7g ","",f);172 _pprintString_(" "<<setw(12)<<setprecision(7)<<f); 173 173 } 174 _p rintf_(true,"\n");174 _pprintLine_(""); 175 175 176 176 /*Clean-up and return*/
Note:
See TracChangeset
for help on using the changeset viewer.