source: issm/oecreview/Archive/27230-27343/ISSM-27293-27294.diff

Last change on this file was 27344, checked in by Mathieu Morlighem, 2 years ago

CHG: added Archive/27230-27343

File size: 2.6 KB
  • ../trunk-jpl/src/c/classes/Elements/Penta.cpp

     
    39003900IssmDouble Penta::TimeAdapt(void){/*{{{*/
    39013901
    39023902        /*intermediary: */
     3903        bool       ishydro;
    39033904        IssmDouble C;
    39043905        IssmDouble xyz_list[NUMVERTICES][3];
    39053906
    39063907        /*get CFL coefficient:*/
    39073908        this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
     3909        this->parameters->FindParam(&ishydro,TransientIshydrologyEnum);
    39083910
    39093911        /*Get for Vx and Vy, the max of abs value: */
    39103912        Input* vx_input = this->GetInput(VxEnum); _assert_(vx_input);
     
    39393941        /*CFL criterion: */
    39403942        IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy+maxabsvz/dz + 1.e-18);
    39413943
     3944        /*Check hydro timestep also and take the minimum*/
     3945        if(ishydro){
     3946                if(IsOnBase()){
     3947                        Input* vx_input = this->GetInput(HydrologyWaterVxEnum); _assert_(vx_input);
     3948                        Input* vy_input = this->GetInput(HydrologyWaterVyEnum); _assert_(vy_input);
     3949                        IssmDouble maxabsvx = vx_input->GetInputMaxAbs();
     3950                        IssmDouble maxabsvy = vy_input->GetInputMaxAbs();
     3951
     3952                        /*CFL criterion: */
     3953                        IssmDouble dt2 = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
     3954                        if(dt2<dt) dt = dt2;
     3955                }
     3956        }
     3957
    39423958        return dt;
    39433959}/*}}}*/
    39443960IssmDouble Penta::TotalCalvingFluxLevelset(bool scaled){/*{{{*/
  • ../trunk-jpl/src/c/classes/Elements/Tria.cpp

     
    52525252IssmDouble Tria::TimeAdapt(void){/*{{{*/
    52535253
    52545254        /*intermediary: */
     5255        bool       ishydro;
    52555256        IssmDouble C;
    52565257        IssmDouble xyz_list[NUMVERTICES][3];
    52575258
    52585259        /*get CFL coefficient:*/
    52595260        this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
     5261        this->parameters->FindParam(&ishydro,TransientIshydrologyEnum);
    52605262
    52615263        /*Get for Vx and Vy, the max of abs value: */
    52625264        Input* vx_input = this->GetInput(VxEnum); _assert_(vx_input);
     
    52845286        /*CFL criterion: */
    52855287        IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
    52865288
     5289        /*Check hydro timestep also and take the minimum*/
     5290        if(ishydro){
     5291                Input* vx_input = this->GetInput(HydrologyWaterVxEnum); _assert_(vx_input);
     5292                Input* vy_input = this->GetInput(HydrologyWaterVyEnum); _assert_(vy_input);
     5293                IssmDouble maxabsvx = vx_input->GetInputMaxAbs();
     5294                IssmDouble maxabsvy = vy_input->GetInputMaxAbs();
     5295
     5296                /*CFL criterion: */
     5297                IssmDouble dt2 = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
     5298                if(dt2<dt) dt = dt2;
     5299        }
     5300
    52875301        return dt;
    52885302}
    52895303/*}}}*/
Note: See TracBrowser for help on using the repository browser.