Changeset 2330
- Timestamp:
- 09/25/09 17:00:28 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
r2312 r2330 71 71 parameters->AddObject(param); 72 72 73 /* debug: */74 param= new Param(count," debug",INTEGER);75 param->SetInteger(iomodel-> debug);73 /*verbose: */ 74 param= new Param(count,"verbose",INTEGER); 75 param->SetInteger(iomodel->verbose); 76 76 parameters->AddObject(param); 77 77 -
issm/trunk/src/c/ModelProcessorx/IoModel.cpp
r2312 r2330 119 119 iomodel->mincontrolconstraint=0; 120 120 iomodel->maxcontrolconstraint=0; 121 iomodel-> debug=0;121 iomodel->verbose=0; 122 122 iomodel->plot=0; 123 123 iomodel->eps_res=0; … … 329 329 IoModelFetchData((void**)&iomodel->meanvel,NULL,NULL,iomodel_handle,"meanvel","Scalar",NULL); 330 330 IoModelFetchData((void**)&iomodel->epsvel,NULL,NULL,iomodel_handle,"epsvel","Scalar",NULL); 331 IoModelFetchData((void**)&iomodel-> debug,NULL,NULL,iomodel_handle,"debug","Integer",NULL);331 IoModelFetchData((void**)&iomodel->verbose,NULL,NULL,iomodel_handle,"verbose","Integer",NULL); 332 332 IoModelFetchData((void**)&iomodel->plot,NULL,NULL,iomodel_handle,"plot","Integer",NULL); 333 333 IoModelFetchData((void**)&iomodel->artificial_diffusivity,NULL,NULL,iomodel_handle,"artificial_diffusivity","Integer",NULL); -
issm/trunk/src/c/ModelProcessorx/IoModel.h
r2312 r2330 117 117 double mincontrolconstraint; 118 118 double maxcontrolconstraint; 119 int debug;119 int verbose; 120 120 int plot; 121 121 double eps_res; -
issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp
r2115 r2330 50 50 double* qmu_part=NULL; 51 51 int qmu_npart; 52 int debug=0;52 int verbose=0; 53 53 54 54 extern int my_rank; … … 59 59 60 60 /*some parameters needed: */ 61 model->FindParam(& debug,"debug");61 model->FindParam(&verbose,"verbose"); 62 62 63 63 /*First off, recover the response descriptors for the response functions: */ … … 146 146 if(analysis_type==DiagnosticAnalysisEnum()){ 147 147 148 if( debug)_printf_("Starting diagnostic core\n");148 if(verbose)_printf_("Starting diagnostic core\n"); 149 149 150 150 diagnostic_core(results,model,inputs); … … 153 153 else if(analysis_type==ThermalAnalysisEnum()){ 154 154 155 if( debug)_printf_("Starting thermal core\n");155 if(verbose)_printf_("Starting thermal core\n"); 156 156 thermal_core(results,model,inputs); 157 157 … … 159 159 else if(analysis_type==PrognosticAnalysisEnum()){ 160 160 161 if( debug)_printf_("Starting prognostic core\n");161 if(verbose)_printf_("Starting prognostic core\n"); 162 162 prognostic_core(results,model,inputs); 163 163 … … 165 165 else if(analysis_type==TransientAnalysisEnum()){ 166 166 167 if( debug)_printf_("Starting transient core\n");167 if(verbose)_printf_("Starting transient core\n"); 168 168 transient_core(results,model,inputs); 169 169 … … 174 174 175 175 /*Now process the outputs, before computing the dakota responses: */ 176 if( debug)_printf_("process results:\n");176 if(verbose)_printf_("process results:\n"); 177 177 178 178 ProcessResults(&processed_results,results,model,analysis_type); 179 179 180 180 /*compute responses on cpu 0: dummy for now! */ 181 if( debug)_printf_("compute dakota responses:\n");181 if(verbose)_printf_("compute dakota responses:\n"); 182 182 DakotaResponses(responses,responses_descriptors,numresponses,model,results,processed_results,analysis_type,sub_analysis_type); 183 183 -
issm/trunk/src/c/parallel/ControlInitialization.cpp
r2316 r2330 34 34 35 35 /*flags: */ 36 int debug=0;36 int verbose=0; 37 37 int dim=-1; 38 38 int ishutter=0; … … 54 54 55 55 /*first recover parameters common to all solutions:*/ 56 model->FindParam(& debug,"debug");56 model->FindParam(&verbose,"verbose"); 57 57 model->FindParam(&dim,"dim"); 58 58 model->FindParam(&ishutter,"ishutter"); … … 83 83 84 84 //compute slopes 85 if( debug)_printf_("%s\n","computing bed slope (x and y derivatives)...");85 if(verbose)_printf_("%s\n","computing bed slope (x and y derivatives)..."); 86 86 diagnostic_core_linear(&slopex,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum()); 87 87 diagnostic_core_linear(&slopey,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum()); … … 97 97 98 98 //horizontal velocity 99 if( debug)_printf_("%s\n"," computing horizontal velocities...");99 if(verbose)_printf_("%s\n"," computing horizontal velocities..."); 100 100 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 101 if( debug)_printf_("%s\n"," extruding horizontal velocities...");101 if(verbose)_printf_("%s\n"," extruding horizontal velocities..."); 102 102 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh-> materials,"velocity",1); 103 103 104 104 //vertical velocity 105 if( debug)_printf_("%s\n"," computing vertical velocities...");105 if(verbose)_printf_("%s\n"," computing vertical velocities..."); 106 106 inputs->Add("velocity",ug_horiz,numberofdofspernode_dh,numberofnodes); 107 107 diagnostic_core_linear(&ug_vert,fem_dv,inputs,DiagnosticAnalysisEnum(),VertAnalysisEnum()); 108 108 109 109 //Create 3d u_g 110 if( debug)_printf_("%s\n"," combining horizontal and vertical velocities...");110 if(verbose)_printf_("%s\n"," combining horizontal and vertical velocities..."); 111 111 VecFree(&ug); ug=NewVec(numberofnodes*3); 112 112 xfree((void**)&dofset);dofset=dofsetgen(2,&dof01[0],3,numberofnodes*3); VecMerge(ug,ug_horiz,dofset,numberofnodes*2); … … 115 115 116 116 //Create 4d u_g 117 if( debug)_printf_("%s\n"," computing pressure according to Pattyn...");117 if(verbose)_printf_("%s\n"," computing pressure according to Pattyn..."); 118 118 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads, fem_dh->materials, numberofnodes); 119 119 VecScale(pg,1.0/stokesreconditioning); … … 127 127 128 128 //update spcs 129 if( debug)_printf_("%s\n"," update boundary conditions for stokes using velocities previously computed...");129 if(verbose)_printf_("%s\n"," update boundary conditions for stokes using velocities previously computed..."); 130 130 xfree((void**)&dofset);dofset=dofsetgen(3,dof012,4,numberofnodes*4); VecMerge(fem_ds->yg->vector,ug,dofset,3*numberofnodes); 131 131 … … 134 134 135 135 //Compute Stokes velocities to speed up later runs 136 if( debug)_printf_("%s\n"," computing stokes velocities and pressure ...");136 if(verbose)_printf_("%s\n"," computing stokes velocities and pressure ..."); 137 137 VecFree(&ug); 138 138 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_ds,inputs,DiagnosticAnalysisEnum(),StokesAnalysisEnum()); -
issm/trunk/src/c/parallel/control_core.cpp
r2267 r2330 52 52 int sub_analysis_type; 53 53 int control_steady; 54 int debug=0;54 int verbose=0; 55 55 int convergence=0; 56 56 int numberofnodes; -
issm/trunk/src/c/parallel/convergence.cpp
r2106 r2330 30 30 double eps_rel; 31 31 double eps_abs; 32 int debug;32 int verbose; 33 33 double yts; 34 34 … … 38 38 parameters->FindParam((void*)&eps_abs,"eps_abs"); 39 39 parameters->FindParam((void*)&yts,"yts"); 40 parameters->FindParam((void*)& debug,"debug");40 parameters->FindParam((void*)&verbose,"verbose"); 41 41 42 42 /*Display solver caracteristics*/ 43 if ( debug>1){43 if (verbose>1){ 44 44 45 45 //compute KUF = KU - F = K*U - F … … 81 81 //print 82 82 if(res<eps_res){ 83 if ( debug) _printf_("%-50s%g%s%g%s\n"," mechanical equilibrium convergence criterion",res*100," < ",eps_res*100," \%");83 if (verbose) _printf_("%-50s%g%s%g%s\n"," mechanical equilibrium convergence criterion",res*100," < ",eps_res*100," \%"); 84 84 converged=1; 85 85 } 86 86 else{ 87 if ( debug) _printf_("%-50s%g%s%g%s\n"," mechanical equilibrium convergence criterion",res*100," > ",eps_res*100," \%");87 if (verbose) _printf_("%-50s%g%s%g%s\n"," mechanical equilibrium convergence criterion",res*100," > ",eps_res*100," \%"); 88 88 converged=0; 89 89 } 90 90 91 91 /*Relative criterion (optional)*/ 92 if (!isnan(eps_rel) || ( debug>1)){92 if (!isnan(eps_rel) || (verbose>1)){ 93 93 94 94 //compute norm(du)/norm(u) … … 104 104 if (!isnan(eps_rel)){ 105 105 if((ndu/nu)<eps_rel){ 106 if ( debug) _printf_("%-50s%g%s%g%s\n"," Convergence criterion: norm(du)/norm(u)",ndu/nu*100," < ",eps_rel*100," \%");106 if (verbose) _printf_("%-50s%g%s%g%s\n"," Convergence criterion: norm(du)/norm(u)",ndu/nu*100," < ",eps_rel*100," \%"); 107 107 } 108 108 else{ 109 if ( debug) _printf_("%-50s%g%s%g%s\n"," Convergence criterion: norm(du)/norm(u)",ndu/nu*100," > ",eps_rel*100," \%");109 if (verbose) _printf_("%-50s%g%s%g%s\n"," Convergence criterion: norm(du)/norm(u)",ndu/nu*100," > ",eps_rel*100," \%"); 110 110 converged=0; 111 111 } … … 116 116 117 117 /*Absolute criterion (Optional) = max(du)*/ 118 if (!isnan(eps_abs) || ( debug>1)){118 if (!isnan(eps_abs) || (verbose>1)){ 119 119 120 120 //compute max(du) … … 129 129 if (!isnan(eps_abs)){ 130 130 if ((nduinf*yts)<eps_abs){ 131 if ( debug) _printf_("%-50s%g%s%g%s\n"," Convergence criterion: max(du)",nduinf*yts," < ",eps_abs," m/yr");131 if (verbose) _printf_("%-50s%g%s%g%s\n"," Convergence criterion: max(du)",nduinf*yts," < ",eps_abs," m/yr"); 132 132 } 133 133 else{ 134 if ( debug) _printf_("%-50s%g%s%g%s\n"," Convergence criterion: max(du)",nduinf*yts," > ",eps_abs," m/yr");134 if (verbose) _printf_("%-50s%g%s%g%s\n"," Convergence criterion: max(du)",nduinf*yts," > ",eps_abs," m/yr"); 135 135 converged=0; 136 136 } -
issm/trunk/src/c/parallel/diagnostic_core.cpp
r2324 r2330 39 39 40 40 /*flags: */ 41 int debug=0;41 int verbose=0; 42 42 int qmu_analysis=0; 43 43 int dim=-1; … … 62 62 63 63 //first recover parameters common to all solutions 64 model->FindParam(& debug,"debug");64 model->FindParam(&verbose,"verbose"); 65 65 model->FindParam(&dim,"dim"); 66 66 model->FindParam(&ishutter,"ishutter"); … … 92 92 if(ishutter){ 93 93 94 if( debug)_printf_("%s\n","computing surface slope (x and y derivatives)...");94 if(verbose)_printf_("%s\n","computing surface slope (x and y derivatives)..."); 95 95 diagnostic_core_linear(&slopex,fem_sl,inputs,SlopeComputeAnalysisEnum(),SurfaceXAnalysisEnum()); 96 96 diagnostic_core_linear(&slopey,fem_sl,inputs,SlopeComputeAnalysisEnum(),SurfaceYAnalysisEnum()); … … 98 98 if (dim==3){ 99 99 100 if( debug)_printf_("%s\n","extruding slopes in 3d...");100 if(verbose)_printf_("%s\n","extruding slopes in 3d..."); 101 101 FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopex",0); 102 102 FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopex",0); 103 103 } 104 104 105 if( debug)_printf_("%s\n"," adding slopes in inputs...");105 if(verbose)_printf_("%s\n"," adding slopes in inputs..."); 106 106 inputs->Add("surfaceslopex",slopex,numberofdofspernode_sl,numberofnodes); 107 107 inputs->Add("surfaceslopey",slopey,numberofdofspernode_sl,numberofnodes); 108 108 VecFree(&slopex); VecFree(&slopey); 109 109 110 if( debug)_printf_("%s\n"," computing hutter velocities...");110 if(verbose)_printf_("%s\n"," computing hutter velocities..."); 111 111 diagnostic_core_linear(&ug,fem_dhu,inputs,DiagnosticAnalysisEnum(),HutterAnalysisEnum()); 112 112 113 if( debug)_printf_("%s\n"," computing pressure according to MacAyeal...");113 if(verbose)_printf_("%s\n"," computing pressure according to MacAyeal..."); 114 114 ComputePressurex( &pg,fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials, numberofnodes); 115 115 116 if( debug)_printf_("%s\n"," update boundary conditions for macyeal pattyn using hutter results...");116 if(verbose)_printf_("%s\n"," update boundary conditions for macyeal pattyn using hutter results..."); 117 117 if (ismacayealpattyn){ 118 118 VecFree(&fem_dh->yg->vector); VecFree(&fem_dh->ys);VecFree(&fem_dh->ys0); … … 125 125 if (ismacayealpattyn){ 126 126 127 if( debug)_printf_("%s\n"," computing horizontal velocities...");127 if(verbose)_printf_("%s\n"," computing horizontal velocities..."); 128 128 diagnostic_core_nonlinear(&ug,NULL,NULL,fem_dh->loads,fem_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 129 129 130 130 if(dim==2){ 131 if( debug)_printf_("%s\n"," computing pressure according to MacAyeal...");131 if(verbose)_printf_("%s\n"," computing pressure according to MacAyeal..."); 132 132 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads, fem_dh->materials, numberofnodes); 133 133 } … … 138 138 if (dim==3){ 139 139 140 if( debug)_printf_("%s\n"," extruding horizontal velocities...");140 if(verbose)_printf_("%s\n"," extruding horizontal velocities..."); 141 141 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh->materials,"velocity",1); 142 142 143 if( debug)_printf_("%s\n"," computing vertical velocities...");143 if(verbose)_printf_("%s\n"," computing vertical velocities..."); 144 144 inputs->Add("velocity",ug_horiz,numberofdofspernode_dh,numberofnodes); 145 145 diagnostic_core_linear(&ug_vert,fem_dv,inputs,DiagnosticAnalysisEnum(),VertAnalysisEnum()); 146 146 147 if( debug)_printf_("%s\n"," combining horizontal and vertical velocities...");147 if(verbose)_printf_("%s\n"," combining horizontal and vertical velocities..."); 148 148 VecFree(&ug); ug=NewVec(numberofnodes*3); 149 149 … … 152 152 VecFree(&ug_horiz); VecFree(&ug_vert); 153 153 154 if( debug)_printf_("%s\n"," computing pressure according to Pattyn...");154 if(verbose)_printf_("%s\n"," computing pressure according to Pattyn..."); 155 155 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads, fem_dh->materials, numberofnodes); 156 156 … … 160 160 VecScale(pg,1.0/stokesreconditioning); 161 161 162 if( debug)_printf_("%s\n","computing bed slope (x and y derivatives)...");162 if(verbose)_printf_("%s\n","computing bed slope (x and y derivatives)..."); 163 163 diagnostic_core_linear(&slopex,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum()); 164 164 diagnostic_core_linear(&slopey,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum()); … … 178 178 VecFree(&ug_stokes); 179 179 180 if( debug)_printf_("%s\n"," update boundary conditions for stokes using velocities previously computed...");180 if(verbose)_printf_("%s\n"," update boundary conditions for stokes using velocities previously computed..."); 181 181 xfree((void**)&dofset);dofset=dofsetgen(3,dof012,4,numberofnodes*4); VecMerge(fem_ds->yg->vector,ug,dofset,3*numberofnodes); 182 182 VecFree(&fem_ds->ys); VecFree(&fem_ds->ys0); 183 183 Reducevectorgtosx(&fem_ds->ys,&fem_ds->ys0, fem_ds->yg->vector,fem_ds->nodesets); 184 184 185 if( debug)_printf_("%s\n"," computing stokes velocities and pressure ...");185 if(verbose)_printf_("%s\n"," computing stokes velocities and pressure ..."); 186 186 VecFree(&ug); 187 187 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_ds,inputs,DiagnosticAnalysisEnum(),StokesAnalysisEnum()); -
issm/trunk/src/c/parallel/diagnostic_core_linear.cpp
r2003 r2330 15 15 /*parameters:*/ 16 16 int kflag,pflag,connectivity,numberofdofspernode; 17 int debug=0;17 int verbose=0; 18 18 char* solver_string=NULL; 19 19 … … 33 33 fem->parameters->FindParam((void*)&connectivity,"connectivity"); 34 34 fem->parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode"); 35 fem->parameters->FindParam((void*)& debug,"debug");35 fem->parameters->FindParam((void*)&verbose,"verbose"); 36 36 fem->parameters->FindParam((void*)&solver_string,"solverstring"); 37 37 … … 40 40 41 41 //*Generate system matrices 42 if ( debug) _printf_(" Generating matrices\n");42 if (verbose) _printf_(" Generating matrices\n"); 43 43 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 44 44 45 if ( debug) _printf_(" Generating penalty matrices\n");45 if (verbose) _printf_(" Generating penalty matrices\n"); 46 46 //*Generate penalty system matrices 47 47 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,inputs,analysis_type,sub_analysis_type); 48 48 49 49 /*!Reduce matrix from g to f size:*/ 50 if ( debug) _printf_(" reducing matrix from g to f set\n");50 if (verbose) _printf_(" reducing matrix from g to f set\n"); 51 51 Reducematrixfromgtofx(&Kff,&Kfs,Kgg,fem->Gmn,fem->nodesets); MatFree(&Kgg); 52 52 53 53 54 54 /*!Reduce load from g to f size: */ 55 if ( debug) _printf_(" reducing load from g to f set\n");55 if (verbose) _printf_(" reducing load from g to f set\n"); 56 56 Reduceloadfromgtofx(&pf, pg, fem->Gmn, Kfs, fem->ys, fem->nodesets);VecFree(&pg); MatFree(&Kfs); 57 57 58 58 /*Solve: */ 59 if ( debug) _printf_(" solving\n");59 if (verbose) _printf_(" solving\n"); 60 60 Solverx(&uf, Kff, pf, NULL, solver_string); MatFree(&Kff); VecFree(&pf); 61 61 62 62 //Merge back to g set 63 if ( debug) _printf_(" merging solution from f to g set\n");63 if (verbose) _printf_(" merging solution from f to g set\n"); 64 64 Mergesolutionfromftogx(&ug, uf,fem->Gmn,fem->ys,fem->nodesets);VecFree(&uf); 65 65 -
issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp
r2006 r2330 37 37 int kflag,pflag,connectivity,numberofdofspernode; 38 38 char* solver_string=NULL; 39 int debug=0;39 int verbose=0; 40 40 int dofs[4]={1,1,0,0}; //recover vx,vy by default. vz and pressure may be. 41 41 … … 46 46 fem->FindParam((void*)&numberofnodes,"numberofnodes"); 47 47 fem->FindParam((void*)&solver_string,"solverstring"); 48 48 fem->FindParam(&verbose,"verbose"); 49 49 50 50 /*Were loads requested as output? : */ … … 68 68 for(;;){ 69 69 70 if ( debug) _printf_(" Updating inputs\n");70 if (verbose) _printf_(" Updating inputs\n"); 71 71 72 72 /*Set input parameters: */ … … 81 81 UpdateFromInputsx(fem->elements,fem->nodes,loads, fem->materials,inputs); 82 82 83 if ( debug) _printf_(" Generating matrices\n");83 if (verbose) _printf_(" Generating matrices\n"); 84 84 //*Generate system matrices 85 85 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 86 86 87 if ( debug) _printf_(" Generating penalty matrices\n");87 if (verbose) _printf_(" Generating penalty matrices\n"); 88 88 //*Generate penalty system matrices 89 89 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,loads,fem->materials,kflag,pflag,inputs,analysis_type,sub_analysis_type); 90 90 91 if ( debug) _printf_(" reducing matrix from g to f set\n");91 if (verbose) _printf_(" reducing matrix from g to f set\n"); 92 92 /*!Reduce matrix from g to f size:*/ 93 93 Reducematrixfromgtofx(&Kff,&Kfs,Kgg,fem->Gmn,fem->nodesets); … … 96 96 MatFree(&Kgg); 97 97 98 if ( debug) _printf_(" reducing load from g to f set\n");98 if (verbose) _printf_(" reducing load from g to f set\n"); 99 99 /*!Reduce load from g to f size: */ 100 100 Reduceloadfromgtofx(&pf, pg, fem->Gmn, Kfs, fem->ys, fem->nodesets); … … 105 105 106 106 /*Solve: */ 107 if ( debug) _printf_(" solving\n");107 if (verbose) _printf_(" solving\n"); 108 108 Solverx(&uf, Kff, pf, old_uf, solver_string); 109 109 110 110 //Merge back to g set 111 if ( debug) _printf_(" merging solution from f to g set\n");111 if (verbose) _printf_(" merging solution from f to g set\n"); 112 112 Mergesolutionfromftogx(&ug, uf,fem->Gmn,fem->ys,fem->nodesets); 113 113 114 114 //Deal with penalty loads 115 if ( debug) _printf_(" penalty constraints\n");115 if (verbose) _printf_(" penalty constraints\n"); 116 116 if (old_ug) inputs->Add("old_velocity",old_ug,numberofdofspernode,numberofnodes); 117 117 inputs->Add("velocity",ug,numberofdofspernode,numberofnodes); 118 118 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,loads,fem->materials,inputs,analysis_type,sub_analysis_type); 119 119 120 if( debug)_printf_(" number of unstable constraints: %i\n",num_unstable_constraints);120 if(verbose)_printf_(" number of unstable constraints: %i\n",num_unstable_constraints); 121 121 122 122 /*Figure out if convergence is reached.*/ … … 133 133 count++; 134 134 if(converged==1)break; 135 if(count>=100){ 136 _printf_(" maximum number of iterations exceeded\n"); 137 break; 138 } 135 139 136 140 } -
issm/trunk/src/c/parallel/gradjcompute_core.cpp
r2033 r2330 47 47 48 48 /*flags: */ 49 int debug=0;49 int verbose=0; 50 50 int dim=-1; 51 51 int extrude_param=0; … … 61 61 femmodel->parameters->FindParam((void*)&control_type,"control_type"); 62 62 femmodel->parameters->FindParam((void*)&extrude_param,"extrude_param"); 63 femmodel->parameters->FindParam((void*)& debug,"debug");63 femmodel->parameters->FindParam((void*)&verbose,"verbose"); 64 64 femmodel->parameters->FindParam((void*)&dim,"dim"); 65 65 -
issm/trunk/src/c/parallel/prognostic_core.cpp
r2013 r2330 27 27 28 28 /*flags: */ 29 int debug=0;29 int verbose=0; 30 30 int numberofdofspernode; 31 31 int numberofnodes; … … 40 40 41 41 //first recover parameters common to all solutions 42 model->FindParam(& debug,"debug");42 model->FindParam(&verbose,"verbose"); 43 43 model->FindParam(&numberofnodes,"numberofnodes"); 44 44 model->FindParam(&numberofdofspernode,"numberofdofspernode"); -
issm/trunk/src/c/parallel/steadystate_core.cpp
r2242 r2330 46 46 47 47 /*flags: */ 48 int debug=0;48 int verbose=0; 49 49 int isstokes=0; 50 50 int numberofnodes; … … 64 64 65 65 //first recover parameters common to all solutions 66 model->FindParam(& debug,"debug");debug=1;66 model->FindParam(&verbose,"verbose");verbose=1; 67 67 model->FindParam(&numberofnodes,"numberofnodes"); 68 68 model->FindParam(&eps_rel,"eps_rel"); … … 78 78 for(;;){ 79 79 80 if( debug)_printf_("%s%i\n"," computing temperature and velocity for step: ",step);80 if(verbose)_printf_("%s%i\n"," computing temperature and velocity for step: ",step); 81 81 82 82 //first compute temperature at steady state. … … 117 117 VecNorm(dt_g,NORM_2,&normdt); VecNorm(old_t_g,NORM_2,&normt);VecFree(&dt_g); 118 118 119 if ( debug) _printf_("%-60s%g\n %s%g\n %s%g%s\n",119 if (verbose) _printf_("%-60s%g\n %s%g\n %s%g%s\n", 120 120 " relative convergence criterion: velocity -> norm(du)/norm(u)= ",ndu/nu*100," temperature -> norm(dt)/norm(t)=",normdt/normt*100," eps_rel: ",eps_rel*100," %"); 121 121 -
issm/trunk/src/c/parallel/thermal_core.cpp
r2008 r2330 37 37 38 38 /*flags: */ 39 int debug=0;39 int verbose=0; 40 40 int numberofdofspernode; 41 41 int numberofnodes; … … 54 54 fem_t->FindParam((void*)&numberofnodes,"numberofnodes"); 55 55 fem_t->FindParam((void*)&sub_analysis_type,"sub_analysis_type"); 56 fem_t->FindParam((void*)& debug,"debug");56 fem_t->FindParam((void*)&verbose,"verbose"); 57 57 fem_t->FindParam((void*)&ndt,"ndt"); 58 58 fem_t->FindParam((void*)&dt,"dt"); … … 67 67 m_g=(Vec*)xmalloc(sizeof(Vec)); 68 68 69 if( debug)_printf_("computing temperatures:\n");69 if(verbose)_printf_("computing temperatures:\n"); 70 70 thermal_core_nonlinear(&t_g[0],&melting_offset,fem_t,inputs,ThermalAnalysisEnum(),NoneAnalysisEnum()); 71 71 inputs->Add("temperature",t_g[0],1,numberofnodes); 72 72 inputs->Add("melting_offset",melting_offset); 73 73 74 if( debug)_printf_("computing melting:\n");74 if(verbose)_printf_("computing melting:\n"); 75 75 diagnostic_core_linear(&m_g[0],fem_m,inputs,MeltingAnalysisEnum(),NoneAnalysisEnum()); 76 76 } … … 94 94 95 95 for(i=0;i<nsteps;i++){ 96 if( debug)_printf_("time step: %i/%i\n",i+1,nsteps);96 if(verbose)_printf_("time step: %i/%i\n",i+1,nsteps); 97 97 time[i+1]=(i+1)*dt; 98 98 99 if( debug)_printf_("computing temperatures:\n");99 if(verbose)_printf_("computing temperatures:\n"); 100 100 inputs->Add("temperature",t_g[i],1,numberofnodes); 101 101 thermal_core_nonlinear(&t_g[i+1],&melting_offset,fem_t,inputs,ThermalAnalysisEnum(),NoneAnalysisEnum()); 102 102 103 if( debug)_printf_("computing melting:\n");103 if(verbose)_printf_("computing melting:\n"); 104 104 inputs->Add("temperature",t_g[i+1],1,numberofnodes); 105 105 inputs->Add("melting_offset",melting_offset); -
issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp
r2223 r2330 38 38 int kflag,pflag,connectivity,numberofdofspernode; 39 39 char* solver_string=NULL; 40 int debug=0;40 int verbose=0; 41 41 int lowmem=0; 42 42 … … 48 48 fem->parameters->FindParam((void*)&numberofnodes,"numberofnodes"); 49 49 fem->parameters->FindParam((void*)&solver_string,"solverstring"); 50 fem->parameters->FindParam((void*)& debug,"debug");50 fem->parameters->FindParam((void*)&verbose,"verbose"); 51 51 fem->parameters->FindParam((void*)&lowmem,"lowmem"); 52 52 fem->parameters->FindParam((void*)&min_thermal_constraints,"min_thermal_constraints"); … … 57 57 for(;;){ 58 58 59 if( debug)_printf_("%s\n","starting direct shooting method");59 if(verbose)_printf_("%s\n","starting direct shooting method"); 60 60 61 61 if(count==1) inputs->Add("reset_penalties",1); … … 92 92 MatFree(&Kgg); 93 93 94 if ( debug) _printf_(" reducing load from g to f set\n");94 if (verbose) _printf_(" reducing load from g to f set\n"); 95 95 /*!Reduce load from g to f size: */ 96 96 Reduceloadfromgtofx(&pf, pg, fem->Gmn, Kfs, fem->ys, fem->nodesets); … … 101 101 102 102 /*Solve: */ 103 if( debug)_printf_("%s\n","solving");103 if(verbose)_printf_("%s\n","solving"); 104 104 VecFree(&tf); 105 105 Solverx(&tf, Kff, pf,tf_old, solver_string); … … 109 109 MatFree(&Kff);VecFree(&pf);VecFree(&tg); 110 110 111 if ( debug) _printf_(" merging solution from f to g set\n");111 if (verbose) _printf_(" merging solution from f to g set\n"); 112 112 //Merge back to g set 113 113 Mergesolutionfromftogx(&tg, tf,fem->Gmn,fem->ys,fem->nodesets); 114 114 115 115 //Deal with penalty loads 116 if ( debug) _printf_(" penalty constraints\n");116 if (verbose) _printf_(" penalty constraints\n"); 117 117 inputs->Add("temperature",tg,numberofdofspernode,numberofnodes); 118 118 … … 120 120 121 121 if (!converged){ 122 if( debug)_printf_("%s%i\n"," #unstable constraints = ",num_unstable_constraints);122 if(verbose)_printf_("%s%i\n"," #unstable constraints = ",num_unstable_constraints); 123 123 if (num_unstable_constraints <= min_thermal_constraints)converged=1; 124 124 } -
issm/trunk/src/c/parallel/transient_core_2d.cpp
r2013 r2330 56 56 57 57 /*flags: */ 58 int debug=0;58 int verbose=0; 59 59 int numberofnodes; 60 60 … … 75 75 76 76 //first recover parameters common to all solutions 77 model->FindParam(& debug,"debug");77 model->FindParam(&verbose,"verbose"); 78 78 model->FindParam(&finaltime,"ndt"); 79 79 model->FindParam(&dt,"dt"); -
issm/trunk/src/c/parallel/transient_core_3d.cpp
r1881 r2330 60 60 61 61 /*flags: */ 62 int debug=0;62 int verbose=0; 63 63 int numberofnodes; 64 64 … … 81 81 82 82 //first recover parameters common to all solutions 83 model->FindParam(& debug,"debug");83 model->FindParam(&verbose,"verbose"); 84 84 model->FindParam(&finaltime,"ndt"); 85 85 model->FindParam(&dt,"dt"); … … 122 122 while(time<finaltime){ //make sure we run up to finaltime. 123 123 124 if( debug)_printf_("%s%g%s%i%s%g\n","time [yr]: ",time," iteration number: ",step,"/",floor(finaltime/dt));124 if(verbose)_printf_("%s%g%s%i%s%g\n","time [yr]: ",time," iteration number: ",step,"/",floor(finaltime/dt)); 125 125 126 126 step+=1; … … 136 136 137 137 //Deal with temperature first 138 if( debug)_printf_("%s\n","computing temperature");138 if(verbose)_printf_("%s\n","computing temperature"); 139 139 thermal_core_nonlinear(&t_g,&melting_offset,fem_t,inputs,ThermalAnalysisEnum(),TransientAnalysisEnum()); 140 if( debug)_printf_("%s\n","computing melting");140 if(verbose)_printf_("%s\n","computing melting"); 141 141 inputs->Add("temperature",t_g,1,numberofnodes); 142 142 inputs->Add("melting_offset",melting_offset); … … 144 144 145 145 //Compute depth averaged temperature and add to inputs 146 if( debug)_printf_("%s\n","computing depth average temperature");146 if(verbose)_printf_("%s\n","computing depth average temperature"); 147 147 VecDuplicatePatch(&t_g_average,t_g); 148 148 FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,"temperature"); … … 160 160 161 161 //compute new thickness 162 if( debug)_printf_("%s\n","computing new thickness");162 if(verbose)_printf_("%s\n","computing new thickness"); 163 163 164 164 inputs->Add("velocity",u_g,3,numberofnodes); … … 170 170 171 171 //update surface and bed using the new thickness 172 if( debug)_printf_(" updating geometry\n");172 if(verbose)_printf_(" updating geometry\n"); 173 173 UpdateGeometryx(&h_g,&b_g,&s_g, 174 174 fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, … … 176 176 VecFree(&h_g_intermediary); 177 177 178 if( debug)_printf_("%s\n","updating node positions");178 if(verbose)_printf_("%s\n","updating node positions"); 179 179 UpdateNodePositionsx( fem_dh->elements,fem_dh->nodes,fem_dh->loads,fem_dh->materials,h_g,b_g); 180 180 UpdateNodePositionsx( fem_dv->elements,fem_dv->nodes,fem_dv->loads,fem_dv->materials,h_g,b_g); -
issm/trunk/src/m/classes/@model/model.m
r2305 r2330 210 210 211 211 %debugging 212 md. debug=0;212 md.verbose=0; 213 213 md.element_debug=0; 214 214 md.element_debugid=NaN; -
issm/trunk/src/m/classes/@model/setdefaultparameters.m
r2303 r2330 85 85 %parameter used to print temporary results (convergence criterion, 86 86 %current step,...) 87 md. debug=0;87 md.verbose=0; 88 88 89 89 %Stokes mesh -
issm/trunk/src/m/classes/public/display/displaydiagnostic.m
r1755 r2330 30 30 31 31 disp(sprintf('\n %s','Debugging:')); 32 fielddisplay(md,' debug','output debug statements when possible yes-> 1, no -> 0. Default is 1');32 fielddisplay(md,'verbose','level of output statements: none -> 0, yes->1,2. Default is 0'); 33 33 fielddisplay(md,'element_debug','output debug statements for elementswhen possible yes-> 1, no -> 0. Default is 0'); 34 34 fielddisplay(md,'element_debugid','if element_debug on, id of element for which to output messages'); -
issm/trunk/src/m/classes/public/marshall.m
r2307 r2330 105 105 WriteData(fid,md.meanvel,'Scalar','meanvel'); 106 106 WriteData(fid,md.epsvel,'Scalar','epsvel'); 107 WriteData(fid,md. debug,'Integer','debug');107 WriteData(fid,md.verbose,'Integer','verbose'); 108 108 WriteData(fid,md.plot,'Integer','plot'); 109 109 WriteData(fid,md.artificial_diffusivity,'Integer','artificial_diffusivity'); -
issm/trunk/src/m/classes/public/solve.m
r2326 r2330 28 28 29 29 %check model consistency 30 displaystring(md. debug,'\n%s\n','checking model consistency');30 displaystring(md.verbose,'\n%s\n','checking model consistency'); 31 31 ismodelselfconsistent(md), 32 32 … … 39 39 md=preqmu(md,options); 40 40 end 41 displaystring(md. debug,'\n%s\n','launching solution sequence');41 displaystring(md.verbose,'\n%s\n','launching solution sequence'); 42 42 43 43 %If running in parallel, we have a different way of launching the solution … … 78 78 79 79 %Check result is consistent 80 displaystring(md. debug,'%s\n','checking result consistency');80 displaystring(md.verbose,'%s\n','checking result consistency'); 81 81 if ~isresultconsistent(md,options.analysis_type), 82 82 disp('!! results not consistent correct the model !!') %it would be very cruel to put an error, it would kill the computed results (even if not consistent...) -
issm/trunk/src/m/classes/public/solveparallel.m
r2260 r2330 40 40 %stop timing 41 41 t2=clock; 42 displaystring(md. debug,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']);42 displaystring(md.verbose,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']); 43 43 44 displaystring(md. debug,'loading results from cluster');44 displaystring(md.verbose,'loading results from cluster'); 45 45 md=loadresultsfromcluster(md); 46 46 end -
issm/trunk/src/m/solutions/cielo/ControlInitialization.m
r1846 r2330 9 9 10 10 %recover parameters common to all solutions 11 debug=m_dhu.parameters.debug;11 verbose=m_dhu.parameters.verbose; 12 12 dim=m_dhu.parameters.dim; 13 13 ishutter=m_dhu.parameters.ishutter; … … 24 24 25 25 %compute slopes 26 displaystring( debug,'\n%s',['computing bed slope (x and y derivatives)...']);26 displaystring(verbose,'\n%s',['computing bed slope (x and y derivatives)...']); 27 27 slopex=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum()); 28 28 slopey=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum()); … … 37 37 38 38 %horizontal velocities 39 displaystring( debug,'\n%s',['computing horizontal velocities...']);39 displaystring(verbose,'\n%s',['computing horizontal velocities...']); 40 40 u_g=diagnostic_core_nonlinear(m_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 41 displaystring( debug,'\n%s',['extruding horizontal velocities...']);41 displaystring(verbose,'\n%s',['extruding horizontal velocities...']); 42 42 u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,u_g,'velocity',1); 43 43 44 44 %vertical velocities 45 displaystring( debug,'\n%s',['computing vertical velocities...']);45 displaystring(verbose,'\n%s',['computing vertical velocities...']); 46 46 inputs=add(inputs,'velocity',u_g_horiz,'doublevec',m_dh.parameters.numberofdofspernode,m_dh.parameters.numberofnodes); 47 47 u_g_vert=diagnostic_core_linear(m_dv,inputs,DiagnosticAnalysisEnum(),VertAnalysisEnum()); 48 48 49 49 %create 3d u_g 50 displaystring( debug,'\n%s',['combining horizontal and vertical velocities...']);50 displaystring(verbose,'\n%s',['combining horizontal and vertical velocities...']); 51 51 u_g=zeros(m_dh.parameters.numberofnodes*3,1); 52 52 u_g(dofsetgen([1,2],3,m_dh.parameters.numberofnodes*3))=u_g_horiz; … … 54 54 55 55 % get pressure (reconditionned) and create 4d u_g 56 displaystring( debug,'\n%s',['computing pressure according to Pattyn...']);56 displaystring(verbose,'\n%s',['computing pressure according to Pattyn...']); 57 57 p_g=ComputePressure(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,m_dh.parameters,inputs); 58 58 p_g=p_g/m_ds.parameters.stokesreconditioning; … … 63 63 64 64 %update BC (spcs) 65 displaystring( debug,'\n%s',['update boundary conditions for stokes using velocities previously computed...']);65 displaystring(verbose,'\n%s',['update boundary conditions for stokes using velocities previously computed...']); 66 66 m_ds.y_g=zeros(m_ds.nodesets.gsize,1); 67 67 m_ds.y_g(dofsetgen([1,2,3],4,m_ds.nodesets.gsize))=u_g; … … 69 69 70 70 %Compute Stokes velocities once to have a reasonably good ug in input 71 displaystring( debug,'\n%s',['computing stokes velocities and pressure ...']);71 displaystring(verbose,'\n%s',['computing stokes velocities and pressure ...']); 72 72 u_g=diagnostic_core_nonlinear(m_ds,inputs,DiagnosticAnalysisEnum(),StokesAnalysisEnum()); 73 73 inputs=add(inputs,'velocity',u_g,'doublevec',4,m_ds.parameters.numberofnodes); -
issm/trunk/src/m/solutions/cielo/CreateFemModel.m
r2316 r2330 8 8 function m=CreateFEMModel(md) 9 9 10 displaystring(md. debug,'\n reading data from model %s...',md.name);10 displaystring(md.verbose,'\n reading data from model %s...',md.name); 11 11 [m.elements,m.nodes,m.constraints,m.loads,m.materials,parameters]=ModelProcessor(md); 12 12 13 displaystring(md. debug,'%s',' generating degrees of freedom...');13 displaystring(md.verbose,'%s',' generating degrees of freedom...'); 14 14 [m.nodes,m.part,m.tpart]=Dof(m.elements,m.nodes,parameters); 15 15 16 displaystring(md. debug,'%s',' generating single point constraints...');16 displaystring(md.verbose,'%s',' generating single point constraints...'); 17 17 [m.nodes,m.yg]=SpcNodes(m.nodes,m.constraints); 18 18 19 displaystring(md. debug,'%s',' generating rigid body constraints...');19 displaystring(md.verbose,'%s',' generating rigid body constraints...'); 20 20 [m.Rmg,m.nodes]=MpcNodes(m.nodes,m.constraints); 21 21 22 displaystring(md. debug,'%s',' generating node sets...');22 displaystring(md.verbose,'%s',' generating node sets...'); 23 23 m.nodesets=BuildNodeSets(m.nodes); 24 24 25 displaystring(md. debug,'%s',' reducing single point constraints vector...');25 displaystring(md.verbose,'%s',' reducing single point constraints vector...'); 26 26 [m.ys m.ys0]=Reducevectorgtos(m.yg.vector,m.nodesets); 27 27 28 displaystring(md. debug,'%s',' normalizing rigid body constraints matrix...');28 displaystring(md.verbose,'%s',' normalizing rigid body constraints matrix...'); 29 29 m.Gmn = NormalizeConstraints(m.Rmg,m.nodesets); 30 30 31 displaystring(md. debug,'%s',' configuring element and loads...');31 displaystring(md.verbose,'%s',' configuring element and loads...'); 32 32 [m.elements,m.loads,m.nodes] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials); 33 33 34 displaystring(md. debug,'%s',' processing parameters...');34 displaystring(md.verbose,'%s',' processing parameters...'); 35 35 parameters= ProcessParams(parameters,m.part.vector); 36 36 37 displaystring(md. debug,'%s',' creating parameters in matlab workspace...');37 displaystring(md.verbose,'%s',' creating parameters in matlab workspace...'); 38 38 m.parameters= ParamsToWorkspace(parameters); 39 39 -
issm/trunk/src/m/solutions/cielo/SpawnCore.m
r2112 r2330 7 7 8 8 %recover parameters 9 debug=models.dh.parameters.debug;9 verbose=models.dh.parameters.verbose; 10 10 parameters=models.dh.parameters; 11 11 responsedescriptors=models.dh.parameters.responsedescriptors; -
issm/trunk/src/m/solutions/cielo/control_core.m
r2227 r2330 13 13 14 14 %recover parameters common to all solutions 15 debug=model.parameters.debug;15 verbose=model.parameters.verbose; 16 16 dim=model.parameters.dim; 17 17 isstokes=model.parameters.isstokes; … … 47 47 [model.elements,model.nodes,model.loads,model.materials]=UpdateFromInputs(model.elements,model.nodes,model.loads,model.materials,inputs); 48 48 49 displaystring( debug,'\n%s',[' computing gradJ...']);49 displaystring(verbose,'\n%s',[' computing gradJ...']); 50 50 results_grad=gradjcompute_core(models,inputs); 51 51 u_g=results_grad.u_g; c(n).grad_g=results_grad.grad_g; … … 60 60 end 61 61 62 displaystring( debug,'\n%s',[' normalizing directions...']);62 displaystring(verbose,'\n%s',[' normalizing directions...']); 63 63 if n>=2, 64 64 c(n).grad_g=Orth(c(n).grad_g,c(n-1).grad_g); … … 72 72 end 73 73 74 displaystring( debug,'\n%s',[' optimizing along gradient direction...']);74 displaystring(verbose,'\n%s',[' optimizing along gradient direction...']); 75 75 [search_scalar c(n).J]=ControlOptimization('objectivefunctionC',0,1,options,models,inputs,param_g,c(n).grad_g,n,model.parameters); 76 76 77 displaystring( debug,'\n%s',[' updating parameter using optimized search scalar...']);77 displaystring(verbose,'\n%s',[' updating parameter using optimized search scalar...']); 78 78 param_g=param_g+search_scalar*model.parameters.optscal(n)*c(n).grad_g; 79 79 80 displaystring( debug,'\n%s',[' constraining the new distribution...']);80 displaystring(verbose,'\n%s',[' constraining the new distribution...']); 81 81 param_g=ControlConstrain(param_g,model.parameters); 82 82 … … 95 95 %convergence if convergence criteria fullfilled 96 96 convergence=1; 97 displaystring( debug,'\n%s%g%s%g\n',' Convergence criterion: dJ/J = ',(c(i).J-c(n).J)/c(n).J,'<',eps_cm);97 displaystring(verbose,'\n%s%g%s%g\n',' Convergence criterion: dJ/J = ',(c(i).J-c(n).J)/c(n).J,'<',eps_cm); 98 98 else 99 displaystring( debug,'\n%s%g%s%g\n',' Convergence criterion: dJ/J = ',(c(i).J-c(n).J)/c(n).J,'>',eps_cm);99 displaystring(verbose,'\n%s%g%s%g\n',' Convergence criterion: dJ/J = ',(c(i).J-c(n).J)/c(n).J,'>',eps_cm); 100 100 end 101 101 break; … … 110 110 111 111 %generate output 112 displaystring( debug,'\n%s',[' preparing final velocity solution...']);112 displaystring(verbose,'\n%s',[' preparing final velocity solution...']); 113 113 114 114 %compute final velocity from diagnostic_core (horiz+vertical) -
issm/trunk/src/m/solutions/cielo/convergence.m
r2107 r2330 2 2 3 3 %Get convergence options 4 debug=params.debug;4 verbose=params.verbose; 5 5 yts=params.yts; 6 6 eps_res=params.eps_res; … … 10 10 %initialization 11 11 converged=0; 12 displaystring( debug,' ');12 displaystring(verbose,' '); 13 13 14 14 %Display solver caracteristics 15 if ( debug>1),15 if (verbose>1), 16 16 solver_res=norm(K_ff*u_f-p_f,2)/norm(p_f,2); 17 displaystring( debug>1,'%s%g',' condition number of stiffness matrix: ',condest(K_ff));18 displaystring( debug>1,'%s%g',' solver residue: norm(KU-F)/norm(F)=',solver_res);17 displaystring(verbose>1,'%s%g',' condition number of stiffness matrix: ',condest(K_ff)); 18 displaystring(verbose>1,'%s%g',' solver residue: norm(KU-F)/norm(F)=',solver_res); 19 19 end 20 20 … … 25 25 end 26 26 if (res<=eps_res), 27 displaystring( debug,'%-60s%g%s%g%s',' mechanical equilibrium convergence criterion',res*100,' < ',eps_res*100,' %');27 displaystring(verbose,'%-60s%g%s%g%s',' mechanical equilibrium convergence criterion',res*100,' < ',eps_res*100,' %'); 28 28 converged=1; 29 29 else 30 displaystring( debug,'%-60s%g%s%g%s',' mechanical equilibrium convergence criterion',res*100,' > ',eps_res*100,' %');30 displaystring(verbose,'%-60s%g%s%g%s',' mechanical equilibrium convergence criterion',res*100,' > ',eps_res*100,' %'); 31 31 converged=0; 32 32 end 33 33 34 34 %Relative criterion (optional) 35 if ((~isnan(eps_rel)) | ( debug>1)),35 if ((~isnan(eps_rel)) | (verbose>1)), 36 36 37 37 %compute ndu/nu … … 46 46 if ~isnan(eps_rel), 47 47 if (ndu/nu<=eps_rel), 48 displaystring( debug,'%-60s%g%s%g%s',' relative convergence criterion: norm(du)/norm(u)',ndu/nu*100,' < ',eps_rel*100,' %');48 displaystring(verbose,'%-60s%g%s%g%s',' relative convergence criterion: norm(du)/norm(u)',ndu/nu*100,' < ',eps_rel*100,' %'); 49 49 else 50 displaystring( debug,'%-60s%g%s%g%s',' relative convergence criterion: norm(du)/norm(u)',ndu/nu*100,' > ',eps_rel*100,' %');50 displaystring(verbose,'%-60s%g%s%g%s',' relative convergence criterion: norm(du)/norm(u)',ndu/nu*100,' > ',eps_rel*100,' %'); 51 51 converged=0; 52 52 end 53 53 else 54 displaystring( debug,'%-60s%g%s',' relative convergence criterion: norm(du)/norm(u)',ndu/nu*100,' %');54 displaystring(verbose,'%-60s%g%s',' relative convergence criterion: norm(du)/norm(u)',ndu/nu*100,' %'); 55 55 end 56 56 … … 58 58 59 59 %Absolute criterion (optional) 60 if ((~isnan(eps_abs)) | ( debug>1)),60 if ((~isnan(eps_abs)) | (verbose>1)), 61 61 62 62 %compute max(du) … … 70 70 if ~isnan(eps_abs), 71 71 if (nduinf<=eps_abs), 72 displaystring( debug,'%-60s%g%s%g%s',' absolute convergence criterion: max(du)',nduinf,' < ',eps_abs,' m/yr');72 displaystring(verbose,'%-60s%g%s%g%s',' absolute convergence criterion: max(du)',nduinf,' < ',eps_abs,' m/yr'); 73 73 else 74 displaystring( debug,'%-60s%g%s%g%s',' absolute convergence criterion: max(du)',nduinf,' > ',eps_abs,' m/yr');74 displaystring(verbose,'%-60s%g%s%g%s',' absolute convergence criterion: max(du)',nduinf,' > ',eps_abs,' m/yr'); 75 75 converged=0; 76 76 end 77 77 else 78 displaystring( debug,'%-60s%g%s',' absolute convergence criterion: max(du)',nduinf,' m/yr');78 displaystring(verbose,'%-60s%g%s',' absolute convergence criterion: max(du)',nduinf,' m/yr'); 79 79 end 80 80 -
issm/trunk/src/m/solutions/cielo/diagnostic.m
r2268 r2330 12 12 models.analysis_type=DiagnosticAnalysisEnum; %needed for processresults 13 13 14 displaystring(md. debug,'%s',['reading diagnostic horiz model data']);14 displaystring(md.verbose,'%s',['reading diagnostic horiz model data']); 15 15 md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=HorizAnalysisEnum; models.dh=CreateFemModel(md); 16 16 17 displaystring(md. debug,'\n%s',['reading diagnostic vert model data']);17 displaystring(md.verbose,'\n%s',['reading diagnostic vert model data']); 18 18 md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=VertAnalysisEnum; models.dv=CreateFemModel(md); 19 19 20 displaystring(md. debug,'\n%s',['reading diagnostic stokes model data']);20 displaystring(md.verbose,'\n%s',['reading diagnostic stokes model data']); 21 21 md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=StokesAnalysisEnum; models.ds=CreateFemModel(md); 22 22 23 displaystring(md. debug,'\n%s',['reading diagnostic hutter model data']);23 displaystring(md.verbose,'\n%s',['reading diagnostic hutter model data']); 24 24 md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=HutterAnalysisEnum; models.dhu=CreateFemModel(md); 25 25 26 displaystring(md. debug,'\n%s',['reading surface and bed slope computation model data']);26 displaystring(md.verbose,'\n%s',['reading surface and bed slope computation model data']); 27 27 md.analysis_type=SlopeComputeAnalysisEnum; md.sub_analysis_type=NoneAnalysisEnum; models.sl=CreateFemModel(md); 28 28 … … 62 62 %stop timing 63 63 t2=clock; 64 displaystring(md. debug,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']);64 displaystring(md.verbose,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']); -
issm/trunk/src/m/solutions/cielo/diagnostic_core.m
r2027 r2330 14 14 15 15 %recover parameters common to all solutions 16 debug=m_dhu.parameters.debug;16 verbose=m_dhu.parameters.verbose; 17 17 dim=m_dh.parameters.dim; 18 18 ishutter=m_dhu.parameters.ishutter; … … 23 23 if ishutter, 24 24 25 displaystring( debug,'\n%s',['computing surface slope (x and y derivatives)...']);25 displaystring(verbose,'\n%s',['computing surface slope (x and y derivatives)...']); 26 26 slopex=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),SurfaceXAnalysisEnum()); 27 27 slopey=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),SurfaceYAnalysisEnum()); 28 28 29 29 if dim==3, 30 displaystring( debug,'\n%s',['extruding slopes in 3d...']);30 displaystring(verbose,'\n%s',['extruding slopes in 3d...']); 31 31 slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopex,'slopex',0); 32 32 slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopey,'slopey',0); 33 33 end 34 34 35 displaystring( debug,'\n%s',['computing slopes...']);35 displaystring(verbose,'\n%s',['computing slopes...']); 36 36 inputs=add(inputs,'surfaceslopex',slopex,'doublevec',m_sl.parameters.numberofdofspernode,m_sl.parameters.numberofnodes); 37 37 inputs=add(inputs,'surfaceslopey',slopey,'doublevec',m_sl.parameters.numberofdofspernode,m_sl.parameters.numberofnodes); 38 38 39 displaystring( debug,'\n%s',['computing hutter velocities...']);39 displaystring(verbose,'\n%s',['computing hutter velocities...']); 40 40 u_g=diagnostic_core_linear(m_dhu,inputs,DiagnosticAnalysisEnum(),HutterAnalysisEnum()); 41 41 42 displaystring( debug,'\n%s',['computing pressure according to MacAyeal...']);42 displaystring(verbose,'\n%s',['computing pressure according to MacAyeal...']); 43 43 p_g=ComputePressure(m_dhu.elements,m_dhu.nodes,m_dhu.loads,m_dhu.materials,m_dhu.parameters,inputs); 44 44 45 displaystring( debug,'\n%s',['update boundary conditions for macyeal pattyn using hutter results...']);45 displaystring(verbose,'\n%s',['update boundary conditions for macyeal pattyn using hutter results...']); 46 46 if ismacayealpattyn, 47 47 m_dh.y_g=u_g; … … 53 53 if ismacayealpattyn, 54 54 55 displaystring( debug,'\n%s',['computing horizontal velocities...']);55 displaystring(verbose,'\n%s',['computing horizontal velocities...']); 56 56 [u_g m_dh.loads]=diagnostic_core_nonlinear(m_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 57 57 58 displaystring( debug,'\n%s',['computing pressure according to MacAyeal...']);58 displaystring(verbose,'\n%s',['computing pressure according to MacAyeal...']); 59 59 p_g=ComputePressure(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,m_dh.parameters,inputs); 60 60 end … … 62 62 if dim==3, 63 63 64 displaystring( debug,'\n%s',['extruding horizontal velocities...']);64 displaystring(verbose,'\n%s',['extruding horizontal velocities...']); 65 65 u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,u_g,'velocity',1); 66 66 67 displaystring( debug,'\n%s',['computing vertical velocities...']);67 displaystring(verbose,'\n%s',['computing vertical velocities...']); 68 68 inputs=add(inputs,'velocity',u_g_horiz,'doublevec',m_dh.parameters.numberofdofspernode,m_dh.parameters.numberofnodes); 69 69 u_g_vert=diagnostic_core_linear(m_dv,inputs,DiagnosticAnalysisEnum(),VertAnalysisEnum()); 70 70 71 displaystring( debug,'\n%s',['combining horizontal and vertical velocities...']);71 displaystring(verbose,'\n%s',['combining horizontal and vertical velocities...']); 72 72 u_g=zeros(m_dh.parameters.numberofnodes*3,1); 73 73 u_g(dofsetgen([1,2],3,m_dh.parameters.numberofnodes*3))=u_g_horiz; 74 74 u_g(dofsetgen([3],3,m_dh.parameters.numberofnodes*3))=u_g_vert; 75 75 76 displaystring( debug,'\n%s',['computing pressure according to Pattyn...']);76 displaystring(verbose,'\n%s',['computing pressure according to Pattyn...']); 77 77 p_g=ComputePressure(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,m_dh.parameters,inputs); 78 78 … … 82 82 p_g=p_g/m_ds.parameters.stokesreconditioning; 83 83 84 displaystring( debug,'\n%s',['computing bed slope (x and y derivatives)...']);84 displaystring(verbose,'\n%s',['computing bed slope (x and y derivatives)...']); 85 85 slopex=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum()); 86 86 slopey=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum()); … … 98 98 inputs=add(inputs,'velocity',u_g_stokes,'doublevec',4,m_ds.parameters.numberofnodes); 99 99 100 displaystring( debug,'\n%s',['update boundary conditions for stokes using velocities previously computed...']);100 displaystring(verbose,'\n%s',['update boundary conditions for stokes using velocities previously computed...']); 101 101 m_ds.y_g=zeros(m_ds.nodesets.gsize,1); 102 102 m_ds.y_g(dofsetgen([1,2,3],4,m_ds.nodesets.gsize))=u_g; 103 103 [m_ds.ys m_ds.ys0]=Reducevectorgtos(m_ds.y_g,m_ds.nodesets); 104 104 105 displaystring( debug,'\n%s',['computing stokes velocities and pressure ...']);105 displaystring(verbose,'\n%s',['computing stokes velocities and pressure ...']); 106 106 u_g=diagnostic_core_nonlinear(m_ds,inputs,DiagnosticAnalysisEnum(),StokesAnalysisEnum()); 107 107 -
issm/trunk/src/m/solutions/cielo/diagnostic_core_linear.m
r1128 r2330 17 17 %Reduce tangent matrix from g size to f size 18 18 [K_ff, K_fs] = Reducematrixfromgtof( K_gg, m.Gmn, m.nodesets); 19 displaystring(m.parameters. debug>1,'%s%g',' condition number of stiffness matrix: ',condest(K_ff));19 displaystring(m.parameters.verbose>1,'%s%g',' condition number of stiffness matrix: ',condest(K_ff)); 20 20 21 21 %Reduce load from g size to f size -
issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m
r1805 r2330 16 16 inputs=add(inputs,'converged',converged,'double'); 17 17 18 displaystring(m.parameters. debug,'\n%s',[' starting direct shooting method']);18 displaystring(m.parameters.verbose,'\n%s',[' starting direct shooting method']); 19 19 while(~converged), 20 20 … … 57 57 [loads,constraints_converged,num_unstable_constraints] =PenaltyConstraints( m.elements,m.nodes, loads, m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 58 58 59 displaystring(m.parameters. debug,'%s%i',' number of unstable constraints: ',num_unstable_constraints);59 displaystring(m.parameters.verbose,'%s%i',' number of unstable constraints: ',num_unstable_constraints); 60 60 61 61 %Figure out if convergence have been reached -
issm/trunk/src/m/solutions/cielo/gradjcompute_core.m
r2027 r2330 5 5 6 6 %recover parameters 7 debug=m.parameters.debug;7 verbose=m.parameters.verbose; 8 8 dim=m.parameters.dim; 9 9 extrude_param=m.parameters.extrude_param; … … 15 15 16 16 %Recover solution for this stiffness and right hand side: 17 displaystring( debug,'%s',' computing velocities...');17 displaystring(verbose,'%s',' computing velocities...'); 18 18 [u_g K_ff0 K_fs0 ]=diagnostic_core_nonlinear(m,inputs,analysis_type,sub_analysis_type); 19 19 inputs=add(inputs,'velocity',u_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes); … … 21 21 22 22 %Buid Du, difference between observed velocity and model velocity. 23 displaystring( debug,'%s',' computing Du...');23 displaystring(verbose,'%s',' computing Du...'); 24 24 [Du_g]=Du(m.elements,m.nodes,m.loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 25 25 … … 28 28 29 29 %Solve for adjoint vector: 30 displaystring( debug,'%s',' computing adjoint state...');30 displaystring(verbose,'%s',' computing adjoint state...'); 31 31 lambda_f=Solver(K_ff0,Du_f,[],m.parameters); 32 32 … … 38 38 grad_g=Gradj(m.elements,m.nodes,m.loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 39 39 if (dim==3 & extrude_param), 40 displaystring( debug,'%s',' extruding gradient...');40 displaystring(verbose,'%s',' extruding gradient...'); 41 41 grad_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,grad_g,'gradj',0); 42 42 end … … 44 44 if m.parameters.control_steady, 45 45 %compute initial velocity from diagnostic_core (horiz+vertical) 46 displaystring( debug,'%s',' compute 3d initial velocity...');46 displaystring(verbose,'%s',' compute 3d initial velocity...'); 47 47 results_diag=diagnostic_core(models,inputs); 48 48 u_g=results_diag.u_g; -
issm/trunk/src/m/solutions/cielo/prognostic.m
r1720 r2330 11 11 models.analysis_type=PrognosticAnalysisEnum; %needed for processresults 12 12 13 displaystring(md. debug,'%s',['reading prognostic model data']);13 displaystring(md.verbose,'%s',['reading prognostic model data']); 14 14 md.analysis_type=PrognosticAnalysisEnum; models.p=CreateFemModel(md); 15 15 … … 18 18 19 19 %initialize inputs 20 displaystring(md. debug,'\n%s',['setup inputs...']);20 displaystring(md.verbose,'\n%s',['setup inputs...']); 21 21 inputs=inputlist; 22 22 inputs=add(inputs,'velocity',models.p.parameters.u_g,'doublevec',3,models.p.parameters.numberofnodes); … … 26 26 inputs=add(inputs,'dt',models.p.parameters.dt*models.p.parameters.yts,'double'); 27 27 28 displaystring(md. debug,'\n%s',['call computational core:']);28 displaystring(md.verbose,'\n%s',['call computational core:']); 29 29 results=prognostic_core(models,inputs,PrognosticAnalysisEnum(),NoneAnalysisEnum()); 30 30 31 displaystring(md. debug,'\n%s',['load results...']);31 displaystring(md.verbose,'\n%s',['load results...']); 32 32 if ~isstruct(md.results), md.results=struct(); end 33 33 md.results.prognostic=processresults(models, results); … … 35 35 %stop timing 36 36 t2=clock; 37 displaystring(md. debug,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']);37 displaystring(md.verbose,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']); -
issm/trunk/src/m/solutions/cielo/prognostic_core.m
r968 r2330 10 10 results.step=1; 11 11 12 displaystring(m.parameters. debug,'\n%s',['depth averaging velocity...']);12 displaystring(m.parameters.verbose,'\n%s',['depth averaging velocity...']); 13 13 %Take only the first two dofs of m.parameters.u_g 14 14 u_g=get(inputs,'velocity',[1 1 0 0]); … … 16 16 inputs=add(inputs,'velocity_average',u_g,'doublevec',2,m.parameters.numberofnodes); 17 17 18 displaystring(m.parameters. debug,'\n%s',['call computational core:']);18 displaystring(m.parameters.verbose,'\n%s',['call computational core:']); 19 19 results.h_g=diagnostic_core_linear(m,inputs,analysis_type,sub_analysis_type); 20 20 21 displaystring(m.parameters. debug,'\n%s',['extrude computed thickness on all layers:']);21 displaystring(m.parameters.verbose,'\n%s',['extrude computed thickness on all layers:']); 22 22 results.h_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,results.h_g,'thickness',0); 23 23 -
issm/trunk/src/m/solutions/cielo/steadystate.m
r2268 r2330 12 12 13 13 %Build all models requested for diagnostic simulation 14 displaystring(md. debug,'%s',['reading diagnostic horiz model data']);14 displaystring(md.verbose,'%s',['reading diagnostic horiz model data']); 15 15 md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=HorizAnalysisEnum; models.dh=CreateFemModel(md); 16 16 17 displaystring(md. debug,'\n%s',['reading diagnostic vert model data']);17 displaystring(md.verbose,'\n%s',['reading diagnostic vert model data']); 18 18 md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=VertAnalysisEnum; models.dv=CreateFemModel(md); 19 19 20 displaystring(md. debug,'\n%s',['reading diagnostic stokes model data']);20 displaystring(md.verbose,'\n%s',['reading diagnostic stokes model data']); 21 21 md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=StokesAnalysisEnum; models.ds=CreateFemModel(md); 22 22 23 displaystring(md. debug,'\n%s',['reading diagnostic hutter model data']);23 displaystring(md.verbose,'\n%s',['reading diagnostic hutter model data']); 24 24 md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=HutterAnalysisEnum; models.dhu=CreateFemModel(md); 25 25 26 displaystring(md. debug,'\n%s',['reading surface and bed slope computation model data']);26 displaystring(md.verbose,'\n%s',['reading surface and bed slope computation model data']); 27 27 md.analysis_type=SlopeComputeAnalysisEnum; md.sub_analysis_type=NoneAnalysisEnum; models.sl=CreateFemModel(md); 28 28 29 29 %Build all models requested for thermal simulation 30 displaystring(md. debug,'%s',['reading thermal model data']);30 displaystring(md.verbose,'%s',['reading thermal model data']); 31 31 md.analysis_type=ThermalAnalysisEnum(); md.sub_analysis_type=NoneAnalysisEnum(); models.t=CreateFemModel(md); 32 32 33 displaystring(md. debug,'%s',['reading melting model data']);33 displaystring(md.verbose,'%s',['reading melting model data']); 34 34 md.analysis_type=MeltingAnalysisEnum(); md.sub_analysis_type=NoneAnalysisEnum(); models.m=CreateFemModel(md); 35 35 … … 38 38 39 39 %initialize inputs 40 displaystring(md. debug,'\n%s',['setup inputs...']);40 displaystring(md.verbose,'\n%s',['setup inputs...']); 41 41 inputs=inputlist; 42 42 inputs=add(inputs,'velocity',models.dh.parameters.u_g,'doublevec',3,models.dh.parameters.numberofnodes); … … 75 75 %stop timing 76 76 t2=clock; 77 displaystring(md. debug,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']);77 displaystring(md.verbose,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']); -
issm/trunk/src/m/solutions/cielo/steadystate_core.m
r1872 r2330 16 16 17 17 %recover parameters common to all solutions 18 debug=m_dhu.parameters.debug;18 verbose=m_dhu.parameters.verbose; 19 19 dim=m_dhu.parameters.dim; 20 20 eps_rel=m_dhu.parameters.eps_rel; … … 36 36 while(~converged), 37 37 38 displaystring( debug,'%s%i','computing temperature and velocity for step ',step);38 displaystring(verbose,'%s%i','computing temperature and velocity for step ',step); 39 39 40 40 %first compute temperature at steady state. … … 65 65 t_g_old=results_thermal.t_g; 66 66 67 displaystring( debug,'%-60s%g\n %s%g\n %s%g%s',...67 displaystring(verbose,'%-60s%g\n %s%g\n %s%g%s',... 68 68 ' relative convergence criterion: velocity -> norm(du)/norm(u)= ',ndu/nu*100,' temperature -> norm(dt)/norm(t)=',ndt/nt*100,' eps_rel: ',eps_rel*100,' %'); 69 69 if (ndu/nu<=eps_rel) & (ndt/nt<=eps_rel), -
issm/trunk/src/m/solutions/cielo/thermal.m
r1849 r2330 11 11 12 12 %Build all models requested for diagnostic simulation 13 displaystring(md. debug,'%s',['reading thermal model data']);13 displaystring(md.verbose,'%s',['reading thermal model data']); 14 14 md.analysis_type=ThermalAnalysisEnum(); models.t=CreateFemModel(md); 15 15 16 displaystring(md. debug,'%s',['reading melting model data']);16 displaystring(md.verbose,'%s',['reading melting model data']); 17 17 md.analysis_type=MeltingAnalysisEnum(); models.m=CreateFemModel(md); 18 18 … … 21 21 22 22 %initialize inputs 23 displaystring(md. debug,'\n%s',['setup inputs...']);23 displaystring(md.verbose,'\n%s',['setup inputs...']); 24 24 inputs=inputlist; 25 25 inputs=add(inputs,'velocity',models.t.parameters.u_g,'doublevec',3,models.t.parameters.numberofnodes); … … 42 42 %stop timing 43 43 t2=clock; 44 displaystring(md. debug,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']);44 displaystring(md.verbose,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']); -
issm/trunk/src/m/solutions/cielo/thermal_core.m
r1901 r2330 14 14 results.step=1; 15 15 16 displaystring(m_t.parameters. debug,'\n%s',['computing temperatures...']);16 displaystring(m_t.parameters.verbose,'\n%s',['computing temperatures...']); 17 17 [results.t_g m_t.loads melting_offset]=thermal_core_nonlinear(m_t,inputs,ThermalAnalysisEnum(),NoneAnalysisEnum()); 18 18 19 displaystring(m_t.parameters. debug,'\n%s',['computing melting...']);19 displaystring(m_t.parameters.verbose,'\n%s',['computing melting...']); 20 20 inputs=add(inputs,'melting_offset',melting_offset,'double'); 21 21 inputs=add(inputs,'temperature',results.t_g,'doublevec',1,m_t.parameters.numberofnodes); … … 37 37 for n=1:nsteps, 38 38 39 displaystring(m_t.parameters. debug,'\n%s%i/%i\n','time step: ',n,nsteps);39 displaystring(m_t.parameters.verbose,'\n%s%i/%i\n','time step: ',n,nsteps); 40 40 results(n+1).step=n+1; 41 41 results(n+1).time=n*m_t.parameters.dt; 42 42 43 displaystring(m_t.parameters. debug,'\n%s',[' computing temperatures...']);43 displaystring(m_t.parameters.verbose,'\n%s',[' computing temperatures...']); 44 44 inputs=add(inputs,'temperature',results(n).t_g,'doublevec',1,m_t.parameters.numberofnodes); 45 45 [results(n+1).t_g m_t.loads melting_offset]=thermal_core_nonlinear(m_t,inputs,ThermalAnalysisEnum(),NoneAnalysisEnum()); 46 46 47 displaystring(m_t.parameters. debug,'\n%s',[' computing melting...']);47 displaystring(m_t.parameters.verbose,'\n%s',[' computing melting...']); 48 48 inputs=add(inputs,'temperature',results(n+1).t_g,'doublevec',1,m_t.parameters.numberofnodes); 49 49 inputs=add(inputs,'melting_offset',melting_offset,'double'); -
issm/trunk/src/m/solutions/cielo/thermal_core_nonlinear.m
r731 r2330 18 18 m.parameters.kflag=1; m.parameters.pflag=1; 19 19 20 displaystring(m.parameters. debug,'\n%s',[' starting direct shooting method']);20 displaystring(m.parameters.verbose,'\n%s',[' starting direct shooting method']); 21 21 22 22 while(~converged), … … 28 28 if ~m.parameters.lowmem 29 29 if count==1 30 displaystring(m.parameters. debug,'%s',[' system matrices']);30 displaystring(m.parameters.verbose,'%s',[' system matrices']); 31 31 [K_gg_nopenalty, p_g_nopenalty]=SystemMatrices(m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 32 32 end 33 displaystring(m.parameters. debug,'%s',[' penalty system matrices']);33 displaystring(m.parameters.verbose,'%s',[' penalty system matrices']); 34 34 [K_gg , p_g, melting_offset]=PenaltySystemMatrices(K_gg_nopenalty,p_g_nopenalty,m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 35 35 else 36 displaystring(m.parameters. debug,'%s',[' system matrices']);36 displaystring(m.parameters.verbose,'%s',[' system matrices']); 37 37 [K_gg , p_g]=SystemMatrices(m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 38 displaystring(m.parameters. debug,'%s',[' penalty system matrices']);38 displaystring(m.parameters.verbose,'%s',[' penalty system matrices']); 39 39 [K_gg , p_g, melting_offset]=PenaltySystemMatrices(K_gg,p_g,m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 40 40 end … … 47 47 48 48 %Solve 49 displaystring(m.parameters. debug,'%s%g',' condition number of stiffness matrix: ',condest(K_ff));49 displaystring(m.parameters.verbose,'%s%g',' condition number of stiffness matrix: ',condest(K_ff)); 50 50 [t_f]=Solver(K_ff,p_f,[],m.parameters); 51 51 52 52 %Merge back to g set 53 displaystring(m.parameters. debug,'%s',[' merging solution back to g set']);53 displaystring(m.parameters.verbose,'%s',[' merging solution back to g set']); 54 54 [t_g]= Mergesolutionfromftog( t_f, m.Gmn, m.ys, m.nodesets ); 55 55 56 56 %Update inputs in datasets 57 57 inputs=add(inputs,'temperature',t_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes); 58 displaystring(m.parameters. debug,'%s',[' update inputs']);58 displaystring(m.parameters.verbose,'%s',[' update inputs']); 59 59 [m.elements,m.nodes, loads,m.materials]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs); 60 60 61 61 %penalty constraints 62 displaystring(m.parameters. debug,'%s',[' penalty constraints']);62 displaystring(m.parameters.verbose,'%s',[' penalty constraints']); 63 63 [loads,constraints_converged,num_unstable_constraints] =PenaltyConstraints( m.elements,m.nodes, loads, m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 64 64 65 65 if ~converged, 66 displaystring(m.parameters. debug,'%s%i',' #unstable constraints ',num_unstable_constraints);66 displaystring(m.parameters.verbose,'%s%i',' #unstable constraints ',num_unstable_constraints); 67 67 68 68 if num_unstable_constraints<=m.parameters.min_thermal_constraints, -
issm/trunk/src/m/solutions/cielo/transient2d.m
r1720 r2330 10 10 models.analysis_type='transient'; %needed for processresults 11 11 12 displaystring(md. debug,'%s',['reading diagnostic horiz model data']);12 displaystring(md.verbose,'%s',['reading diagnostic horiz model data']); 13 13 md.analysis_type=DiagnosticAnalysisEnum(); md.sub_analysis_type=HorizAnalysisEnum(); models.dh=CreateFemModel(md); 14 14 15 displaystring(md. debug,'\n%s',['reading diagnostic vert model data']);15 displaystring(md.verbose,'\n%s',['reading diagnostic vert model data']); 16 16 md.analysis_type=DiagnosticAnalysisEnum(); md.sub_analysis_type=VertAnalysisEnum(); models.dv=CreateFemModel(md); 17 17 18 displaystring(md. debug,'\n%s',['reading diagnostic stokes model data']);18 displaystring(md.verbose,'\n%s',['reading diagnostic stokes model data']); 19 19 md.analysis_type=DiagnosticAnalysisEnum(); md.sub_analysis_type=StokesAnalysisEnum(); models.ds=CreateFemModel(md); 20 20 21 displaystring(md. debug,'\n%s',['reading diagnostic hutter model data']);21 displaystring(md.verbose,'\n%s',['reading diagnostic hutter model data']); 22 22 md.analysis_type=DiagnosticAnalysisEnum(); md.sub_analysis_type=HutterAnalysisEnum(); models.dhu=CreateFemModel(md); 23 23 24 displaystring(md. debug,'\n%s',['reading surface and bed slope computation model data']);24 displaystring(md.verbose,'\n%s',['reading surface and bed slope computation model data']); 25 25 md.analysis_type=SlopeComputeAnalysisEnum(); md.sub_analysis_type=NoneAnalysisEnum(); models.sl=CreateFemModel(md); 26 26 27 displaystring(md. debug,'%s',['reading prognostic model data']);27 displaystring(md.verbose,'%s',['reading prognostic model data']); 28 28 md.analysis_type=PrognosticAnalysisEnum(); models.p=CreateFemModel(md); 29 29 … … 39 39 40 40 %initialize inputs 41 displaystring(md. debug,'\n%s',['setup inputs...']);41 displaystring(md.verbose,'\n%s',['setup inputs...']); 42 42 inputs=inputlist; 43 43 inputs=add(inputs,'velocity',solution.u_g,'doublevec',2,models.p.parameters.numberofnodes); -
issm/trunk/src/m/solutions/cielo/transient3d.m
r1720 r2330 10 10 models.analysis_type=TransientAnalysisEnum(); %needed for processresults 11 11 12 displaystring(md. debug,'%s',['reading diagnostic horiz model data']);12 displaystring(md.verbose,'%s',['reading diagnostic horiz model data']); 13 13 md.analysis_type=DiagnosticAnalysisEnum(); md.sub_analysis_type=HorizAnalysisEnum(); models.dh=CreateFemModel(md); 14 14 15 displaystring(md. debug,'\n%s',['reading diagnostic vert model data']);15 displaystring(md.verbose,'\n%s',['reading diagnostic vert model data']); 16 16 md.analysis_type=DiagnosticAnalysisEnum(); md.sub_analysis_type=VertAnalysisEnum(); models.dv=CreateFemModel(md); 17 17 18 displaystring(md. debug,'\n%s',['reading diagnostic stokes model data']);18 displaystring(md.verbose,'\n%s',['reading diagnostic stokes model data']); 19 19 md.analysis_type=DiagnosticAnalysisEnum(); md.sub_analysis_type=StokesAnalysisEnum(); models.ds=CreateFemModel(md); 20 20 21 displaystring(md. debug,'\n%s',['reading diagnostic hutter model data']);21 displaystring(md.verbose,'\n%s',['reading diagnostic hutter model data']); 22 22 md.analysis_type=DiagnosticAnalysisEnum(); md.sub_analysis_type=HutterAnalysisEnum(); models.dhu=CreateFemModel(md); 23 23 24 displaystring(md. debug,'\n%s',['reading surface and bed slope computation model data']);24 displaystring(md.verbose,'\n%s',['reading surface and bed slope computation model data']); 25 25 md.analysis_type=SlopeComputeAnalysisEnum(); md.sub_analysis_type=NoneAnalysisEnum(); models.sl=CreateFemModel(md); 26 26 27 displaystring(md. debug,'%s',['reading prognostic model data']);27 displaystring(md.verbose,'%s',['reading prognostic model data']); 28 28 md.analysis_type=PrognosticAnalysisEnum(); models.p=CreateFemModel(md); 29 29 30 30 %Build all models related to thermal 31 displaystring(md. debug,'%s',['reading thermal model data']);31 displaystring(md.verbose,'%s',['reading thermal model data']); 32 32 md.analysis_type=ThermalAnalysisEnum(); models.t=CreateFemModel(md); 33 33 34 displaystring(md. debug,'%s',['reading melting model data']);34 displaystring(md.verbose,'%s',['reading melting model data']); 35 35 md.analysis_type=MeltingAnalysisEnum(); models.m=CreateFemModel(md); 36 36 … … 51 51 52 52 %initialize inputs 53 displaystring(md. debug,'\n%s',['setup inputs...']);53 displaystring(md.verbose,'\n%s',['setup inputs...']); 54 54 inputs=inputlist; 55 55 inputs=add(inputs,'velocity',results.u_g,'doublevec',3,models.p.parameters.numberofnodes); … … 70 70 while time<finaltime+dt, %make sure we run up to finaltime. 71 71 72 displaystring(md. debug,'\n%s%g%s%g%s%g\n','time [yr]: ',time,' iteration number: ',n,'/',floor(finaltime/dt));72 displaystring(md.verbose,'\n%s%g%s%g%s%g\n','time [yr]: ',time,' iteration number: ',n,'/',floor(finaltime/dt)); 73 73 74 74 results(n+1).step=n+1; … … 84 84 85 85 %Deal with temperature first 86 displaystring(md. debug,'\n%s',[' computing temperatures...']);86 displaystring(md.verbose,'\n%s',[' computing temperatures...']); 87 87 [results(n+1).t_g models.t.loads melting_offset]=thermal_core_nonlinear(models.t,inputs,ThermalAnalysisEnum(),TransientAnalysisEnum()); 88 88 inputs=add(inputs,'temperature',results(n+1).t_g,'doublevec',1,models.t.parameters.numberofnodes); 89 89 90 displaystring(md. debug,'\n%s',[' computing melting...']);90 displaystring(md.verbose,'\n%s',[' computing melting...']); 91 91 inputs=add(inputs,'melting_offset',melting_offset,'double'); 92 92 results(n+1).m_g=diagnostic_core_linear(models.m,inputs,MeltingAnalysisEnum(),TransientAnalysisEnum()); … … 101 101 102 102 %compute new thickness 103 displaystring(md. debug,'\n%s',[' computing new thickness...']);103 displaystring(md.verbose,'\n%s',[' computing new thickness...']); 104 104 inputs=add(inputs,'velocity',results(n+1).u_g,'doublevec',3,models.p.parameters.numberofnodes); 105 105 rawresults=prognostic_core(models,inputs,PrognosticAnalysisEnum(),NoneAnalysisEnum()); … … 107 107 108 108 %update surface and bed using the new thickness 109 displaystring(md. debug,'\n%s',[' updating geometry...']);109 displaystring(md.verbose,'\n%s',[' updating geometry...']); 110 110 [new_thickness,new_bed,new_surface]=UpdateGeometry(models.p.elements,models.p.nodes,models.p.loads,models.p.materials,models.p.parameters,new_thickness,results(n).b_g,results(n).s_g); 111 111 … … 116 116 117 117 %figure out if time stepping is good 118 %displaystring(md. debug,' checking time stepping...'));118 %displaystring(md.verbose,' checking time stepping...')); 119 119 %[back,dt,time]=TimeStepping(md,results,dt,time); 120 120 %if back, … … 123 123 124 124 %update node positions 125 displaystring(md. debug,'\n%s',[' updating node positions...']);125 displaystring(md.verbose,'\n%s',[' updating node positions...']); 126 126 models.dh.nodes=UpdateNodePositions(models.dh.elements,models.dh.nodes,models.dh.loads,models.dh.materials,new_bed,new_thickness); 127 127 models.dv.nodes=UpdateNodePositions(models.dv.elements,models.dv.nodes,models.dv.loads,models.dv.materials,new_bed,new_thickness); -
issm/trunk/src/m/solutions/dakota/preqmu.m
r2206 r2330 20 20 global ISSM_DIR; 21 21 22 displaystring(md. debug,'\n%s\n','preprocessing dakota inputs');22 displaystring(md.verbose,'\n%s\n','preprocessing dakota inputs'); 23 23 24 24 %first create temporary directory in which we will work -
issm/trunk/src/m/utils/BC/SetIceSheetBC.m
r2281 r2330 37 37 end 38 38 39 displaystring(md. debug,'%s',[' boundary conditions for prognostic model initialization']);39 displaystring(md.verbose,'%s',[' boundary conditions for prognostic model initialization']); 40 40 md.spcthickness=zeros(md.numberofgrids,2); 41 41 42 42 if (length(md.observed_temperature)==md.numberofgrids), 43 displaystring(md. debug,'%s',[' boundary conditions for thermal model']);43 displaystring(md.verbose,'%s',[' boundary conditions for thermal model']); 44 44 md.spctemperature=[md.gridonsurface md.observed_temperature]; %impose observed temperature on surface 45 45 if (length(md.geothermalflux)~=md.numberofgrids), -
issm/trunk/src/m/utils/BC/SetIceShelfBC.m
r2281 r2330 55 55 end 56 56 57 displaystring(md. debug,'%s',[' boundary conditions for prognostic model initialization']);57 displaystring(md.verbose,'%s',[' boundary conditions for prognostic model initialization']); 58 58 md.spcthickness=zeros(md.numberofgrids,2); 59 59 60 60 if (length(md.observed_temperature)==md.numberofgrids), 61 displaystring(md. debug,'%s',[' boundary conditions for thermal model']);61 displaystring(md.verbose,'%s',[' boundary conditions for thermal model']); 62 62 md.spctemperature=[md.gridonsurface md.observed_temperature]; %impose observed temperature on surface 63 63 if (length(md.geothermalflux)~=md.numberofgrids), -
issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m
r2281 r2330 67 67 end 68 68 69 displaystring(md. debug,'%s',[' boundary conditions for prognostic model initialization']);69 displaystring(md.verbose,'%s',[' boundary conditions for prognostic model initialization']); 70 70 md.spcthickness=zeros(md.numberofgrids,2); 71 71 72 72 if (length(md.observed_temperature)==md.numberofgrids), 73 displaystring(md. debug,'%s',[' boundary conditions for thermal model']);73 displaystring(md.verbose,'%s',[' boundary conditions for thermal model']); 74 74 md.spctemperature=[md.gridonsurface md.observed_temperature]; %impose observed temperature on surface 75 75 if (length(md.geothermalflux)~=md.numberofgrids), -
issm/trunk/src/m/utils/String/displaystring.m
r330 r2330 1 function displaystring( debug,format,varargin)1 function displaystring(flag,format,varargin) 2 2 %DISPLAY - display string in solution sequences. wrapper to disp and sprintf. 3 3 % 4 4 % Usage: 5 % displaystring( debug,format,string)6 % debug can be used to switch display on and off5 % displaystring(flag,format,string) 6 % flag can be used to switch display on and off 7 7 % 8 8 % Example: 9 9 % display(1,'%s\n','string to display'); 10 10 11 if debug,11 if flag, 12 12 disp(sprintf(format,varargin{:})); 13 13 end
Note:
See TracChangeset
for help on using the changeset viewer.