Ignore:
Timestamp:
11/01/13 10:09:33 (11 years ago)
Author:
bdef
Message:

Adding a ZigZag lock for hydrology and framing the variable thickness of the EPL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp

    r16228 r16600  
    640640
    641641        //   The penalty is stable if it doesn't change during two consecutive iterations.   
    642         int        unstable        = 0;
     642        int        unstable=0;
    643643        int        new_active;
     644        int        penalty_lock;
    644645        IssmDouble pressure;
    645646        IssmDouble h;
     
    656657        element->GetInputValue(&h,node,SedimentHeadEnum);
    657658        element->GetHydrologyDCInefficientHmax(&h_max,node);
     659        parameters->FindParam(&penalty_lock,HydrologydcPenaltyLockEnum);
     660
    658661        if (h>h_max)
    659662         new_active=1;
     
    661664         new_active=0;
    662665
    663         if(this->active==new_active)
    664          unstable=0;
    665         else
    666          unstable=1;
    667 
     666        if(this->active==new_active){
     667                unstable=0;
     668        }
     669        else{
     670                unstable=1;
     671                if(penalty_lock)zigzag_counter++;
     672        }
     673
     674        /*If penalty keeps zigzagging more than penalty_lock times: */
     675        if(penalty_lock){
     676                if(zigzag_counter>penalty_lock){
     677                        unstable=0;
     678                        active=1;
     679                }
     680        }
    668681        /*Set penalty flag*/
    669682        this->active=new_active;
Note: See TracChangeset for help on using the changeset viewer.