Changeset 19764 for issm/trunk-jpl/src
- Timestamp:
- 11/19/15 12:52:40 (9 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.h
r19554 r19764 194 194 virtual void ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0; 195 195 virtual int FiniteElement(void)=0; 196 virtual IssmDouble FloatingArea(void)=0; 196 197 virtual void FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating)=0; 197 198 virtual Element* GetBasalElement(void)=0; -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r19527 r19764 653 653 int Penta::FiniteElement(void){/*{{{*/ 654 654 return this->element_type; 655 } 656 /*}}}*/ 657 IssmDouble Penta::FloatingArea(void){/*{{{*/ 658 659 /*Intermediaries*/ 660 int domaintype; 661 IssmDouble phi,base_area; 662 IssmDouble xyz_list[NUMVERTICES][3]; 663 664 if(!IsIceInElement() || !IsOnBase())return 0.; 665 666 /*Get problem dimension*/ 667 this->FindParam(&domaintype,DomainTypeEnum); 668 if(domaintype!=Domain3DEnum) _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet"); 669 670 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 671 phi=this->GetGroundedPortion(&xyz_list[0][0]); 672 base_area= 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])); 673 674 /*Clean up and return*/ 675 return (1-phi)*base_area; 655 676 } 656 677 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r19518 r19764 62 62 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz); 63 63 int FiniteElement(void); 64 IssmDouble FloatingArea(void); 64 65 void FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating); 65 66 void GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints); -
issm/trunk-jpl/src/c/classes/Elements/Seg.h
r19518 r19764 56 56 void ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");}; 57 57 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");}; 58 int FiniteElement(void); 59 IssmDouble FloatingArea(void){_error_("not implemented yet");}; 58 60 void FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");}; 59 int FiniteElement(void);60 61 Element* GetBasalElement(void){_error_("not implemented yet");}; 61 62 int GetElementType(void){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Elements/Tetra.h
r19518 r19764 61 61 void FaceOnSurfaceIndices(int* pindex1,int* pindex2,int* pindex3); 62 62 int FiniteElement(void); 63 IssmDouble FloatingArea(void){_error_("not implemented yet");}; 63 64 void FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");}; 64 65 Element* GetBasalElement(void){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r19527 r19764 909 909 int Tria::FiniteElement(void){/*{{{*/ 910 910 return this->element_type; 911 } 912 /*}}}*/ 913 IssmDouble Tria::FloatingArea(void){/*{{{*/ 914 915 /*Intermediaries*/ 916 int domaintype; 917 IssmDouble phi; 918 IssmDouble *xyz_list = NULL; 919 920 if(!IsIceInElement())return 0.; 921 922 /*Get problem dimension*/ 923 this->FindParam(&domaintype,DomainTypeEnum); 924 if(domaintype!=Domain2DhorizontalEnum && domaintype!=Domain3DEnum) _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet"); 925 926 this->GetVerticesCoordinates(&xyz_list); 927 phi=this->GetGroundedPortion(xyz_list); 928 929 /*Clean up and return*/ 930 xDelete<IssmDouble>(xyz_list); 931 return (1-phi)*this->GetArea(); 911 932 } 912 933 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r19518 r19764 73 73 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz); 74 74 int FiniteElement(void); 75 IssmDouble FloatingArea(void); 75 76 void FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating); 76 77 Element* GetBasalElement(void){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r19720 r19764 1009 1009 case IceVolumeAboveFloatationEnum: this->IceVolumeAboveFloatationx(&double_result); break; 1010 1010 case GroundedAreaEnum: this->GroundedAreax(&double_result); break; 1011 case FloatingAreaEnum: this->FloatingAreax(&double_result); break; 1011 1012 case MinVelEnum: this->MinVelx(&double_result); break; 1012 1013 case MaxVelEnum: this->MaxVelx(&double_result); break; … … 1615 1616 1616 1617 }/*}}}*/ 1618 void FemModel::FloatingAreax(IssmDouble* pV){/*{{{*/ 1619 1620 IssmDouble local_floating_area= 0; 1621 IssmDouble total_floating_area; 1622 1623 for(int i=0;i<this->elements->Size();i++){ 1624 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i)); 1625 local_floating_area+=element->FloatingArea(); 1626 } 1627 ISSM_MPI_Reduce(&local_floating_area,&total_floating_area,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() ); 1628 ISSM_MPI_Bcast(&total_floating_area,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 1629 1630 /*Assign output pointers: */ 1631 *pV=total_floating_area; 1632 1633 }/*}}}*/ 1617 1634 void FemModel::GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,IssmDouble* ug){/*{{{*/ 1618 1635 -
issm/trunk-jpl/src/c/classes/FemModel.h
r19518 r19764 82 82 void Divergencex(IssmDouble* pdiv); 83 83 void MaxDivergencex(IssmDouble* pdiv); 84 void FloatingAreax(IssmDouble* pV); 84 85 void GroundedAreax(IssmDouble* pV); 85 86 void IceMassx(IssmDouble* pV); -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r19749 r19764 902 902 MaxVzEnum, 903 903 MaxAbsVzEnum, 904 FloatingAreaEnum, 904 905 GroundedAreaEnum, 905 906 IceMassEnum, -
issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
r19749 r19764 880 880 case MaxVzEnum : return "MaxVz"; 881 881 case MaxAbsVzEnum : return "MaxAbsVz"; 882 case FloatingAreaEnum : return "FloatingArea"; 882 883 case GroundedAreaEnum : return "GroundedArea"; 883 884 case IceMassEnum : return "IceMass"; -
issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
r19749 r19764 901 901 else if (strcmp(name,"MaxVz")==0) return MaxVzEnum; 902 902 else if (strcmp(name,"MaxAbsVz")==0) return MaxAbsVzEnum; 903 else if (strcmp(name,"FloatingArea")==0) return FloatingAreaEnum; 903 904 else if (strcmp(name,"GroundedArea")==0) return GroundedAreaEnum; 904 905 else if (strcmp(name,"IceMass")==0) return IceMassEnum; -
issm/trunk-jpl/src/m/enum/EnumDefinitions.py
r19749 r19764 872 872 def MaxVzEnum(): return StringToEnum("MaxVz")[0] 873 873 def MaxAbsVzEnum(): return StringToEnum("MaxAbsVz")[0] 874 def FloatingAreaEnum(): return StringToEnum("FloatingArea")[0] 874 875 def GroundedAreaEnum(): return StringToEnum("GroundedArea")[0] 875 876 def IceMassEnum(): return StringToEnum("IceMass")[0]
Note:
See TracChangeset
for help on using the changeset viewer.