source:
issm/oecreview/Archive/15392-16133/ISSM-15813-15814.diff@
16134
Last change on this file since 16134 was 16134, checked in by , 12 years ago | |
---|---|
File size: 5.7 KB |
-
TabularUnified ../trunk-jpl/src/c/classes/Elements/Tria.cpp
817 817 bool floating=true; 818 818 int point; 819 819 const IssmPDouble epsilon= 1.e-15; 820 IssmDouble gl[ 3];820 IssmDouble gl[NUMVERTICES]; 821 821 IssmDouble f1,f2; 822 822 823 823 /*Recover parameters and values*/ 824 824 GetInputListOnVertices(&gl[0],GLlevelsetEnum); 825 825 826 826 /*Be sure that values are not zero*/ 827 if(gl[0]==0 ) gl[0]=gl[0]+epsilon;828 if(gl[1]==0 ) gl[1]=gl[1]+epsilon;829 if(gl[2]==0 ) gl[2]=gl[2]+epsilon;827 if(gl[0]==0.) gl[0]=gl[0]+epsilon; 828 if(gl[1]==0.) gl[1]=gl[1]+epsilon; 829 if(gl[2]==0.) gl[2]=gl[2]+epsilon; 830 830 831 831 /*Check that not all nodes are grounded or floating*/ 832 832 if(gl[0]>0 && gl[1]>0 && gl[2]>0){ // All grounded … … 868 868 IssmDouble Tria::GetGroundedPortion(IssmDouble* xyz_list){ 869 869 /*Computeportion of the element that is grounded*/ 870 870 871 bool 872 const IssmPDouble epsilon= 1.e-15;871 bool mainlyfloating = true; 872 const IssmPDouble epsilon = 1.e-15; 873 873 IssmDouble phi,s1,s2,area_init,area_grounded; 874 IssmDouble gl[ 3];874 IssmDouble gl[NUMVERTICES]; 875 875 IssmDouble xyz_bis[3][3]; 876 876 877 877 /*Recover parameters and values*/ 878 878 GetInputListOnVertices(&gl[0],GLlevelsetEnum); 879 879 880 880 /*Be sure that values are not zero*/ 881 if(gl[0]==0 ) gl[0]=gl[0]+epsilon;882 if(gl[1]==0 ) gl[1]=gl[1]+epsilon;883 if(gl[2]==0 ) gl[2]=gl[2]+epsilon;881 if(gl[0]==0.) gl[0]=gl[0]+epsilon; 882 if(gl[1]==0.) gl[1]=gl[1]+epsilon; 883 if(gl[2]==0.) gl[2]=gl[2]+epsilon; 884 884 885 885 /*Check that not all nodes are grounded or floating*/ 886 886 if(gl[0]>0 && gl[1]>0 && gl[2]>0){ // All grounded -
TabularUnified ../trunk-jpl/src/c/classes/Elements/Penta.cpp
1023 1023 bool mainlyfloating = true; 1024 1024 const IssmPDouble epsilon= 1.e-15; 1025 1025 IssmDouble phi,s1,s2,area_init,area_grounded; 1026 IssmDouble gl[ 3];1027 IssmDouble xyz_bis[ 3][3];1026 IssmDouble gl[NUMVERTICES]; 1027 IssmDouble xyz_bis[NUMVERTICES2D][3]; 1028 1028 1029 1029 /*Recover parameters and values*/ 1030 1030 GetInputListOnVertices(&gl[0],GLlevelsetEnum); 1031 1031 1032 1032 /*Be sure that values are not zero*/ 1033 if(gl[0]==0 ) gl[0]=gl[0]+epsilon;1034 if(gl[1]==0 ) gl[1]=gl[1]+epsilon;1035 if(gl[2]==0 ) gl[2]=gl[2]+epsilon;1033 if(gl[0]==0.) gl[0]=gl[0]+epsilon; 1034 if(gl[1]==0.) gl[1]=gl[1]+epsilon; 1035 if(gl[2]==0.) gl[2]=gl[2]+epsilon; 1036 1036 1037 1037 /*Check that not all nodes are grounded or floating*/ 1038 1038 if(gl[0]>0 && gl[1]>0 && gl[2]>0){ // All grounded … … 1047 1047 1048 1048 if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2 1049 1049 /*Coordinates of point 2: same as initial point 2*/ 1050 xyz_bis[2][0]= *(xyz_list+3*2+0);1051 xyz_bis[2][1]= *(xyz_list+3*2+1);1052 xyz_bis[2][2]= *(xyz_list+3*2+2);1050 xyz_bis[2][0]=xyz_list[3*2+0]; 1051 xyz_bis[2][1]=xyz_list[3*2+1]; 1052 xyz_bis[2][2]=xyz_list[3*2+2]; 1053 1053 1054 1054 /*Portion of the segments*/ 1055 1055 s1=gl[2]/(gl[2]-gl[1]); 1056 1056 s2=gl[2]/(gl[2]-gl[0]); 1057 1057 1058 1058 /*New point 1*/ 1059 xyz_bis[1][0]= *(xyz_list+3*2+0)+s1*(*(xyz_list+3*1+0)-*(xyz_list+3*2+0));1060 xyz_bis[1][1]= *(xyz_list+3*2+1)+s1*(*(xyz_list+3*1+1)-*(xyz_list+3*2+1));1061 xyz_bis[1][2]= *(xyz_list+3*2+2)+s1*(*(xyz_list+3*1+2)-*(xyz_list+3*2+2));1059 xyz_bis[1][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]); 1060 xyz_bis[1][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]); 1061 xyz_bis[1][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]); 1062 1062 1063 1063 /*New point 0*/ 1064 xyz_bis[0][0]= *(xyz_list+3*2+0)+s2*(*(xyz_list+3*0+0)-*(xyz_list+3*2+0));1065 xyz_bis[0][1]= *(xyz_list+3*2+1)+s2*(*(xyz_list+3*0+1)-*(xyz_list+3*2+1));1066 xyz_bis[0][2]= *(xyz_list+3*2+2)+s2*(*(xyz_list+3*0+2)-*(xyz_list+3*2+2));1064 xyz_bis[0][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]); 1065 xyz_bis[0][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]); 1066 xyz_bis[0][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]); 1067 1067 } 1068 1068 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 1069 1069 /*Coordinates of point 0: same as initial point 2*/ … … 1107 1107 } 1108 1108 1109 1109 /*Compute fraction of grounded element*/ 1110 Get JacobianDeterminant(&area_init, xyz_list,NULL);1111 Get JacobianDeterminant(&area_grounded, &xyz_bis[0][0],NULL);1110 GetTriaJacobianDeterminant(&area_init, xyz_list,NULL); 1111 GetTriaJacobianDeterminant(&area_grounded, &xyz_bis[0][0],NULL); 1112 1112 if(mainlyfloating==true) area_grounded=area_init-area_grounded; 1113 1113 phi=area_grounded/area_init; 1114 1114 } 1115 1115 1116 if(phi>1 || phi<0) _error_("Error. Problem with portion of grounded element: value should be between 0 and 1");1116 if(phi>1. || phi<0.) _error_("Error. Problem with portion of grounded element: value should be between 0 and 1"); 1117 1117 1118 1118 return phi; 1119 1119 } … … 7659 7659 int i,j; 7660 7660 int analysis_type,migration_style; 7661 7661 IssmDouble xyz_list[NUMVERTICES][3]; 7662 IssmDouble xyz_list_tria[NUMVERTICES2D][3] ={0.};7662 IssmDouble xyz_list_tria[NUMVERTICES2D][3]; 7663 7663 IssmDouble alpha2,Jdet; 7664 7664 IssmDouble phi=1.0; 7665 7665 IssmDouble DL_scalar; … … 7692 7692 friction=new Friction("2d",inputs,matpar,analysis_type); 7693 7693 7694 7694 /*Recover portion of element that is grounded*/ 7695 if(migration_style==SubelementMigrationEnum) phi=this->GetGroundedPortion(&xyz_list [0][0]);7695 if(migration_style==SubelementMigrationEnum) phi=this->GetGroundedPortion(&xyz_list_tria[0][0]); 7696 7696 7697 7697 /* Start looping on the number of gaussian points: */ 7698 7698 gauss=new GaussPenta(0,1,2,2);
Note:
See TracBrowser
for help on using the repository browser.