Changeset 16145
- Timestamp:
- 09/17/13 12:28:19 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r16144 r16145 1699 1699 /*Computeportion of the element that is grounded*/ 1700 1700 1701 int normal_orientation ;1701 int normal_orientation=0; 1702 1702 IssmDouble s1,s2; 1703 1703 IssmDouble levelset[NUMVERTICES]; … … 1706 1706 GetInputListOnVertices(&levelset[0],levelsetenum); 1707 1707 1708 if(levelset[0]*levelset[1]>0 ){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-21708 if(levelset[0]*levelset[1]>0.){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2 1709 1709 /*Portion of the segments*/ 1710 1710 s1=levelset[2]/(levelset[2]-levelset[1]); 1711 1711 s2=levelset[2]/(levelset[2]-levelset[0]); 1712 1712 1713 if(levelset[2]>0 ) normal_orientation=1;1713 if(levelset[2]>0.) normal_orientation=1; 1714 1714 /*New point 1*/ 1715 1715 xyz_zero[3*normal_orientation+0]=xyz_list[2][0]+s1*(xyz_list[1][0]-xyz_list[2][0]); … … 1732 1732 xyz_zero[3*(2+normal_orientation)+2]=xyz_list[5][2]+s2*(xyz_list[3][2]-xyz_list[5][2]); 1733 1733 } 1734 else if(levelset[1]*levelset[2]>0 ){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-21734 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 1735 1735 /*Portion of the segments*/ 1736 1736 s1=levelset[0]/(levelset[0]-levelset[2]); 1737 1737 s2=levelset[0]/(levelset[0]-levelset[1]); 1738 1738 1739 if(levelset[0]>0 ) normal_orientation=1;1739 if(levelset[0]>0.) normal_orientation=1; 1740 1740 /*New point 1*/ 1741 1741 xyz_zero[3*normal_orientation+0]=xyz_list[0][0]+s1*(xyz_list[2][0]-xyz_list[0][0]); … … 1758 1758 xyz_zero[3*(2+normal_orientation)+2]=xyz_list[3][2]+s2*(xyz_list[4][2]-xyz_list[3][2]); 1759 1759 } 1760 else if(levelset[0]*levelset[2]>0 ){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-21760 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 1761 1761 /*Portion of the segments*/ 1762 1762 s1=levelset[1]/(levelset[1]-levelset[0]); 1763 1763 s2=levelset[1]/(levelset[1]-levelset[2]); 1764 1764 1765 if(levelset[1]>0 ) normal_orientation=1;1765 if(levelset[1]>0.) normal_orientation=1; 1766 1766 /*New point 0*/ 1767 1767 xyz_zero[3*normal_orientation+0]=xyz_list[1][0]+s1*(xyz_list[0][0]-xyz_list[1][0]); … … 1784 1784 xyz_zero[3*(2+normal_orientation)+2]=xyz_list[4][2]+s2*(xyz_list[5][2]-xyz_list[4][2]); 1785 1785 } 1786 else if(levelset[0]==0 && levelset[1]==0){ //front is on point 0 and 11786 else if(levelset[0]==0. && levelset[1]==0.){ //front is on point 0 and 1 1787 1787 xyz_zero[3*0+0]=xyz_list[0][0]; 1788 1788 xyz_zero[3*0+1]=xyz_list[0][1]; … … 1804 1804 xyz_zero[3*3+2]=xyz_list[3][2]; 1805 1805 } 1806 else if(levelset[0]==0 && levelset[2]==0){ //front is on point 0 and 11806 else if(levelset[0]==0. && levelset[2]==0.){ //front is on point 0 and 1 1807 1807 xyz_zero[3*0+0]=xyz_list[2][0]; 1808 1808 xyz_zero[3*0+1]=xyz_list[2][1]; … … 1824 1824 xyz_zero[3*3+2]=xyz_list[5][2]; 1825 1825 } 1826 else if(levelset[1]==0 && levelset[2]==0){ //front is on point 0 and 11826 else if(levelset[1]==0. && levelset[2]==0.){ //front is on point 0 and 1 1827 1827 xyz_zero[3*0+0]=xyz_list[1][0]; 1828 1828 xyz_zero[3*0+1]=xyz_list[1][1]; -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r16144 r16145 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.