Changeset 2156

Show
Ignore:
Timestamp:
07/04/08 16:18:11 (5 months ago)
Author:
peter
Message:

source/grains_qheat.cpp:

Bug-fix: fix crash in grains_qheat.in due to very steep gradient in Phi.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/grains_qheat.cpp

    r2110 r2156  
    17601760                p[k] = (sum + trap1*delu[k])/(2.*Lambda[k] - Phi[0]*delu[k]); 
    17611761 
    1762                 ASSERT( p[k] > 0. ); 
     1762                // total failure -> force next step to be smaller 
     1763                if( p[k] <= 0. ) 
     1764                        return 3.*QHEAT_TOL; 
    17631765        } 
    17641766 
     
    17661768        p2k = (sum2 + trap12*step)/(2.*Lambda[k] - Phi[0]*step); 
    17671769 
    1768         ASSERT( p2k > 0. ); 
     1770        // total failure -> force next step to be smaller 
     1771        if( p2k <= 0. ) 
     1772                return 3.*QHEAT_TOL; 
    17691773 
    17701774        RelErrPk = fabs(p2k-p[k])/p[k];