Changeset 27176
- Timestamp:
- 08/02/22 02:53:11 (3 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp
r27170 r27176 16 16 /*If fsize is 0, return NULL vector*/ 17 17 if(fsize==0){ 18 *puf=NULL; 18 Vector<IssmDouble>* uf=new Vector<IssmDouble>(0); 19 *puf=uf; 20 //*puf=NULL; 19 21 return; 20 22 } -
issm/trunk-jpl/src/c/solutionsequences/convergence.cpp
r27171 r27176 1 1 /*!\file: convergence.cpp 2 2 * \brief: figure out if convergence has been reached 3 */ 3 */ 4 4 5 5 #include "../classes/classes.h" … … 21 21 IssmDouble res; 22 22 int analysis_type; 23 int ufsize; 23 24 24 25 if(VerboseModule()) _printf0_(" checking convergence\n"); 25 26 26 /*If uf is NULL in input, f-set is nil, model is fully constrained, therefore converged from 27 /*If uf is NULL in input, f-set is nil, model is fully constrained, therefore converged from 27 28 * the get go: */ 28 if(uf->IsEmpty()){ 29 uf->GetSize(&ufsize); 30 if(ufsize==0){ 29 31 *pconverged=true; 30 32 return; 31 33 } 34 35 /* if(uf->IsEmpty()){ */ 36 /* *pconverged=true; */ 37 /* return; */ 38 /* } */ 32 39 33 40 /*Force equilibrium (Mandatory)*/ … … 54 61 converged=true; 55 62 } 56 else{ 63 else{ 57 64 if(VerboseConvergence()) _printf0_(setw(50)<<left<<" mechanical equilibrium convergence criterion"<<res*100<<" > "<<eps_res*100<<" %\n"); 58 65 converged=false; … … 64 71 //compute norm(du)/norm(u) 65 72 duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0); 66 ndu=duf->Norm(NORM_TWO); nu=old_uf->Norm(NORM_TWO) ;73 ndu=duf->Norm(NORM_TWO); nu=old_uf->Norm(NORM_TWO)+1.e-14; 67 74 68 75 if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!"); … … 76 83 if(VerboseConvergence()) _printf0_(setw(50) << left << " Convergence criterion: norm(du)/norm(u)" << ndu/nu*100 << " < " << eps_rel*100 << " %\n"); 77 84 } 78 else{ 85 else{ 79 86 if(VerboseConvergence()) _printf0_(setw(50) << left << " Convergence criterion: norm(du)/norm(u)" << ndu/nu*100 << " > " << eps_rel*100 << " %\n"); 80 87 converged=false;
Note:
See TracChangeset
for help on using the changeset viewer.