Changeset 17006
- Timestamp:
- 12/04/13 16:59:05 (11 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r17001 r17006 4659 4659 bool isefficientlayer; 4660 4660 bool active_element; 4661 int transfermethod ;4661 int transfermethod,step; 4662 4662 IssmDouble sed_trans,sed_thick; 4663 4663 IssmDouble leakage,h_max; … … 4666 4666 IssmDouble epl_specificstoring[numdof],sedstoring[numdof]; 4667 4667 IssmDouble epl_head[numdof],sed_head[numdof]; 4668 IssmDouble old_transfer[numdof]; 4668 4669 4669 4670 Input* active_element_input=NULL; 4670 4671 4672 4671 4673 GetDofList(&doflist,NoneApproximationEnum,GsetEnum); 4672 4674 4673 4675 /*Get the flag to know if the efficient layer is present*/ 4674 4676 this->parameters->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum); 4677 4678 this->parameters->FindParam(&step,StepEnum); 4675 4679 4676 4680 if(isefficientlayer){ … … 4685 4689 case 1: 4686 4690 4691 4687 4692 active_element_input=inputs->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input); 4688 4693 active_element_input->GetInputValue(&active_element); … … 4698 4703 4699 4704 if(!active_element){ 4700 4701 4705 /*No transfer if the EPL is not active*/ 4702 for(int i=0;i<numdof;i++){4703 wh_trans=0.0;4704 /*Assign output pointer*/4705 transfer->SetValue(doflist[i],wh_trans,INS_VAL);4706 }4706 /* for(int i=0;i<numdof;i++){ */ 4707 /* wh_trans=0.0; */ 4708 /* /\*Assign output pointer*\/ */ 4709 /* transfer->SetValue(doflist[i],wh_trans,INS_VAL); */ 4710 /* } */ 4707 4711 } 4708 4712 else{ 4709 4713 4714 //GetInputListOnVertices(&old_transfer[0],WaterTransferEnum); 4715 4710 4716 for(int i=0;i<numdof;i++){ 4711 4717 epl_specificstoring[i]=matpar->GetEplSpecificStoring(); 4712 4718 sedstoring[i]=matpar->GetSedimentStoring(); 4713 4719 this->GetHydrologyDCInefficientHmax(&h_max,i); 4720 4714 4721 /*EPL head higher than sediment head, transfer from the epl to the sediment*/ 4715 4722 if(epl_head[i]>sed_head[i]){ 4716 4723 wh_trans=epl_specificstoring[i]*epl_thickness[i]*sed_trans*(epl_head[i]-sed_head[i])/(leakage*sed_thick); 4717 4724 4718 4725 /*No transfer if the sediment head is allready at the maximum*/ 4719 this->GetHydrologyDCInefficientHmax(&h_max,i); 4720 if(sed_head[i]>=h_max)wh_trans=0.0; 4726 if(sed_head[i]>=h_max){ 4727 wh_trans=0.0; 4728 } 4721 4729 } 4722 4730 /*EPL head lower than sediment head, transfer from the sediment to the epl*/ 4723 4731 else if(epl_head[i]<=sed_head[i]){ 4724 wh_trans=sedstoring[i]*sed_trans*(epl_head[i]-sed_head[i])/(leakage*sed_thick); 4732 wh_trans=sedstoring[i]*sed_trans*(epl_head[i]-sed_head[i])/(leakage*sed_thick); 4725 4733 } 4734 4735 /*Introduce relaxation*/ 4736 //wh_trans=old_transfer[i]+0.9*(wh_trans-old_transfer[i]); 4737 4726 4738 /*Assign output pointer*/ 4727 4739 transfer->SetValue(doflist[i],wh_trans,INS_VAL); 4728 /* if(nodes[i]->id>=54){ */4729 /* printf("%i %e %e %e \n",nodes[i]->id-54,wh_trans,sed_head[i],epl_head[i]); */4730 /* } */4731 /* else{*/4732 /* printf("%i %e %e %e \n",nodes[i]->id,wh_trans,sed_head[i],epl_head[i]); */4733 4740 } 4734 4741 } … … 4799 4806 } 4800 4807 /*If epl thickness gets under 0, close the layer*/ 4801 /* else if(epl_thickness[i]<0.0){ */4802 /* vec_mask->SetValue(nodes[i]->Sid(),0.,INS_VAL); */4803 /* } */4808 else if(epl_thickness[i]<0.0){ 4809 vec_mask->SetValue(nodes[i]->Sid(),0.,INS_VAL); 4810 } 4804 4811 /*Increase of the efficient system is needed if the epl head reach the maximum value (sediment max value for now)*/ 4805 4812 this->GetHydrologyDCInefficientHmax(&h_max,i); -
issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp
r16904 r17006 382 382 /*FUNCTION Matpar::GetSedimentStoring {{{*/ 383 383 IssmDouble Matpar::GetSedimentStoring(){ 384 return this->rho_freshwater * this->g* this->sediment_porosity* this->sediment_thickness*385 ( this->water_compressibility+( this->sediment_compressibility/ this->sediment_porosity));384 return this->rho_freshwater * this->g * this->sediment_porosity * this->sediment_thickness * 385 (this->water_compressibility + (this->sediment_compressibility / this->sediment_porosity)); 386 386 } 387 387 /*}}}*/ 388 388 /*FUNCTION Matpar::GetEplSpecificStoring {{{*/ 389 389 IssmDouble Matpar::GetEplSpecificStoring(){ 390 return this->rho_freshwater * this->g* this->epl_porosity*391 ( this->water_compressibility+( this->epl_compressibility/ this->epl_porosity));390 return this->rho_freshwater * this->g * this->epl_porosity * 391 (this->water_compressibility + (this->epl_compressibility / this->epl_porosity)); 392 392 } 393 393 /*}}}*/ -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_hydro_nonlinear.cpp
r16963 r17006 80 80 ug_sed->Copy(ug_sed_main_iter); 81 81 82 //test83 /* uf_sed_sub_iter=uf_sed->Duplicate(); */84 /* uf_sed->Copy(uf_sed_sub_iter); */85 86 82 if(isefficientlayer){ 87 83 ug_epl_main_iter=ug_epl->Duplicate(); 88 84 ug_epl->Copy(ug_epl_main_iter); 89 //test90 ug_epl_sub_iter=ug_epl->Duplicate();91 ug_epl->Copy(ug_epl_sub_iter);92 85 } 93 86 … … 104 97 sedconverged=false; 105 98 for(;;){ 99 106 100 uf_sed_sub_iter=uf_sed->Duplicate();_assert_(uf_sed_sub_iter); 107 101 uf_sed->Copy(uf_sed_sub_iter); … … 121 115 if(num_unstable_constraints==0) sedconverged = true; 122 116 if (sedcount>=hydro_maxiter){ 117 //sedconverged=true; 123 118 _error_(" maximum number of Sediment iterations (" << hydro_maxiter << ") exceeded"); 124 119 } … … 128 123 129 124 if(sedconverged){ 130 sedconverged=false; 125 if(isefficientlayer){ 126 /*Updating Elemental Mask*/ 127 HydrologyDCInefficientAnalysis* analysis = new HydrologyDCInefficientAnalysis(); 128 analysis->ElementizeEplMask(femmodel); 129 delete analysis; 130 femmodel->HydrologyTransferx(); 131 } 132 sedconverged=false; 133 /*Checking convegence on the value of the sediment head*/ 131 134 duf=uf_sed_sub_iter->Duplicate();_assert_(duf); 132 135 uf_sed_sub_iter->Copy(duf); … … 137 140 if (xIsNan<IssmDouble>(ndu_sed) || xIsNan<IssmDouble>(nu_sed)) _error_("convergence criterion is NaN!"); 138 141 if (ndu_sed==0.0 && nu_sed==0.0) nu_sed=1.0e-6; /*Hacking the case where the EPL is used but empty*/ 142 if(VerboseConvergence()) _printf0_(setw(50) << left << " Inner Sediment Convergence criterion:" << ndu_sed/nu_sed*100 << " aiming lower than " << eps_hyd*100 << " %\n"); 139 143 if((ndu_sed/nu_sed)<eps_hyd){ 140 144 if(VerboseConvergence()) _printf0_(" # Inner sediment convergence achieve \n"); … … 145 149 146 150 if(sedconverged){ 147 if(isefficientlayer){148 /*Updating Nodal Mask*/149 HydrologyDCInefficientAnalysis* analysis = new HydrologyDCInefficientAnalysis();150 analysis->ElementizeEplMask(femmodel);151 delete analysis;152 femmodel->HydrologyTransferx();153 }154 151 femmodel->parameters->SetParam(sediment_kmax,HydrologySedimentKmaxEnum); 155 152 InputUpdateFromConstantx(femmodel,sedconverged,ConvergedEnum); … … 166 163 InputUpdateFromConstantx(femmodel,true,ResetPenaltiesEnum); 167 164 InputUpdateFromConstantx(femmodel,false,ConvergedEnum); 168 femmodel->HydrologyEPLupdateDomainx();169 165 femmodel->parameters->SetParam(HydrologyEfficientEnum,HydrologyLayerEnum); 170 166 … … 188 184 //updating mask after the computation of the epl thickness (Allow to close too thin EPL) 189 185 femmodel->HydrologyEPLupdateDomainx(); 186 190 187 ug_epl_sub_iter=ug_epl->Duplicate();_assert_(ug_epl_sub_iter); 191 ug_epl->Copy(ug_epl_sub_iter);_assert_(ug_epl); 192 188 ug_epl->Copy(ug_epl_sub_iter); 193 189 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 194 190 CreateNodalConstraintsx(&ys,femmodel->nodes,HydrologyDCEfficientAnalysisEnum); … … 204 200 InputUpdateFromSolutionx(femmodel,ug_epl); 205 201 ConstraintsStatex(&constraints_converged,&num_unstable_constraints,femmodel); 206 femmodel->HydrologyEPLupdateDomainx(); 202 207 203 208 204 if (!eplconverged){ … … 210 206 if(num_unstable_constraints==0) eplconverged = true; 211 207 if (eplcount>=hydro_maxiter){ 212 /*Hacking to get the results of non converged runs*/ 213 //eplconverged = true; 208 //eplconverged =true; 214 209 _error_(" maximum number of EPL iterations (" << hydro_maxiter << ") exceeded"); 215 210 } … … 220 215 if(eplconverged){ 221 216 eplconverged=false; 217 222 218 dug=ug_epl_sub_iter->Duplicate();_assert_(dug); 223 219 ug_epl_sub_iter->Copy(dug); … … 229 225 if (xIsNan<IssmDouble>(ndu_epl) || xIsNan<IssmDouble>(nu_epl)) _error_("convergence criterion is NaN!"); 230 226 if (ndu_epl==0.0 && nu_epl==0.0) nu_epl=1.0e-6; /*Hacking the case where the EPL is used but empty*/ 227 if(VerboseConvergence()) _printf0_(setw(50) << left << " Inner EPL Convergence criterion:" << ndu_epl/nu_epl*100 << " aiming lower than " << eps_hyd*100 << " %\n"); 231 228 if((ndu_epl/nu_epl)<eps_hyd)eplconverged=true; 232 229 } … … 234 231 235 232 if(eplconverged){ 236 237 /*Updating Nodal Mask*/ 233 /*Updating Elemental Mask*/ 238 234 HydrologyDCInefficientAnalysis* analysis = new HydrologyDCInefficientAnalysis(); 239 235 analysis->ElementizeEplMask(femmodel); 240 236 delete analysis; 241 237 femmodel->HydrologyTransferx(); 242 238 243 239 InputUpdateFromConstantx(femmodel,eplconverged,ConvergedEnum); 244 240 InputUpdateFromConstantx(femmodel,sediment_kmax,MeltingOffsetEnum); … … 248 244 } 249 245 } 250 251 246 252 247 /*System convergence check*/ … … 303 298 hydrocount++; 304 299 if(hydroconverged)break; 305 300 } 306 301 307 302 InputUpdateFromSolutionx(femmodel,ug_sed);
Note:
See TracChangeset
for help on using the changeset viewer.