Changeset 442
- Timestamp:
- 05/15/09 11:25:19 (16 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Icefront.cpp
r416 r442 686 686 QuadPressureLoadStokes(pe_g,matpar->GetRhoWater(),matpar->GetRhoIce(),matpar->GetG(),thickness_list_quad,bed_list_quad,normal1,normal2,normal3,normal4,&xyz_list_quad[0][0],fill); 687 687 688 689 688 #ifdef _DEBUGELEMENTS_ 690 689 if(my_rank==RANK && eid==ELID){ … … 702 701 printf("fill %i\n",fill); 703 702 printf("pe_g->terms\n"); 704 for(i=0;i<num gridsload*NDOF4;i++){703 for(i=0;i<numdofloads*NDOF4;i++){ 705 704 printf("%g ",*(pe_g->terms+i)); 706 705 } … … 1180 1179 double J[4]; 1181 1180 double z_g[4]; 1182 double ice_pressure_tria[4];1183 1181 double air_pressure_tria; 1184 1182 double water_level_above_g_tria; 1185 1183 double water_pressure_tria; 1186 double pressure_tria [4];1184 double pressure_tria; 1187 1185 1188 1186 /*To use tria functionalities: */ … … 1331 1329 //Loop on the grids of the quad 1332 1330 //Calculate the ice pressure 1333 for(j=0;j<4;j++){1334 ice_pressure_tria[j]=gravity*rho_ice*(surface_list[j]-z_g[i]);1335 }1336 1331 air_pressure_tria=0; 1337 1332 … … 1348 1343 } 1349 1344 1350 //Add pressure from triangle i 1351 //Loop on the grids of the quad 1352 for(j=0;j<4;j++){ 1353 pressure_tria[j] = ice_pressure_tria[j] + water_pressure_tria + air_pressure_tria; 1354 } 1355 1356 1357 pe_g[0]+= J[i]*gauss_weight* pressure_tria[0]*l1l4_tria[i][0]*nx[i]; 1358 pe_g[1]+= J[i]*gauss_weight* pressure_tria[0]*l1l4_tria[i][0]*ny[i]; 1359 pe_g[2]+= J[i]*gauss_weight* pressure_tria[0]*l1l4_tria[i][0]*nz[i]; 1345 //Add pressure 1346 pressure_tria = water_pressure_tria + air_pressure_tria; 1347 1348 pe_g[0]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][0]*nx[i]; 1349 pe_g[1]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][0]*ny[i]; 1350 pe_g[2]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][0]*nz[i]; 1360 1351 pe_g[3]+= 0; 1361 pe_g[4]+= J[i]*gauss_weight* pressure_tria [1]*l1l4_tria[i][1]*nx[i];1362 pe_g[5]+= J[i]*gauss_weight* pressure_tria [1]*l1l4_tria[i][1]*ny[i];1363 pe_g[6]+= J[i]*gauss_weight* pressure_tria [1]*l1l4_tria[i][1]*nz[i];1352 pe_g[4]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][1]*nx[i]; 1353 pe_g[5]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][1]*ny[i]; 1354 pe_g[6]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][1]*nz[i]; 1364 1355 pe_g[7]+= 0; 1365 pe_g[8]+= J[i]*gauss_weight* pressure_tria [2]*l1l4_tria[i][2]*nx[i];1366 pe_g[9]+= J[i]*gauss_weight* pressure_tria [2]*l1l4_tria[i][2]*ny[i];1367 pe_g[10]+= J[i]*gauss_weight* pressure_tria [2]*l1l4_tria[i][2]*nz[i];1356 pe_g[8]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][2]*nx[i]; 1357 pe_g[9]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][2]*ny[i]; 1358 pe_g[10]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][2]*nz[i]; 1368 1359 pe_g[11]+= 0; 1369 pe_g[12]+= J[i]*gauss_weight* pressure_tria [3]*l1l4_tria[i][3]*nx[i];1370 pe_g[13]+= J[i]*gauss_weight* pressure_tria [3]*l1l4_tria[i][3]*ny[i];1371 pe_g[14]+= J[i]*gauss_weight* pressure_tria [3]*l1l4_tria[i][3]*nz[i];1360 pe_g[12]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][3]*nx[i]; 1361 pe_g[13]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][3]*ny[i]; 1362 pe_g[14]+= J[i]*gauss_weight* pressure_tria*l1l4_tria[i][3]*nz[i]; 1372 1363 pe_g[15]+= 0; 1373 1374 1375 1364 1376 1365 } //for(i=0;i<4;i++) -
issm/trunk/src/c/objects/Matice.cpp
r394 r442 333 333 double eps0; 334 334 335 eps0= 10^-27;335 eps0=pow(10,-27); 336 336 337 337 if (n==1){ … … 362 362 else{ 363 363 e=(n-1)/2/n; 364 365 364 viscosity3d=2*B/(2*pow(A,e)); 366 365 } -
issm/trunk/src/c/objects/Pengrid.cpp
r394 r442 102 102 void Pengrid::Demarshall(char** pmarshalled_dataset){ 103 103 104 int i;105 104 char* marshalled_dataset=NULL; 106 105 … … 207 206 double slope[2]; 208 207 int found=0; 209 double Ke[4][4]={ {0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}};208 double Ke[4][4]={0.0}; 210 209 211 210 ParameterInputs* inputs=NULL; 212 213 211 214 212 /*recover pointers: */ … … 229 227 Ke[2][2]=kmax*pow(10,penalty_offset); 230 228 231 232 229 /*Add Ke to global matrix Kgg: */ 233 230 MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke,ADD_VALUES); … … 237 234 #define __FUNCT__ "Pengrid::PenaltyCreatePVector" 238 235 void Pengrid::PenaltyCreatePVector(Vec pg,void* inputs,double kmax,int analysis_type){ 239 throw ErrorException(__FUNCT__," not implemented yet!"); 236 237 /*No penalty applied, do nothing: */ 238 return; 239 240 240 } 241 241 -
issm/trunk/src/c/objects/Penta.cpp
r437 r442 679 679 /* Get Jacobian determinant: */ 680 680 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_l1l2l3l4); 681 682 681 DL_scalar=gauss_weight*Jdet; 683 682 … … 746 745 747 746 /*matrices: */ 748 double Ke_temp[27][27] ; //for the six nodes and the bubble747 double Ke_temp[27][27]={0.0}; //for the six nodes and the bubble 749 748 double Ke_reduced[numdof][numdof]; //for the six nodes only 750 749 double Ke_gaussian[27][27]; … … 756 755 double Jdet; 757 756 double Jdet2d; 758 double D[8][8]={ { 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 }};757 double D[8][8]={0.0}; 759 758 double D_scalar; 760 759 double tBD[numdof][8]; 761 double DLStokes[14][14] ;760 double DLStokes[14][14]={0.0}; 762 761 double tLDStokes[numdof2d][14]; 763 762 … … 801 800 gravity=matpar->GetG(); 802 801 803 804 802 /* Get node coordinates and dof list: */ 805 803 GetElementNodeData( &xyz_list[0][0], nodes, numgrids); … … 808 806 /*recover extra inputs from users, at current convergence iteration: */ 809 807 inputs->Recover("velocity",&vxvyvz_list[0][0],3,dofs,numgrids,(void**)nodes); 810 811 /*Initialize Ke_temp to zero befor adding terms */812 for (i=0;i<27;i++){813 for (j=0;j<27;j++){814 Ke_temp[i][j]=0;815 }816 }817 808 818 809 /* Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore … … 821 812 which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian 822 813 points, same deal, which yields 3 gaussian points.*/ 823 824 814 825 815 area_order=5; … … 841 831 gauss_coord[3]=*(vert_gauss_coord+igvert); 842 832 843 844 833 /*Compute thickness: */ 845 834 GetParameterValue(&thickness, &h[0],gauss_coord); … … 868 857 } 869 858 870 871 859 /* Do the triple product tB*D*Bprime: */ 872 860 MatrixMultiply(&B[0][0],8,27,1,&D[0][0],8,8,0,&tBD[0][0],0); … … 883 871 884 872 if((onbed==1) && (shelf==0)){ 885 886 873 887 874 /*Build alpha2_list used by drag stiffness matrix*/ … … 915 902 } 916 903 917 918 904 GaussTria (&num_area_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &area_gauss_weights, 2); 919 905 … … 974 960 for(i=0;i<numdof2d;i++){ 975 961 for(j=0;j<numdof2d;j++){ 976 K _terms[i][j]+=Ke_drag_gaussian[i][j];962 Ke_temp[i][j]+=Ke_drag_gaussian[i][j]; 977 963 } 978 964 } … … 993 979 994 980 cleanup_and_return: 995 996 981 997 982 return; … … 2408 2393 2409 2394 #ifdef _DEBUG_ 2410 for (i=0;i< 6;i++){2411 printf("Node %i dh/dx=%lf dh/dy=%lf dh/dz=%lf \n",i,dh1dh7_basic[0][i],dh1dh7_basic[1][i] );2395 for (i=0;i<7;i++){ 2396 printf("Node %i dh/dx=%lf dh/dy=%lf dh/dz=%lf \n",i,dh1dh7_basic[0][i],dh1dh7_basic[1][i],dh1dh7_basic[2][i]); 2412 2397 } 2413 2398 … … 2780 2765 2781 2766 for (i=0;i<numgrids;i++){ 2782 *(dh1dh7_basic+numgrids*0+i)=Jinv[0][0]*dh1dh7_param[0][i]+Jinv[ 1][0]*dh1dh7_param[1][i]+Jinv[2][0]*dh1dh7_param[2][i];2783 *(dh1dh7_basic+numgrids*1+i)=Jinv[ 0][1]*dh1dh7_param[0][i]+Jinv[1][1]*dh1dh7_param[1][i]+Jinv[2][1]*dh1dh7_param[2][i];2784 *(dh1dh7_basic+numgrids*2+i)=Jinv[ 0][2]*dh1dh7_param[0][i]+Jinv[1][2]*dh1dh7_param[1][i]+Jinv[2][2]*dh1dh7_param[2][i];2767 *(dh1dh7_basic+numgrids*0+i)=Jinv[0][0]*dh1dh7_param[0][i]+Jinv[0][1]*dh1dh7_param[1][i]+Jinv[0][2]*dh1dh7_param[2][i]; 2768 *(dh1dh7_basic+numgrids*1+i)=Jinv[1][0]*dh1dh7_param[0][i]+Jinv[1][1]*dh1dh7_param[1][i]+Jinv[1][2]*dh1dh7_param[2][i]; 2769 *(dh1dh7_basic+numgrids*2+i)=Jinv[2][0]*dh1dh7_param[0][i]+Jinv[2][1]*dh1dh7_param[1][i]+Jinv[2][2]*dh1dh7_param[2][i]; 2785 2770 } 2786 2771 … … 2890 2875 2891 2876 /*matrices: */ 2892 double Pe_temp[27] ; //for the six nodes and the bubble2893 double Pe_gaussian[27] ; //for the six nodes and the bubble2894 double Ke_temp[27][3] ; //for the six nodes and the bubble2877 double Pe_temp[27]={0.0}; //for the six nodes and the bubble 2878 double Pe_gaussian[27]={0.0}; //for the six nodes and the bubble 2879 double Ke_temp[27][3]={0.0}; //for the six nodes and the bubble 2895 2880 double Pe_reduced[numdof]; //for the six nodes only 2896 2881 double Ke_gaussian[27][3]; … … 2902 2887 double Jdet; 2903 2888 double Jdet2d; 2904 double D[8][8]={ { 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 },{ 0,0,0,0,0,0,0,0 }};2889 double D[8][8]={0.0}; 2905 2890 double D_scalar; 2906 2891 double tBD[27][8]; … … 2930 2915 GetDofList(&doflist[0],&numberofdofspernode); 2931 2916 2932 /*Initialize Ke_temp to zero befor adding terms */2933 for (i=0;i<27;i++){2934 Pe_temp[i]=0;2935 for (j=0;j<3;j++){2936 Ke_temp[i][j]=0;2937 }2938 }2939 2940 2941 2942 2917 /* Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore 2943 2918 get tria gaussian points as well as segment gaussian points. For tria gaussian … … 2945 2920 which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian 2946 2921 points, same deal, which yields 3 gaussian points.*/ 2947 2948 2949 2922 2950 2923 /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */ … … 3017 2990 } 3018 2991 3019 3020 2992 /*Deal with 2d friction at the bedrock interface: */ 3021 2993 if ( (onbed==1) && (shelf==1)){ … … 3040 3012 gauss_coord_tria[1]=*(second_gauss_area_coord+igarea); 3041 3013 gauss_coord_tria[2]=*(third_gauss_area_coord+igarea); 3042 3043 3014 3044 3015 /*Get the Jacobian determinant */ … … 3076 3047 } 3077 3048 3078 3079 3049 /*Add P_terms to global vector pg: */ 3080 3050 VecSetValues(pg,numdof,doflist,(const double*)P_terms,ADD_VALUES);
Note:
See TracChangeset
for help on using the changeset viewer.