Changeset 17162


Ignore:
Timestamp:
01/23/14 14:58:36 (11 years ago)
Author:
bdef
Message:

CHG: Modification in the epl system looping

Location:
issm/trunk-jpl/src/c
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp

    r17030 r17162  
    117117        /*Intermediaries*/
    118118        int      meshtype;
    119         bool     active_element;
    120119        Element* basalelement;
    121         Input*   active_element_input=NULL;
    122120
    123121        /*Get basal element*/
     
    134132        }
    135133
    136         /* active_element_input=basalelement->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input); */
    137         /* active_element_input->GetInputValue(&active_element); */
    138 
    139134        /*Check that all nodes are active, else return empty matrix*/
    140135        if(!basalelement->AllActive()) {
    141                 //if(!active_element){
    142136        if(meshtype!=Mesh2DhorizontalEnum){
    143137                        basalelement->DeleteMaterials();
     
    210204        /*Intermediaries*/
    211205        int      meshtype;
    212         bool       active_element;
    213206        Element* basalelement;
    214         Input*   active_element_input=NULL;
    215 
    216207
    217208        /*Get basal element*/
     
    227218                default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet");
    228219        }
    229         /* active_element_input=basalelement->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input); */
    230         /* active_element_input->GetInputValue(&active_element); */
    231 
    232220        /*Check that all nodes are active, else return empty matrix*/
    233221        if(!basalelement->AllActive()) {
    234                 //if(!active_element){
    235222        if(meshtype!=Mesh2DhorizontalEnum){
    236223                        basalelement->DeleteMaterials();
     
    312299
    313300void HydrologyDCEfficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
    314         int meshtype;
     301
     302        int meshtype,i;
     303        Element*   basalelement=NULL;
     304
    315305        element->FindParam(&meshtype,MeshTypeEnum);
    316         switch(meshtype){
    317                 case Mesh2DhorizontalEnum:
    318                         element->InputUpdateFromSolutionOneDof(solution,EplHeadEnum);
    319                         break;
    320                 case Mesh3DEnum:
    321                         element->InputUpdateFromSolutionOneDofCollapsed(solution,EplHeadEnum);
    322                         break;
    323                 default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet");
    324         }
    325 }/*}}}*/
     306
     307        if(meshtype!=Mesh2DhorizontalEnum){
     308                if(!element->IsOnBed()) return;
     309                basalelement=element->SpawnBasalElement();
     310        }
     311        else{
     312                basalelement = element;
     313        }
     314       
     315        /*Intermediary*/
     316        int* doflist = NULL;
     317
     318        /*Fetch number of nodes for this finite element*/
     319        int numnodes = basalelement->GetNumberOfNodes();
     320
     321        /*Fetch dof list and allocate solution vector*/
     322        basalelement->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
     323       
     324        IssmDouble* eplHeads    = xNew<IssmDouble>(numnodes);
     325        IssmDouble* eplOldHeads    = xNew<IssmDouble>(numnodes);
     326        IssmDouble  Stepping;
     327
     328
     329        /*Use the dof list to index into the solution vector: */
     330        for(i=0;i<numnodes;i++){
     331                eplHeads[i]=solution[doflist[i]];
     332                if(xIsNan<IssmDouble>(eplHeads[i])) _error_("NaN found in solution vector");
     333        }
     334
     335        /*Get previous water head*/
     336        basalelement->GetInputListOnNodes(&eplOldHeads[0],EplHeadOldEnum);
     337       
     338        for(i=0;i<numnodes;i++) {
     339                eplHeads[i] = eplOldHeads[i]+0.8*(eplHeads[i]-eplOldHeads[i]);
     340        }
     341        /*Add input to the element: */
     342        element->AddBasalInput(EplHeadEnum,eplHeads,P1Enum);
     343
     344        /*Free ressources:*/
     345        xDelete<IssmDouble>(eplHeads);
     346        xDelete<IssmDouble>(eplOldHeads);
     347        xDelete<int>(doflist);
     348        if(meshtype!=Mesh2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
     349} /*}}}*/
    326350
    327351/*Intermediaries*/
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r17158 r17162  
    15661566                                name==SedimentHeadOldEnum ||
    15671567                                name==SedimentHeadEnum ||
     1568                                name==EplHeadEnum ||
    15681569                                name==EplHeadOldEnum ||
    1569                                 name==EplHeadEnum ||
    15701570                                name==HydrologydcEplThicknessOldEnum ||
    15711571                                name==HydrologydcEplInitialThicknessEnum ||
     
    47254725        const int  numdof   = NDOF1 *NUMVERTICES;
    47264726        int        *doflist = NULL;
     4727        int        analysis_type;
    47274728        bool       isefficientlayer;
    47284729        bool       active_element;
    4729         int        transfermethod,step;
     4730        int        transfermethod;
    47304731        IssmDouble leakage,h_max;
    47314732        IssmDouble wh_trans,sed_thick;
     4733        IssmDouble epl_specificstoring,sedstoring;
    47324734        IssmDouble activeEpl[numdof],epl_thickness[numdof];
    4733         IssmDouble epl_specificstoring[numdof],sedstoring[numdof];
    47344735        IssmDouble epl_head[numdof],sed_head[numdof];
    4735         IssmDouble old_transfer[numdof],sed_trans[numdof];
     4736        IssmDouble preceding_transfer[numdof],sed_trans[numdof];
    47364737
    47374738        Input* active_element_input=NULL;
    47384739
     4740        parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    47394741               
    47404742        GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
     
    47424744        /*Get the flag to know if the efficient layer is present*/
    47434745        this->parameters->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum);
    4744 
    4745         this->parameters->FindParam(&step,StepEnum);
    47464746
    47474747        if(isefficientlayer){
    47484748                /*Also get the flag to the transfer method*/
    47494749                this->parameters->FindParam(&transfermethod,HydrologydcTransferFlagEnum);
    4750 
     4750               
    47514751                /*Switch between the different transfer methods cases*/
    47524752                switch(transfermethod){
     
    47554755                        break;
    47564756                case 1:
    4757 
    47584757       
    47594758                        active_element_input=inputs->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input);
    47604759                        active_element_input->GetInputValue(&active_element);
    47614760
    4762                         GetInputListOnVertices(&sed_head[0],SedimentHeadEnum); 
     4761                        GetInputListOnVertices(&sed_head[0],SedimentHeadEnum);
    47634762                        GetInputListOnVertices(&sed_trans[0],HydrologydcSedimentTransmitivityEnum);
    47644763                        GetInputListOnVertices(&epl_head[0],EplHeadEnum);
     
    47734772                        }
    47744773                        else{
     4774                                GetInputListOnVertices(&preceding_transfer[0],WaterTransferEnum);
     4775                                sedstoring=matpar->GetSedimentStoring();
     4776                                epl_specificstoring=matpar->GetEplSpecificStoring();
     4777                                       
     4778                                for(int i=0;i<numdof;i++){
     4779                                        this->GetHydrologyDCInefficientHmax(&h_max,i);
    47754780                       
    4776                                 GetInputListOnVertices(&old_transfer[0],WaterTransferEnum);
    4777                        
    4778                                 for(int i=0;i<numdof;i++){
    4779                                         epl_specificstoring[i]=matpar->GetEplSpecificStoring();         
    4780                                         sedstoring[i]=matpar->GetSedimentStoring();
    4781                                         this->GetHydrologyDCInefficientHmax(&h_max,i);
    4782                                                                                
    4783                                         //avoiding transfer at first time
    4784                                         if(epl_head[i]==0.0)epl_head[i]=sed_head[i];
    47854781                                        /*EPL head higher than sediment head, transfer from the epl to the sediment*/
    47864782                                        if(epl_head[i]>sed_head[i]){
    4787                                                 wh_trans=epl_specificstoring[i]*epl_thickness[i]*sed_trans[i]*(epl_head[i]-sed_head[i])/(leakage*sed_thick);                           
     4783                                                wh_trans=epl_specificstoring*epl_thickness[i]*sed_trans[i]*(epl_head[i]-sed_head[i])/(leakage*sed_thick);
    47884784                                                /*No transfer if the sediment head is allready at the maximum*/
    47894785                                                if(sed_head[i]>=h_max){
     
    47914787                                                }
    47924788                                        }
    4793                                         /*EPL head lower than sediment head, transfer from the sediment to the epl*/
     4789                                        /* EPL head lower than sediment head, transfer from the sediment to the epl */
    47944790                                        else if(epl_head[i]<=sed_head[i]){
    4795                                                 wh_trans=sedstoring[i]*sed_trans[i]*(epl_head[i]-sed_head[i])/(leakage*sed_thick);
     4791                                                wh_trans=sedstoring*sed_trans[i]*(epl_head[i]-sed_head[i])/(leakage*sed_thick);
    47964792                                        }
    4797 
    4798                                         /*Introduce relaxation*/
    4799                                         //                                      wh_trans=old_transfer[i]+0.66*(wh_trans-old_transfer[i]);
    4800 
    4801                                         /* if(this->Id()==27){ */
    4802                                                 /* printf("old %e, transfer is %e ,eplhead %e, sedhead %e, factor %e \n",old_transfer[i],wh_trans,epl_head[i],sed_head[i],epl_specificstoring[i]*epl_thickness[i]*sed_trans[i]); */
    4803                                         /* } */
    4804                                
     4793                                       
     4794                                        /*Relaxation stuff*/
     4795                                        wh_trans=preceding_transfer[i]+0.8*(wh_trans-preceding_transfer[i]);
     4796                                       
    48054797                                        /*Assign output pointer*/
    48064798                                        transfer->SetValue(doflist[i],wh_trans,INS_VAL);
    4807 
    4808                                        
    48094799                                }
    48104800                        }
     
    48464836        int         i,j;
    48474837        const int   numdof         = NDOF1 *NUMVERTICES;
     4838        IssmDouble  init_thick;
    48484839        IssmDouble  h_max;
    48494840        IssmDouble  sedheadmin;
     
    48574848        Input* active_element_input=NULL;
    48584849
     4850        init_thick = matpar->GetEplInitialThickness();
     4851
    48594852        active_element_input=inputs->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input);
    48604853        active_element_input->GetInputValue(&active_element);
     
    48764869                }
    48774870
    4878                 /*If mask was alread one, keep one*/
     4871                /*If mask was already one, keep one*/
    48794872                else if(old_active[i]>0.){
    48804873                        vec_mask->SetValue(nodes[i]->Sid(),1.,INS_VAL);
    4881                 }
    4882                 /*If epl thickness gets under 0, close the layer*/
    4883                 else if(epl_thickness[i]<0.0){
    4884                         vec_mask->SetValue(nodes[i]->Sid(),0.,INS_VAL);
     4874                        /*If epl thickness gets under , close the layer*/
     4875                        if(epl_thickness[i]<0.001*init_thick){
     4876                                vec_mask->SetValue(nodes[i]->Sid(),0.,INS_VAL);
     4877                        }
    48854878                }
    48864879                /*Increase of the efficient system is needed if the epl head reach the maximum value (sediment max value for now)*/
    48874880                this->GetHydrologyDCInefficientHmax(&h_max,i);
    4888                 //if(eplhead[i]>=h_max && this->AnyActive()){
    48894881                if(eplhead[i]>=h_max && active_element){
    48904882                        for(j=0;j<numdof;j++){
     
    48954887                                if(sedhead[j] == sedheadmin){
    48964888                                        vec_mask->SetValue(nodes[j]->Sid(),1.,INS_VAL);
    4897                                         //      break;
    48984889                                }
    48994890                        }
     
    49084899        const int   numdof         = NDOF1 *NUMVERTICES;
    49094900        bool        isefficientlayer;
     4901        bool        active_element;
    49104902        IssmDouble  n,A,dt,init_thick;
    49114903        IssmDouble  rho_water,rho_ice;
     
    49134905        IssmDouble  EPL_N,epl_conductivity;
    49144906        IssmDouble  activeEpl[numdof],thickness[numdof];
    4915         IssmDouble  eplhead[numdof], old_thickness[numdof];
     4907        IssmDouble  eplhead[numdof],old_eplhead[numdof];
    49164908        IssmDouble  epl_slopeX[numdof],epl_slopeY[numdof];
     4909        IssmDouble  preceding_thickness[numdof],old_thickness[numdof];
    49174910        IssmDouble  ice_thickness[numdof],bed[numdof];
    49184911
    4919         bool       active_element;
    49204912        Input* active_element_input=NULL;
    49214913
     
    49254917
    49264918        if(isefficientlayer){
     4919
    49274920                /*For now, assuming just one way to compute EPL thickness*/
    49284921                rho_water        = matpar->GetRhoWater();
     
    49354928                A                = material->GetAbar();
    49364929               
    4937                 //      GetInputListOnVertices(&activeEpl[0],HydrologydcMaskEplactiveNodeEnum);
    4938 
    49394930                active_element_input=inputs->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input);
    49404931                active_element_input->GetInputValue(&active_element);
     
    49474938                GetInputListOnVertices(&bed[0],BedEnum);
    49484939               
    4949                 //if(!this->AnyActive()){
    49504940                if(!active_element){
    49514941                        /*Keeping thickness to initial value if EPL is not active*/
    4952                         for(int i=0;i<numdof;i++){ 
     4942                        for(int i=0;i<numdof;i++){
    49534943                                thickness[i]=init_thick;
    49544944                        }
    49554945                }
    49564946                else{
    4957                         for(int i=0;i<numdof;i++){
    4958                                         /*Compute first the effective pressure in the EPL*/
    4959                                         EPL_N=gravity*((rho_ice*ice_thickness[i])-(rho_water*(eplhead[i]-bed[i])));
    4960                                         if(EPL_N<0.0)EPL_N=0.0;
    4961                                         /*Get then the square of the gradient of EPL heads*/
    4962                                         EPLgrad2 = (epl_slopeX[i]*epl_slopeX[i]+epl_slopeY[i]*epl_slopeY[i]);
     4947                        GetInputListOnVertices(&preceding_thickness[0],HydrologydcEplThicknessEnum);
     4948                        for(int i=0;i<numdof;i++){
     4949                               
     4950                                /*Compute first the effective pressure in the EPL*/
     4951                                EPL_N=gravity*((rho_ice*ice_thickness[i])-(rho_water*(eplhead[i]-bed[i])));
     4952                                if(EPL_N<0.0)EPL_N=0.0;
     4953                                /*Get then the square of the gradient of EPL heads*/
     4954                                EPLgrad2 = (epl_slopeX[i]*epl_slopeX[i]+epl_slopeY[i]*epl_slopeY[i]);
     4955                               
     4956                                /*And proceed to the real thing*/
     4957                                thickness[i] = old_thickness[i]*(1+((rho_water*gravity*dt)/(rho_ice*latentheat))*epl_conductivity*EPLgrad2-2.0*(A*dt/(pow(n,n)))*(pow(EPL_N,n)));
    49634958                                       
    4964                                         /*And proceed to the real thing*/
    4965                                         thickness[i] = old_thickness[i]*(1+((rho_water*gravity*dt)/(rho_ice*latentheat))*epl_conductivity*EPLgrad2-2.0*(A*dt/(pow(n,n)))*(pow(EPL_N,n)));
    4966                                         //                                      thickness[i] = old_thickness[i]+0.66*(thickness[i]-old_thickness[i]);
    4967                                         /* if(this->Id()==27){ */
    4968                                         /*      printf("old %e, thickness is %e ,eplhead %e, slopeX %e, slopeY %e\n",old_thickness[i],thickness[i],eplhead[i],epl_slopeX[i],epl_slopeY[i]); */
    4969                                         /*}*/
     4959                                /*Relaxation stuff*/
     4960                                thickness[i] = preceding_thickness[i]+0.8*(thickness[i]-preceding_thickness[i]);
    49704961                        }
    49714962                }
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r17140 r17162  
    14231423void FemModel::HydrologyTransferx(void){ /*{{{*/
    14241424
    1425         Vector<IssmDouble>* transferg=NULL; 
     1425        Vector<IssmDouble>* transferg=NULL;
    14261426
    14271427        /*Vector allocation*/
     
    14291429
    14301430        for (int i=0;i<elements->Size();i++){
     1431
    14311432                Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
    14321433                element->GetHydrologyTransfer(transferg);
     
    14401441}
    14411442/*}}}*/
     1443
    14421444void FemModel::HydrologyEPLThicknessx(void){ /*{{{*/
    14431445
  • issm/trunk-jpl/src/c/solutionsequences/solutionsequence_hydro_nonlinear.cpp

    r17030 r17162  
    3434
    3535        bool       sedconverged,eplconverged,hydroconverged;
     36        bool       transfered;
    3637        bool       isefficientlayer;
    3738        int        constraints_converged;
     
    4344        IssmDouble ndu_sed,nu_sed;
    4445        IssmDouble ndu_epl,nu_epl;
     46        IssmDouble SedConv,EplConv;
    4547
    4648        /*Recover parameters: */
     
    5153
    5254        /*FIXME, hardcoded, put on an enum*/
    53         hydro_maxiter=150;
     55        hydro_maxiter=100;
    5456
    5557        hydrocount=1;
     
    7880                sedcount=1;
    7981                eplcount=1;
     82                SedConv=1.0;
     83                EplConv=1.0;
    8084
    8185                /*If there is two layers we need an outer loop value to compute convergence*/
     
    129133                        /*Update Elemental Mask and compute transfer*/
    130134                        if(isefficientlayer){
    131                                 HydrologyDCInefficientAnalysis* analysis = new HydrologyDCInefficientAnalysis();
    132                                 analysis->ElementizeEplMask(femmodel);
    133                                 delete analysis;
    134                                 femmodel->HydrologyTransferx();
     135                                if(SedConv<0.3){
     136                                        HydrologyDCInefficientAnalysis* analysis = new HydrologyDCInefficientAnalysis();
     137                                        analysis->ElementizeEplMask(femmodel);
     138                                        delete analysis;
     139                                        femmodel->HydrologyTransferx();
     140                                        transfered=true;
     141                                }
     142                                else{
     143                                        transfered=false;
     144                                }
    135145                        }
    136146                        /*Checking convegence on the value of the sediment head*/
     
    144154                        if (ndu_sed==0.0 && nu_sed==0.0) nu_sed=1.0e-6; /*Hacking the case where the layer is empty*/
    145155                        if(VerboseConvergence()) _printf0_(setw(50) << left << "   Inner Sediment Convergence criterion:" << ndu_sed/nu_sed*100 << " aiming lower than " << eps_hyd*100 << " %\n");
     156                        SedConv = ndu_sed/nu_sed*100;
    146157                        if((ndu_sed/nu_sed)<eps_hyd){
    147158                                if(VerboseConvergence()) _printf0_("   # Inner sediment convergence achieve \n");
     
    149160                        }
    150161                        delete uf_sed_sub_iter;
    151                         if(sedconverged){
     162                        if(sedconverged && transfered){
    152163                                femmodel->parameters->SetParam(sediment_kmax,HydrologySedimentKmaxEnum);
    153164                                InputUpdateFromConstantx(femmodel,sedconverged,ConvergedEnum);
     
    161172                /* {{{ *//*Now dealing with the EPL in the same way*/
    162173                if(isefficientlayer){
    163                
    164174                        femmodel->SetCurrentConfiguration(HydrologyDCEfficientAnalysisEnum);
    165175                        /*updating mask*/
     
    170180               
    171181                        eplconverged=false;
     182
    172183                        for(;;){
     184
    173185                                ug_epl_sub_iter=ug_epl->Duplicate();_assert_(ug_epl_sub_iter);
    174186                                ug_epl->Copy(ug_epl_sub_iter);
     187
     188                                if(EplConv<0.3){
     189                                        /* {{{ *//*Retriev the EPL head slopes and compute EPL Thickness*/
     190                                        if(VerboseSolution()) _printf0_("computing EPL Head slope...\n");
     191                                        femmodel->SetCurrentConfiguration(L2ProjectionEPLAnalysisEnum);
     192                                        femmodel->UpdateConstraintsL2ProjectionEPLx();
     193                                        femmodel->parameters->SetParam(EplHeadSlopeXEnum,InputToL2ProjectEnum);
     194                                        solutionsequence_linear(femmodel);
     195                                        femmodel->parameters->SetParam(EplHeadSlopeYEnum,InputToL2ProjectEnum);
     196                                        solutionsequence_linear(femmodel);
     197                                        femmodel->SetCurrentConfiguration(HydrologyDCEfficientAnalysisEnum);
     198                                        femmodel->HydrologyEPLThicknessx();
     199                                       
     200                                        //updating mask after the computation of the epl thickness (Allow to close too thin EPL)
     201                                        femmodel->HydrologyEPLupdateDomainx();
     202                                        /* }}} */
    175203                               
    176                                 /*Loop on the epl layer to deal with the penalization, have been removed TO CHECK*/
    177                                                                                                
     204                                        /*Update Elemental Mask and compute transfer*/
     205                                        HydrologyDCInefficientAnalysis* analysis = new HydrologyDCInefficientAnalysis();
     206                                        analysis->ElementizeEplMask(femmodel);
     207                                        delete analysis;
     208                                        femmodel->HydrologyTransferx();
     209                                        transfered=true;
     210                                }
     211                                else{
     212                                        transfered=false;
     213                                }
     214                               
    178215                                SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
    179216                                CreateNodalConstraintsx(&ys,femmodel->nodes,HydrologyDCEfficientAnalysisEnum);
     
    189226                                InputUpdateFromSolutionx(femmodel,ug_epl);
    190227                                ConstraintsStatex(&constraints_converged,&num_unstable_constraints,femmodel);
    191                                
    192                                 /* {{{ *//*Start by retrieving the EPL head slopes and compute EPL Thickness*/
    193                                 if(VerboseSolution()) _printf0_("computing EPL Head slope...\n");
    194                                 femmodel->SetCurrentConfiguration(L2ProjectionEPLAnalysisEnum);
    195                                 femmodel->UpdateConstraintsL2ProjectionEPLx();
    196                                 femmodel->parameters->SetParam(EplHeadSlopeXEnum,InputToL2ProjectEnum);
    197                                 solutionsequence_linear(femmodel);
    198                                 femmodel->parameters->SetParam(EplHeadSlopeYEnum,InputToL2ProjectEnum);
    199                                 solutionsequence_linear(femmodel);
    200                                 femmodel->SetCurrentConfiguration(HydrologyDCEfficientAnalysisEnum);
    201                                 femmodel->HydrologyEPLThicknessx();
    202                                
    203                                 //updating mask after the computation of the epl thickness (Allow to close too thin EPL)
    204                                 femmodel->HydrologyEPLupdateDomainx();
    205                                 /* }}} */
    206                                
    207                                 /*Update Elemental Mask and compute transfer*/
    208                                 HydrologyDCInefficientAnalysis* analysis = new HydrologyDCInefficientAnalysis();
    209                                 analysis->ElementizeEplMask(femmodel);
    210                                 delete analysis;
    211                                 femmodel->HydrologyTransferx();
    212                                
     228                                               
    213229                                dug=ug_epl_sub_iter->Duplicate();_assert_(dug);
    214230                                ug_epl_sub_iter->Copy(dug);
     
    220236                                if (ndu_epl==0.0 && nu_epl==0.0) nu_epl=1.0e-6; /*Hacking the case where the EPL is used but empty*/
    221237                                if(VerboseConvergence()) _printf0_(setw(50) << left << "   Inner EPL Convergence criterion:" << ndu_epl/nu_epl*100 << " aiming lower than " << eps_hyd*100 << " %\n");
     238                                EplConv=ndu_epl/nu_epl*100;
    222239                                if((ndu_epl/nu_epl)<eps_hyd) eplconverged=true;
    223240                                if (eplcount>=hydro_maxiter){
    224241                                        _error_("   maximum number of EPL iterations (" << hydro_maxiter << ") exceeded");
    225242                                }
     243                               
    226244                                eplcount++;
    227245                               
    228246                                delete ug_epl_sub_iter;
    229                                 if(eplconverged){
     247                                if(eplconverged && transfered){
     248                                        if(VerboseSolution()) _printf0_("eplconverged...\n");
    230249                                        InputUpdateFromConstantx(femmodel,eplconverged,ConvergedEnum);
    231250                                        InputUpdateFromConstantx(femmodel,sediment_kmax,MeltingOffsetEnum);
     
    259278                        if (ndu_epl==0.0 && nu_epl==0.0) nu_epl=1.0e-6; /*Hacking the case where the EPL is used but empty*/
    260279                        if (!xIsNan<IssmDouble>(eps_hyd)){
    261                                 if ((ndu_epl/nu_epl)<eps_hyd && (ndu_sed/nu_sed)<(eps_hyd*10)){
     280                                if ((ndu_epl/nu_epl)<eps_hyd && (ndu_sed/nu_sed)<(eps_hyd)){
    262281                                        if (VerboseConvergence()) _printf0_(setw(50) << left << "   Converged after, " << hydrocount << " iterations \n");
    263282                                        hydroconverged=true;
Note: See TracChangeset for help on using the changeset viewer.