Changeset 16147
- Timestamp:
- 09/17/13 13:18:10 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r16146 r16147 1006 1006 /*Computeportion of the element that is grounded*/ 1007 1007 1008 int normal_orientation ;1008 int normal_orientation=0; 1009 1009 IssmDouble s1,s2; 1010 1010 IssmDouble levelset[NUMVERTICES]; … … 1013 1013 GetInputListOnVertices(&levelset[0],levelsetenum); 1014 1014 1015 if(levelset[0]*levelset[1]>0 ){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-21015 if(levelset[0]*levelset[1]>0.){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2 1016 1016 /*Portion of the segments*/ 1017 1017 s1=levelset[2]/(levelset[2]-levelset[1]); 1018 1018 s2=levelset[2]/(levelset[2]-levelset[0]); 1019 1019 1020 if(levelset[2]>0 ) normal_orientation=1;1020 if(levelset[2]>0.) normal_orientation=1; 1021 1021 /*New point 1*/ 1022 1022 xyz_zero[3*normal_orientation+0]=xyz_list[2][0]+s1*(xyz_list[1][0]-xyz_list[2][0]); … … 1029 1029 xyz_zero[3*(1-normal_orientation)+2]=xyz_list[2][2]+s2*(xyz_list[0][2]-xyz_list[2][2]); 1030 1030 } 1031 else if(levelset[1]*levelset[2]>0 ){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-21031 else if(levelset[1]*levelset[2]>0.){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2 1032 1032 /*Portion of the segments*/ 1033 1033 s1=levelset[0]/(levelset[0]-levelset[2]); 1034 1034 s2=levelset[0]/(levelset[0]-levelset[1]); 1035 1035 1036 if(levelset[0]>0 ) normal_orientation=1;1036 if(levelset[0]>0.) normal_orientation=1; 1037 1037 /*New point 1*/ 1038 1038 xyz_zero[3*normal_orientation+0]=xyz_list[0][0]+s1*(xyz_list[2][0]-xyz_list[0][0]); … … 1045 1045 xyz_zero[3*(1-normal_orientation)+2]=xyz_list[0][2]+s2*(xyz_list[1][2]-xyz_list[0][2]); 1046 1046 } 1047 else if(levelset[0]*levelset[2]>0 ){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-21047 else if(levelset[0]*levelset[2]>0.){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2 1048 1048 /*Portion of the segments*/ 1049 1049 s1=levelset[1]/(levelset[1]-levelset[0]); 1050 1050 s2=levelset[1]/(levelset[1]-levelset[2]); 1051 1051 1052 if(levelset[1]>0 ) normal_orientation=1;1052 if(levelset[1]>0.) normal_orientation=1; 1053 1053 /*New point 0*/ 1054 1054 xyz_zero[3*normal_orientation+0]=xyz_list[1][0]+s1*(xyz_list[0][0]-xyz_list[1][0]); … … 1061 1061 xyz_zero[3*(1-normal_orientation)+2]=xyz_list[1][2]+s2*(xyz_list[2][2]-xyz_list[1][2]); 1062 1062 } 1063 else if(levelset[0]==0 && levelset[1]==0){ //front is on point 0 and 11063 else if(levelset[0]==0. && levelset[1]==0.){ //front is on point 0 and 1 1064 1064 xyz_zero[3*0+0]=xyz_list[0][0]; 1065 1065 xyz_zero[3*0+1]=xyz_list[0][1]; … … 1071 1071 xyz_zero[3*1+2]=xyz_list[1][2]; 1072 1072 } 1073 else if(levelset[0]==0 && levelset[2]==0){ //front is on point 0 and 11073 else if(levelset[0]==0. && levelset[2]==0.){ //front is on point 0 and 1 1074 1074 xyz_zero[3*0+0]=xyz_list[2][0]; 1075 1075 xyz_zero[3*0+1]=xyz_list[2][1]; … … 1081 1081 xyz_zero[3*1+2]=xyz_list[0][2]; 1082 1082 } 1083 else if(levelset[1]==0 && levelset[2]==0){ //front is on point 0 and 11083 else if(levelset[1]==0. && levelset[2]==0.){ //front is on point 0 and 1 1084 1084 xyz_zero[3*0+0]=xyz_list[1][0]; 1085 1085 xyz_zero[3*0+1]=xyz_list[1][1];
Note:
See TracChangeset
for help on using the changeset viewer.