Changeset 602
- Timestamp:
- 05/26/09 17:12:55 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Tria.cpp
r600 r602 551 551 /* matrices: */ 552 552 double L[numgrids]; 553 double B[2][numgrids]; 554 double Bprime[2][numgrids]; 553 555 double DL[2][2]={0.0}; 554 556 double DLprime[2][2]={0.0}; … … 556 558 double Ke_gg[numdof][numdof]={0.0};//local element stiffness matrix 557 559 double Ke_gg_gaussian[numdof][numdof]={0.0}; //stiffness matrix evaluated at the gaussian point. 558 double Ke_gg_thickness[numdof][numdof]={0.0}; //stiffness matrix evaluated at the gaussian point. 560 double Ke_gg_thickness1[numdof][numdof]={0.0}; //stiffness matrix evaluated at the gaussian point. 561 double Ke_gg_thickness2[numdof][numdof]={0.0}; //stiffness matrix evaluated at the gaussian point. 559 562 560 563 double Jdettria; 561 564 562 565 /*input parameters for structural analysis (diagnostic): */ 563 double vxvy_list[numgrids][2]={0 ,0};564 double vx_list[numgrids]={0 ,0};565 double vy_list[numgrids]={0 ,0};566 double vxvy_list[numgrids][2]={0.0}; 567 double vx_list[numgrids]={0.0}; 568 double vy_list[numgrids]={0.0}; 566 569 double dvx[2]; 567 570 double dvy[2]; 568 571 double vx,vy; 572 double dvxdx,dvydy; 569 573 double v_gauss[2]={0.0}; 570 574 double K[2][2]={0.0}; … … 636 640 637 641 /*Get B and B prime matrix: */ 638 //GetB_prog(&B[0][0], &xyz_list[0][0], gauss_l1l2l3);639 //GetBprime_prog(&Bprime[0][0], &xyz_list[0][0], gauss_l1l2l3);642 GetB_prog(&B[0][0], &xyz_list[0][0], gauss_l1l2l3); 643 GetBPrime_prog(&Bprime[0][0], &xyz_list[0][0], gauss_l1l2l3); 640 644 641 645 //Get vx, vy and their derivatives at gauss point … … 646 650 GetParameterDerivativeValue(&dvy[0], &vy_list[0],&xyz_list[0][0], gauss_l1l2l3); 647 651 648 //dvxdx=dvx[0];649 //dvydy=dvy[1];652 dvxdx=dvx[0]; 653 dvydy=dvy[1]; 650 654 651 655 DL_scalar=dt*gauss_weight*Jdettria; 652 656 653 657 //Create DL and DLprime matrix 654 //DL[0][0]=DL_scalar*dvxdx;655 //DL[1][1]=DL_scalar*dvydy;658 DL[0][0]=DL_scalar*dvxdx; 659 DL[1][1]=DL_scalar*dvydy; 656 660 657 661 DLprime[0][0]=DL_scalar*vx; … … 661 665 //Ke_gg_thickness=B'*DL*B+B'*DLprime*Bprime; 662 666 663 /*TripleMultiply( &B[0][0],numdof,numdof,1, 664 &DL_scalar,1,1,0, 665 &L[0],1,numdof,0, 666 &Ke_gg_gaussian[0][0],0);*/ 667 668 669 670 667 TripleMultiply( &B[0][0],2,numdof,1, 668 &DL[0][0],2,2,0, 669 &B[0][0],2,numdof,0, 670 &Ke_gg_thickness1[0][0],0); 671 672 TripleMultiply( &B[0][0],2,numdof,1, 673 &DLprime[0][0],2,2,0, 674 &Bprime[0][0],2,numdof,0, 675 &Ke_gg_thickness2[0][0],0); 671 676 672 677 /* Add the Ke_gg_gaussian, and optionally Ke_gg_drag_gaussian onto Ke_gg: */ 673 678 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j]; 679 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_thickness1[i][j]; 680 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_thickness2[i][j]; 674 681 675 682 #ifdef _DEBUGELEMENTS_ … … 696 703 MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES); 697 704 698 699 /*Do not forget to include friction: */700 if(!shelf){701 //CreateKMatrixPrognosticFriction(Kgg,inputs,analysis_type,sub_analysis_type);702 }703 704 705 705 #ifdef _DEBUGELEMENTS_ 706 706 if(my_rank==RANK && id==ELID){ … … 766 766 double thickness_g; 767 767 double dt; 768 int dofs[1]={ 1};768 int dofs[1]={0}; 769 769 int found=0; 770 770 … … 1706 1706 } 1707 1707 } 1708 1709 #undef __FUNCT__ 1710 #define __FUNCT__ "Tria::GetB_prog" 1711 1712 void Tria::GetB_prog(double* B_prog, double* xyz_list, double* gauss_l1l2l3){ 1713 1714 /*Compute B matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 1715 * For grid i, Bi can be expressed in the basic coordinate system 1716 * by: 1717 * Bi_basic=[ h ] 1718 * [ h ] 1719 * where h is the interpolation function for grid i. 1720 * 1721 * We assume B_prog has been allocated already, of size: 2x(NDOF1*numgrids) 1722 */ 1723 1724 int i; 1725 const int NDOF1=1; 1726 const int numgrids=3; 1727 1728 double l1l2l3[numgrids]; 1729 1730 1731 /*Get dh1dh2dh3 in basic coordinate system: */ 1732 GetNodalFunctions(&l1l2l3[0],gauss_l1l2l3); 1733 1734 #ifdef _DEBUG_ 1735 for (i=0;i<3;i++){ 1736 printf("Node %i h=%lf \n",i,l1l2l3[i]); 1737 } 1738 #endif 1739 1740 /*Build B_prog: */ 1741 for (i=0;i<numgrids;i++){ 1742 *(B_prog+NDOF1*numgrids*0+NDOF1*i)=l1l2l3[i]; 1743 *(B_prog+NDOF1*numgrids*1+NDOF1*i)=l1l2l3[i]; 1744 } 1745 } 1746 1747 #undef __FUNCT__ 1748 #define __FUNCT__ "Tria::GetBPrime_prog" 1749 1750 void Tria::GetBPrime_prog(double* Bprime_prog, double* xyz_list, double* gauss_l1l2l3){ 1751 1752 /*Compute B' matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 1753 * For grid i, Bi' can be expressed in the basic coordinate system 1754 * by: 1755 * Bi_prime__basic=[ dh/dx ] 1756 * [ dh/dy ] 1757 * where h is the interpolation function for grid i. 1758 * 1759 * We assume B' has been allocated already, of size: 3x(NDOF2*numgrids) 1760 */ 1761 1762 int i; 1763 const int NDOF1=1; 1764 const int NDOF2=2; 1765 const int numgrids=3; 1766 1767 /*Same thing in the basic coordinate system: */ 1768 double dh1dh2dh3_basic[NDOF2][numgrids]; 1769 1770 /*Get dh1dh2dh3 in basic coordinates system : */ 1771 GetNodalFunctionsDerivativesBasic(&dh1dh2dh3_basic[0][0],xyz_list,gauss_l1l2l3); 1772 1773 /*Build B': */ 1774 for (i=0;i<numgrids;i++){ 1775 *(Bprime_prog+NDOF1*numgrids*0+NDOF1*i)=dh1dh2dh3_basic[0][i]; 1776 *(Bprime_prog+NDOF1*numgrids*1+NDOF1*i)=dh1dh2dh3_basic[1][i]; 1777 } 1778 } 1779 1708 1780 1709 1781 #undef __FUNCT__ -
issm/trunk/src/c/objects/Tria.h
r600 r602 84 84 void GetBPrime(double* Bprime, double* xyz_list, double* gauss_l1l2l3); 85 85 void GetL(double* L, double* xyz_list, double* gauss_l1l2l3,int numdof); 86 void GetB_prog(double* B_prog, double* xyz_list, double* gauss_l1l2l3); 87 void GetBPrime_prog(double* Bprime_prog, double* xyz_list, double* gauss_l1l2l3); 86 88 void GetNodalFunctions(double* l1l2l3, double* gauss_l1l2l3); 87 89 void GetNodalFunctionsDerivativesBasic(double* dh1dh2dh3_basic,double* xyz_list, double* gauss_l1l2l3);
Note:
See TracChangeset
for help on using the changeset viewer.