Changeset 19235


Ignore:
Timestamp:
04/01/15 09:57:08 (10 years ago)
Author:
Mathieu Morlighem
Message:

BUG: do not get coefficient by defualt

File:
1 edited

Legend:

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

    r19234 r19235  
    402402        Input* slopey_input    = element->GetInput(SurfaceSlopeYEnum);        _assert_(slopey_input);
    403403        Input* thickness_input = element->GetInput(ThicknessEnum);            _assert_(thickness_input);
    404         Input* drag_input      = element->GetInput(FrictionCoefficientEnum);  _assert_(drag_input);
     404        Input* drag_input      = NULL;
     405        Friction* friction     = NULL;
     406        if(frictionlaw!=5){
     407                drag_input = element->GetInput(FrictionCoefficientEnum);  _assert_(drag_input);
     408        }
     409        else{
     410                friction=new Friction(element,3);
     411        }
    405412
    406413        /*Get Vertical segment indices*/
     
    443450                /*Deal with basal velocities*/
    444451                if(element->IsOnBase()){
    445                         drag_input->GetInputValue(&drag,gauss);
    446 
    447452                        switch(frictionlaw){
    448453                                case 1:
     
    453458                                case 2:
    454459                                        /*Ritz et al. 1996*/
     460                                        drag_input->GetInputValue(&drag,gauss);
    455461                                        ub=drag*(rho_ice*gravity*thickness)*(rho_ice*gravity*thickness)*slope[0]/sqrt(slope2);
    456462                                        vb=drag*(rho_ice*gravity*thickness)*(rho_ice*gravity*thickness)*slope[1]/sqrt(slope2);
     
    458464                                case 3:
    459465                                        /*Rutt et al. 2009*/
     466                                        drag_input->GetInputValue(&drag,gauss);
    460467                                        ub=-drag*rho_ice*gravity*thickness*slope[0];
    461468                                        vb=-drag*rho_ice*gravity*thickness*slope[1];
     
    463470                                case 4:
    464471                                        /*Henning Akesson*/
     472                                        drag_input->GetInputValue(&drag,gauss);
    465473                                        drag = -4e-15 * surface + 8.6e-12;
    466474                                        ub=-drag*rho_ice*gravity*thickness*slope[0];
     
    468476                                        break;
    469477                                case 5: /*Weertman temp for Kevin*/{
    470                                         Friction* friction=new Friction(element,3);
    471478                                        friction->GetAlpha2WeertmanTemp(&drag,gauss);
    472479                                        ub = -1./drag * rho_ice*gravity*thickness*slope[0];
     
    487494        xDelete<int>(pairindices);
    488495        xDelete<IssmDouble>(xyz_list);
     496        delete friction;
    489497        return pe;
    490498
Note: See TracChangeset for help on using the changeset viewer.