Changeset 25541


Ignore:
Timestamp:
09/08/20 16:11:40 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: skip elements that don't have ice in CFL condition

File:
1 edited

Legend:

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

    r25539 r25541  
    29412941void FemModel::TimeAdaptx(IssmDouble* pdt){/*{{{*/
    29422942
    2943         /*output: */
    2944         IssmDouble   dt;
    2945 
    29462943        /*intermediary: */
    2947         IssmDouble   min_dt      = 0;
    2948         IssmDouble   node_min_dt = 0;
     2944        IssmDouble   min_dt      = 1.e+50;
     2945        IssmDouble   node_min_dt = 0.;
    29492946
    29502947        /*Go through elements, and figure out the minimum of the time steps for each element (using CFL criterion): */
    2951         Element* element=(Element*)elements->GetObjectByOffset(0); min_dt=element->TimeAdapt();
    2952 
    2953         for(Object* & object : this->elements->objects){
    2954                 element = xDynamicCast<Element*>(object);
    2955                 dt=element->TimeAdapt();
    2956                 if(dt<min_dt)min_dt=dt;
     2948        for(Object* & object : this->elements->objects){
     2949                Element* element = xDynamicCast<Element*>(object);
     2950                if(element->IsIceInElement()){ /*verify if there is ice in the element*/
     2951                        IssmDouble dt=element->TimeAdapt();
     2952                        if(dt<min_dt)min_dt=dt;
     2953                }
    29572954        }
    29582955
     
    29712968        /*Assign output pointers:*/
    29722969        *pdt=min_dt;
    2973 }
    2974 /*}}}*/
     2970}/*}}}*/
    29752971void FemModel::TotalCalvingFluxLevelsetx(IssmDouble* pM, bool scaled){/*{{{*/
    29762972
Note: See TracChangeset for help on using the changeset viewer.