Changeset 20871
- Timestamp:
- 07/08/16 12:12:08 (9 years ago)
- Location:
- issm/trunk-jpl/src/c/classes
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.h ¶
r20810 r20871 298 298 #ifdef _HAVE_SEALEVELRISE_ 299 299 virtual IssmDouble GetArea3D(void)=0; 300 virtual IssmDouble GetAreaSpherical(void)=0; 300 301 virtual IssmDouble OceanAverage(IssmDouble* Sg)=0; 301 302 virtual IssmDouble OceanArea(void)=0; -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.h ¶
r20810 r20871 64 64 void FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating); 65 65 IssmDouble GetArea3D(void){_error_("not implemented yet!");}; 66 IssmDouble GetAreaSpherical(void){_error_("not implemented yet!");}; 66 67 void GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints); 67 68 Element* GetBasalElement(void); -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Seg.h ¶
r20810 r20871 163 163 void ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){_error_("not implemented");}; 164 164 IssmDouble GetArea3D(void){_error_("not implemented yet!");}; 165 IssmDouble GetAreaSpherical(void){_error_("not implemented yet!");}; 165 166 166 167 #ifdef _HAVE_GIA_ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tetra.h ¶
r20810 r20871 63 63 void FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");}; 64 64 IssmDouble GetArea3D(void){_error_("not implemented yet!");}; 65 IssmDouble GetAreaSpherical(void){_error_("not implemented yet!");}; 65 66 Element* GetBasalElement(void){_error_("not implemented yet");}; 66 67 int GetElementType(void); -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.cpp ¶
r20810 r20871 912 912 return area_fraction*this->GetArea(); 913 913 }/*}}}*/ 914 IssmDouble Tria::GetAreaSpherical(void){/*{{{*/ 915 916 bool spherical=true; 917 IssmDouble llr_list[NUMVERTICES][3]; 918 IssmDouble x1,y1,z1,x2,y2,z2,x3,y3,z3; 919 IssmDouble arc12,arc23,arc31,semi_peri,excess; 920 921 /*retrieve coordinates: lat,long,radius */ 922 ::GetVerticesCoordinates(&llr_list[0][0],vertices,NUMVERTICES,spherical); 923 x1=llr_list[0][0]/180*PI; y1=llr_list[0][1]/180*PI; z1=llr_list[0][2]; 924 x2=llr_list[1][0]/180*PI; y2=llr_list[1][1]/180*PI; z2=llr_list[1][2]; 925 x3=llr_list[2][0]/180*PI; y3=llr_list[2][1]/180*PI; z3=llr_list[2][2]; 926 927 /*compute great circle distance between vertices */ 928 arc12=2.*asin(sqrt(pow(sin((x2-x1)/2),2.0)+cos(x1)*cos(x2)*pow(sin((y2-y1)/2),2))); 929 arc23=2.*asin(sqrt(pow(sin((x3-x2)/2),2.0)+cos(x2)*cos(x3)*pow(sin((y3-y2)/2),2))); 930 arc31=2.*asin(sqrt(pow(sin((x1-x3)/2),2.0)+cos(x3)*cos(x1)*pow(sin((y1-y3)/2),2))); 931 932 /*semi parameter */ 933 semi_peri=(arc12+arc23+arc31)/2; 934 935 /*spherical excess */ 936 excess=4.*atan(sqrt(tan(semi_peri/2)*tan((semi_peri-arc12)/2)*tan((semi_peri-arc23)/2)*tan((semi_peri-arc31)/2))); 937 938 /*area = excess*radius^2 */ 939 return excess*pow((z1+z2+z3)/3,2); 940 } 941 /*}}}*/ 914 942 void Tria::GetAreaCoordinates(IssmDouble* area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints){/*{{{*/ 915 943 /*Computeportion of the element that is grounded*/ … … 3543 3571 IssmDouble Tria::OceanArea(void){ /*{{{*/ 3544 3572 3545 if(IsWaterInElement()) return GetArea 3D();3573 if(IsWaterInElement()) return GetAreaSpherical(); 3546 3574 else return 0; 3547 3575 … … 3555 3583 3556 3584 /*Compute area of element:*/ 3557 area=GetArea 3D();3585 area=GetAreaSpherical(); 3558 3586 3559 3587 /*Average Sg over vertices:*/ … … 3658 3686 3659 3687 /*Compute area of element:*/ 3660 area=GetArea 3D();3688 area=GetAreaSpherical(); 3661 3689 3662 3690 /*Compute ice thickness change: */ … … 3761 3789 3762 3790 /*Compute area of element:*/ 3763 area=GetArea 3D();3791 area=GetAreaSpherical(); 3764 3792 3765 3793 /* Where is the centroid of this element?:{{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.h ¶
r20810 r20871 157 157 IssmDouble GetArea3D(void); 158 158 IssmDouble GetAreaIce(void); 159 IssmDouble GetAreaSpherical(void); 159 160 void GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints); 160 161 int GetElementType(void); -
TabularUnified issm/trunk-jpl/src/c/classes/FemModel.cpp ¶
r20810 r20871 2322 2322 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 2323 2323 oceanarea_cpu += element->OceanArea(); 2324 eartharea_cpu+= element->GetArea 3D();2324 eartharea_cpu+= element->GetAreaSpherical(); 2325 2325 } 2326 2326 ISSM_MPI_Reduce (&oceanarea_cpu,&oceanarea,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() ); … … 2382 2382 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 2383 2383 oceanarea_cpu += element->OceanArea(); 2384 eartharea_cpu+= element->GetArea 3D();2384 eartharea_cpu+= element->GetAreaSpherical(); 2385 2385 } 2386 2386 ISSM_MPI_Reduce (&oceanarea_cpu,&oceanarea,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
Note:
See TracChangeset
for help on using the changeset viewer.