Changeset 22308


Ignore:
Timestamp:
12/22/17 10:10:23 (7 years ago)
Author:
Mathieu Morlighem
Message:

CHG: do not call element->GetMaterialParameter(MaterialsRheologyBEnum) anymore since this is NOT a constant

Location:
issm/trunk-jpl/src/c
Files:
4 edited

Legend:

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

    r22284 r22308  
    522522        int         iseplthickcomp;
    523523        int         domaintype;
    524         IssmDouble  dt,A,B;
     524        IssmDouble  dt,A;
    525525        IssmDouble  EPLgrad2;
    526526        IssmDouble  EPL_N;
     
    534534                Element* element=(Element*)femmodel->elements->GetObjectByOffset(j);
    535535               
    536                 switch(domaintype){
    537                 case Domain2DhorizontalEnum:
    538                         if(!element->IsOnBase()) return;       
    539                         B = element->GetMaterialParameter(MaterialsRheologyBbarEnum);
    540                         break;
    541                 case Domain3DEnum:
    542                         B = element->GetMaterialParameter(MaterialsRheologyBEnum);
    543                         break;
    544                 default:
    545                 _error_("not Implemented Yet");
    546                 }
     536                /*skip element if 3d and not on base*/
     537                if(domaintype==Domain3DEnum && !element->IsOnBase()) continue;
    547538               
    548539                int         numnodes      = element->GetNumberOfNodes();
    549540                IssmDouble* thickness     = xNew<IssmDouble>(numnodes);
     541                IssmDouble* B             = xNew<IssmDouble>(numnodes);
    550542                IssmDouble* eplhead       = xNew<IssmDouble>(numnodes);
    551543                IssmDouble* epl_slopeX    = xNew<IssmDouble>(numnodes);
     
    569561                IssmDouble init_thick       =   element->GetMaterialParameter(HydrologydcEplInitialThicknessEnum);
    570562                IssmDouble max_thick        =   element->GetMaterialParameter(HydrologydcEplMaxThicknessEnum);
    571                
    572                 A=pow(B,-n);
     563
     564                switch(domaintype){
     565                        case Domain2DhorizontalEnum: element->GetInputListOnVertices(&B[0],MaterialsRheologyBbarEnum); break;
     566                        case Domain3DEnum:           element->GetInputListOnVertices(&B[0],MaterialsRheologyBEnum); break;
     567                        default: _error_("not Implemented Yet");
     568                }
    573569               
    574570                element->GetInputListOnVertices(&eplhead[0],EplHeadEnum);
     
    587583                else{
    588584                        for(int i=0;i<numnodes;i++){
     585                                A=pow(B[i],-n);
    589586                                /*Compute first the effective pressure in the EPL*/
    590587                                EPL_N=gravity*((rho_ice*ice_thickness[i])-(rho_water*(eplhead[i]-bed[i])));
  • TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.cpp

    r22277 r22308  
    11321132
    11331133        _assert_(this->matpar);
    1134         switch(enum_in){ // FIXME: change this to material and replace NULL by gauss
     1134        switch(enum_in){ // FIXME: change this to material
    11351135                case MaterialsRheologyNEnum:
    11361136                        return this->material->GetN();
    1137                 case MaterialsRheologyBEnum:
    1138                         return this->material->GetB(NULL);
    1139                 case MaterialsRheologyBbarEnum:
    1140                         return this->material->GetBbar(NULL);
    11411137                default:
    11421138                        return this->matpar->GetMaterialParameter(enum_in);
  • TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r22192 r22308  
    192192        IssmDouble  calvingrate[NUMVERTICES];
    193193        IssmDouble  lambda1,lambda2,ex,ey,vx,vy,vel;
    194         IssmDouble  sigma_vm,sigma_max,sigma_max_floating,sigma_max_grounded;
     194        IssmDouble  B,sigma_vm,sigma_max,sigma_max_floating,sigma_max_grounded;
    195195        IssmDouble  epse_2,groundedice,bed;
    196196
     
    208208        Input* gr_input = inputs->GetInput(MaskGroundediceLevelsetEnum); _assert_(gr_input);
    209209        Input* bs_input = inputs->GetInput(BaseEnum);                    _assert_(bs_input);
     210        Input* B_input  = inputs->GetInput(MaterialsRheologyBbarEnum);   _assert_(B_input);
    210211        Input* smax_fl_input = inputs->GetInput(CalvingStressThresholdFloatingiceEnum); _assert_(smax_fl_input);
    211212        Input* smax_gr_input = inputs->GetInput(CalvingStressThresholdGroundediceEnum); _assert_(smax_gr_input);
    212         IssmDouble  B   = this->GetMaterialParameter(MaterialsRheologyBbarEnum);
    213213        IssmDouble  n   = this->GetMaterialParameter(MaterialsRheologyNEnum);
    214214
     
    219219
    220220                /*Get velocity components and thickness*/
     221                B_input->GetInputValue(&B,gauss);
    221222                vx_input->GetInputValue(&vx,gauss);
    222223                vy_input->GetInputValue(&vy,gauss);
  • TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r22266 r22308  
    217217        IssmDouble  lambda1,lambda2,ex,ey,vx,vy,vel;
    218218        IssmDouble  sigma_vm[NUMVERTICES];
    219         IssmDouble  sigma_max,sigma_max_floating,sigma_max_grounded;
     219        IssmDouble  B,sigma_max,sigma_max_floating,sigma_max_grounded;
    220220        IssmDouble  epse_2,groundedice,bed;
    221221
     
    226226        Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input);
    227227        Input* vy_input = inputs->GetInput(VyEnum); _assert_(vy_input);
     228        Input* B_input  = inputs->GetInput(MaterialsRheologyBbarEnum);   _assert_(B_input);
    228229        Input* gr_input = inputs->GetInput(MaskGroundediceLevelsetEnum); _assert_(gr_input);
    229230        Input* bs_input = inputs->GetInput(BaseEnum);                    _assert_(bs_input);
    230231        Input* smax_fl_input = inputs->GetInput(CalvingStressThresholdFloatingiceEnum); _assert_(smax_fl_input);
    231232        Input* smax_gr_input = inputs->GetInput(CalvingStressThresholdGroundediceEnum); _assert_(smax_gr_input);
    232         IssmDouble  B   = this->GetMaterialParameter(MaterialsRheologyBbarEnum);
    233233        IssmDouble  n   = this->GetMaterialParameter(MaterialsRheologyNEnum);
    234234
     
    239239
    240240                /*Get velocity components and thickness*/
     241                B_input->GetInputValue(&B,gauss);
    241242                vx_input->GetInputValue(&vx,gauss);
    242243                vy_input->GetInputValue(&vy,gauss);
     
    301302        IssmDouble  calvingrate[NUMVERTICES];
    302303        IssmDouble  vx,vy,vel;
    303         IssmDouble  critical_fraction,water_height;
     304        IssmDouble  rheology_B,critical_fraction,water_height;
    304305        IssmDouble  bathymetry,Ho,thickness,float_depth,groundedice;
    305306        IssmDouble  surface_crevasse[NUMVERTICES], basal_crevasse[NUMVERTICES], crevasse_depth[NUMVERTICES], H_surf, H_surfbasal;
     
    318319        IssmDouble rho_freshwater = this->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
    319320        IssmDouble constant_g     = this->GetMaterialParameter(ConstantsGEnum);
    320         IssmDouble rheology_B     = this->GetMaterialParameter(MaterialsRheologyBbarEnum);
    321321        IssmDouble rheology_n     = this->GetMaterialParameter(MaterialsRheologyNEnum);
    322        
     322
     323        Input*   B_input       = inputs->GetInput(MaterialsRheologyBbarEnum);   _assert_(B_input);
    323324        Input*   H_input       = inputs->GetInput(ThicknessEnum); _assert_(H_input);
    324325        Input*   bed           = inputs->GetInput(BedEnum); _assert_(bed);
     
    336337                gauss->GaussVertex(iv);
    337338       
     339                B_input->GetInputValue(&rheology_B,gauss);
    338340                H_input->GetInputValue(&thickness,gauss);
    339341                bed->GetInputValue(&bathymetry,gauss);
Note: See TracChangeset for help on using the changeset viewer.