Changeset 15522
- Timestamp:
- 07/19/13 10:12:23 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15518 r15522 700 700 IssmDouble xyz_bis[3][3]; 701 701 702 GetJacobianDeterminant(&area_init, &xyz_list[0][0],NULL);702 area_init=GetArea(); 703 703 704 704 /*Initialize xyz_list with original xyz_list of triangle coordinates*/ 705 705 for(j=0;j<3;j++){ 706 for(k=0;k<3; j++){706 for(k=0;k<3;k++){ 707 707 xyz_bis[j][k]=xyz_list[j][k]; 708 708 } … … 710 710 for(i=0;i<numpoints;i++){ 711 711 for(j=0;j<3;j++){ 712 for(k=0;k<3; j++){712 for(k=0;k<3;k++){ 713 713 /*Change appropriate line*/ 714 714 xyz_bis[j][k]=xyz_zero[i][k]; … … 716 716 717 717 /*Compute area fraction*/ 718 GetJacobianDeterminant(&area_portion, &xyz_bis[0][0],NULL);718 area_portion=fabs(xyz_bis[1][0]*xyz_bis[2][1] - xyz_bis[1][1]*xyz_bis[2][0] + xyz_bis[0][0]*xyz_bis[1][1] - xyz_bis[0][1]*xyz_bis[1][0] + xyz_bis[2][0]*xyz_bis[0][1] - xyz_bis[2][1]*xyz_bis[0][0])/2.; 719 719 *(area_coordinates+3*i+j)=area_portion/area_init; 720 720 721 721 /*Reinitialize xyz_list*/ 722 for(k=0;k<3; j++){722 for(k=0;k<3;k++){ 723 723 /*Reinitialize xyz_list with original coordinates*/ 724 724 xyz_bis[j][k]=xyz_list[j][k]; … … 948 948 s2=levelset[2]/(levelset[2]-levelset[0]); 949 949 950 if(levelset[2]>0) normal_orientation= 0;950 if(levelset[2]>0) normal_orientation=1; 951 951 /*New point 1*/ 952 952 xyz_zero[3*normal_orientation+0]=xyz_list[2][0]+s1*(xyz_list[1][0]-xyz_list[2][0]); … … 964 964 s2=levelset[0]/(levelset[0]-levelset[1]); 965 965 966 if(levelset[0]>0) normal_orientation= 0;966 if(levelset[0]>0) normal_orientation=1; 967 967 /*New point 1*/ 968 968 xyz_zero[3*normal_orientation+0]=xyz_list[0][0]+s1*(xyz_list[2][0]-xyz_list[0][0]); … … 980 980 s2=levelset[1]/(levelset[1]-levelset[2]); 981 981 982 if(levelset[1]>0) normal_orientation= 0;982 if(levelset[1]>0) normal_orientation=1; 983 983 /*New point 0*/ 984 984 xyz_zero[3*normal_orientation+0]=xyz_list[1][0]+s1*(xyz_list[0][0]-xyz_list[1][0]); … … 990 990 xyz_zero[3*(1-normal_orientation)+1]=xyz_list[1][1]+s2*(xyz_list[2][1]-xyz_list[1][1]); 991 991 xyz_zero[3*(1-normal_orientation)+2]=xyz_list[1][2]+s2*(xyz_list[2][2]-xyz_list[1][2]); 992 } 993 992 } 993 else if(levelset[0]==0 && levelset[1]==0){ //front is on point 0 and 1 994 xyz_zero[3*0+0]=xyz_list[0][0]; 995 xyz_zero[3*0+1]=xyz_list[0][1]; 996 xyz_zero[3*0+2]=xyz_list[0][2]; 997 998 /*New point 2*/ 999 xyz_zero[3*1+0]=xyz_list[1][0]; 1000 xyz_zero[3*1+1]=xyz_list[1][1]; 1001 xyz_zero[3*1+2]=xyz_list[1][2]; 1002 } 1003 else if(levelset[0]==0 && levelset[2]==0){ //front is on point 0 and 1 1004 xyz_zero[3*0+0]=xyz_list[0][0]; 1005 xyz_zero[3*0+1]=xyz_list[0][1]; 1006 xyz_zero[3*0+2]=xyz_list[0][2]; 1007 1008 /*New point 2*/ 1009 xyz_zero[3*1+0]=xyz_list[2][0]; 1010 xyz_zero[3*1+1]=xyz_list[2][1]; 1011 xyz_zero[3*1+2]=xyz_list[2][2]; 1012 } 1013 else if(levelset[1]==0 && levelset[2]==0){ //front is on point 0 and 1 1014 xyz_zero[3*0+0]=xyz_list[1][0]; 1015 xyz_zero[3*0+1]=xyz_list[1][1]; 1016 xyz_zero[3*0+2]=xyz_list[1][2]; 1017 1018 /*New point 2*/ 1019 xyz_zero[3*1+0]=xyz_list[2][0]; 1020 xyz_zero[3*1+1]=xyz_list[2][1]; 1021 xyz_zero[3*1+2]=xyz_list[2][2]; 1022 } 1023 else _error_("Case not covered"); 994 1024 } 995 1025 /*}}}*/ … … 3124 3154 bool isfront; 3125 3155 3126 return NULL;3127 3128 3156 /*Retrieve all inputs and parameters*/ 3129 3157 GetInputListOnVertices(&ls[0],IcelevelsetEnum); … … 3137 3165 } 3138 3166 3167 return NULL; 3139 3168 /*If no front, return NULL*/ 3140 3169 if(!isfront) return NULL; … … 3196 3225 delete gauss; 3197 3226 return pe; 3198 3199 3227 } 3200 3228 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.