Changeset 10321


Ignore:
Timestamp:
10/26/11 11:22:28 (13 years ago)
Author:
seroussi
Message:

minor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r10320 r10321  
    285285        double  bed_hydro;
    286286        double  rho_water,rho_ice,density;
    287         double  h[3],s[3],b[3],ba[3];
     287        double  h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES];
    288288
    289289        /*vertices and material parameters: */
     
    297297
    298298        /*go through vertices, and update inputs, considering them to be TriaVertex type: */
    299         for(i=0;i<3;i++){
     299        for(i=0;i<NUMVERTICES;i++){
     300                /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
    300301                if (nodes[i]->IsFloating()){
    301                         /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
    302302                        if(b[i]<=ba[i]){
    303303                                b[i]=ba[i];
     
    305305                        }
    306306                }
     307                /*Ice sheet: if hydrostatic bed above bathymetry, the ice sheet start to unground, elso do nothing */
    307308                else{
    308                         /*Ice sheet: if hydrostatic bed above bathymetry, the ice sheet start to unground, elso do nothing */
    309309                        bed_hydro=-density*h[i];
    310310                        if (bed_hydro>ba[i]){
     
    315315        }
    316316
    317         /*Surface and bed are updated. Update inputs:*/
     317        /*Update inputs*/
    318318        this->inputs->AddInput(new TriaVertexInput(SurfaceEnum,&s[0]));
    319319        this->inputs->AddInput(new TriaVertexInput(BedEnum,&b[0]));
     
    22412241        GetInputListOnVertices(&b[0],BedEnum);
    22422242        GetInputListOnVertices(&ba[0],BathymetryEnum);
    2243 
    2244         /*material parameters: */
    22452243        rho_water=matpar->GetRhoWater();
    22462244        rho_ice=matpar->GetRhoIce();
     
    22492247        /*go through vertices, and update inputs, considering them to be TriaVertex type: */
    22502248        for(i=0;i<NUMVERTICES;i++){
     2249                /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
    22512250                if (nodes[i]->IsFloating()){
    2252                         /*This node is on the shelf. See if its bed is going under the bathymetry: */
    2253                         if(b[i]<=ba[i]){ //<= because Neff being 0 when b=ba, drag will be 0 anyway.
    2254                                 /*The ice shelf is getting grounded, the thickness is the same, so just update the bed to stick to the bathymetry and elevate the surface accordingly: */
     2251                        if(b[i]<=ba[i]){
    22552252                                b[i]=ba[i];
    22562253                                s[i]=b[i]+h[i];
    22572254                        }
    2258                         else{
    2259                                 /*do nothing, we are still floating.*/
    2260                         }
    22612255                }
     2256                /*Ice sheet: if hydrostatic bed above bathymetry, the ice sheet starts to unground if it is connected to the ice shelf, elso do nothing */
    22622257                else{
    2263                         /*This node is on the sheet, near the grounding line. See if wants to unground. To
    2264                          * do so, we compute the hydrostatic bed, and if it is > bathymetry, then we unground: */
    22652258                        bed_hydro=-density*h[i];
    22662259                        if (bed_hydro>ba[i]){
    2267 
    2268                                 /*Now, are we connected to the grounding line, if so, go forward, otherwise, bail out: */
     2260                                /*Unground only if the element is connected to the ice shelf*/
    22692261                                if(sheet_ungrounding[nodes[i]->Sid()]){
    2270                                         /*We are now floating, bed and surface are determined from hydrostatic equilibrium: */
    22712262                                        s[i]=(1-density)*h[i];
    22722263                                        b[i]=-density*h[i];
    22732264                                }
    22742265                        }
    2275                         else{
    2276                                 /*do nothing, we are still grounded.*/
    2277                         }
    22782266                }
    22792267        }
    22802268
    2281         /*Surface and bed are updated. Update inputs:*/   
     2269        /*Update inputs*/   
    22822270        this->inputs->AddInput(new TriaVertexInput(SurfaceEnum,&s[0]));
    22832271        this->inputs->AddInput(new TriaVertexInput(BedEnum,&b[0]));
Note: See TracChangeset for help on using the changeset viewer.