Changeset 16593
- Timestamp:
- 10/31/13 13:26:13 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r16592 r16593 2882 2882 if(NoIceInElement())return 0; 2883 2883 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(); 2890 2886 2891 2887 /*Now get the average height*/ … … 2896 2892 2897 2893 /*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 } 2899 2902 } 2900 2903 /*}}}*/ … … 3774 3777 /*Retrieve all inputs and parameters*/ 3775 3778 rho_water = matpar->GetRhoWater(); 3779 rho_ice = matpar->GetRhoIce(); 3776 3780 gravity = matpar->GetG(); 3777 3781 GetZeroLevelsetCoordinates(&xyz_list_front[0][0],xyz_list,MaskIceLevelsetEnum);
Note:
See TracChangeset
for help on using the changeset viewer.