Changeset 16023
- Timestamp:
- 08/29/13 16:10:29 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r16021 r16023 1081 1081 /*Assign output pointers:*/ 1082 1082 *pdoflist=doflist; 1083 } 1084 /*}}}*/ 1085 /*FUNCTION Penta::GetGroundedPart{{{*/ 1086 void Penta::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating){ 1087 /*Computeportion of the element that is grounded*/ 1088 1089 bool floating=true; 1090 int point; 1091 const IssmPDouble epsilon= 1.e-15; 1092 IssmDouble gl[NUMVERTICES]; 1093 IssmDouble f1,f2; 1094 1095 /*Recover parameters and values*/ 1096 GetInputListOnVertices(&gl[0],MaskGroundediceLevelsetEnum); 1097 1098 /*Be sure that values are not zero*/ 1099 if(gl[0]==0.) gl[0]=gl[0]+epsilon; 1100 if(gl[1]==0.) gl[1]=gl[1]+epsilon; 1101 if(gl[2]==0.) gl[2]=gl[2]+epsilon; 1102 1103 /*Check that not all nodes are grounded or floating*/ 1104 if(gl[0]>0 && gl[1]>0 && gl[2]>0){ // All grounded 1105 point=0; 1106 f1=1.; 1107 f2=1.; 1108 } 1109 else if(gl[0]<0 && gl[1]<0 && gl[2]<0){ //All floating 1110 point=0; 1111 f1=0.; 1112 f2=0.; 1113 } 1114 else{ 1115 if(gl[0]*gl[1]*gl[2]<0) floating=false; 1116 1117 if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2 1118 point=2; 1119 f1=gl[2]/(gl[2]-gl[0]); 1120 f2=gl[2]/(gl[2]-gl[1]); 1121 } 1122 else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2 1123 point=0; 1124 f1=gl[0]/(gl[0]-gl[1]); 1125 f2=gl[0]/(gl[0]-gl[2]); 1126 } 1127 else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2 1128 point=1; 1129 f1=gl[1]/(gl[1]-gl[2]); 1130 f2=gl[1]/(gl[1]-gl[0]); 1131 } 1132 } 1133 *point1=point; 1134 *fraction1=f1; 1135 *fraction2=f2; 1136 *mainlyfloating=floating; 1083 1137 } 1084 1138 /*}}}*/ … … 8019 8073 8020 8074 /*Intermediaries */ 8075 bool mainlyfloating; 8021 8076 int i,j; 8022 8077 int analysis_type,migration_style; … … 8062 8117 if(migration_style==SubelementMigration2Enum){ 8063 8118 gllevelset_input=inputs->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input); 8064 //this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);8119 this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating); 8065 8120 //gauss=new GaussPenta(point1,fraction1,fraction2,mainlyfloating,2); 8066 8121 gauss=new GaussPenta(0,1,2,2); -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r15982 r16023 195 195 void GetVertexSidList(int* sidlist); 196 196 void GetConnectivityList(int* connectivity); 197 void GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating); 197 198 IssmDouble GetGroundedPortion(IssmDouble* xyz_list); 198 199 int GetElementType(void); -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r16010 r16023 212 212 void GetVertexSidList(int* sidlist); 213 213 void GetConnectivityList(int* connectivity); 214 void GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating); 214 215 IssmDouble GetGroundedPortion(IssmDouble* xyz_list); 215 void GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);216 216 void GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[2][3]); 217 217 void GetZeroLevelsetCoordinates(IssmDouble* xyz_zero,IssmDouble xyz_list[3][3],int levelsetenum);
Note:
See TracChangeset
for help on using the changeset viewer.