Changeset 16593


Ignore:
Timestamp:
10/31/13 13:26:13 (11 years ago)
Author:
nathanma
Message:

CHG:Adapt IceVolume routine to work for 2D Flowline mesh

File:
1 edited

Legend:

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

    r16592 r16593  
    28822882        if(NoIceInElement())return 0;
    28832883
    2884         GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
    2885 
    2886         /*First calculate the area of the base (cross section triangle)
    2887          * http://en.wikipedia.org/wiki/Triangle
    2888          * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
    2889         base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
     2884        /*First get back the area of the base*/
     2885        base=this->GetArea();
    28902886
    28912887        /*Now get the average height*/
     
    28962892
    28972893        /*Return: */
    2898         return base*(surface-bed);
     2894        int meshtype;
     2895        parameters->FindParam(&meshtype,MeshTypeEnum);
     2896        if(meshtype==Mesh2DverticalEnum){
     2897          return base;
     2898        }
     2899        else{
     2900          return base*(surface-bed);
     2901        }
    28992902}
    29002903/*}}}*/
     
    37743777        /*Retrieve all inputs and parameters*/
    37753778        rho_water = matpar->GetRhoWater();
     3779        rho_ice = matpar->GetRhoIce();
    37763780        gravity   = matpar->GetG();
    37773781        GetZeroLevelsetCoordinates(&xyz_list_front[0][0],xyz_list,MaskIceLevelsetEnum);
Note: See TracChangeset for help on using the changeset viewer.