Changeset 3831
- Timestamp:
- 05/18/10 17:25:33 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Tria.cpp
r3830 r3831 972 972 int doflist[numdof]; 973 973 int numberofdofspernode; 974 double gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}}; 974 975 975 976 /* gaussian points: */ … … 981 982 double gauss_weight; 982 983 double gauss_l1l2l3[3]; 983 double gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}};984 984 985 985 /* matrices: */ … … 1000 1000 double surface_list[3]; 1001 1001 double nx,ny,norm; 1002 double vx_list[numgrids]={0.0};1003 double vy_list[numgrids]={0.0};1004 1002 double dvx[2]; 1005 1003 double dvy[2]; … … 1015 1013 double artdiff; 1016 1014 1017 /*Recover velocity: */1018 inputs->GetParameterValues(&vx_list[0],&gaussgrids[0][0],3,VxAverageEnum);1019 inputs->GetParameterValues(&vy_list[0],&gaussgrids[0][0],3,VyAverageEnum);1020 1021 1015 /*retrieve some parameters: */ 1022 1016 this->parameters->FindParam(&artdiff,ArtDiffEnum); … … 1031 1025 1032 1026 /*Get normal vector to the surface*/ 1033 nx=(vx_list[0]+vx_list[1]+vx_list[2])/3;1034 ny=(vy_list[0]+vy_list[1]+vy_list[2])/3;1027 inputs->GetParameterAverage(&nx,VxAverageEnum); 1028 inputs->GetParameterAverage(&ny,VyAverageEnum); 1035 1029 if(nx==0 && ny==0){ 1036 1030 SurfaceNormal(&surface_normal[0],xyz_list); … … 1053 1047 1054 1048 //Build K matrix (artificial diffusivity matrix) 1055 v_gauss[0]=ONETHIRD*(vx_list[0]+vx_list[1]+vx_list[2]);1056 v_gauss[1]=ONETHIRD*(vy_list[0]+vy_list[1]+vy_list[2]);1049 inputs->GetParameterAverage(&v_gauss[0],VxAverageEnum); 1050 inputs->GetParameterAverage(&v_gauss[1],VyAverageEnum); 1057 1051 1058 1052 K[0][0]=pow(10,2)*pow(Jdettria,(double).5)/2.0*fabs(v_gauss[0]); //pow should be zero!! … … 1079 1073 1080 1074 //Get vx, vy and their derivatives at gauss point 1081 GetParameterValue(&vx, &vx_list[0],gauss_l1l2l3);1082 GetParameterValue(&vy, &vy_list[0],gauss_l1l2l3);1083 1084 GetParameterDerivativeValue(&dvx[0], &vx_list[0],&xyz_list[0][0], gauss_l1l2l3);1085 GetParameterDerivativeValue(&dvy[0], &vy_list[0],&xyz_list[0][0], gauss_l1l2l3);1075 inputs->GetParameterValue(&vx,&gauss_l1l2l3[0],VxAverageEnum); 1076 inputs->GetParameterValue(&vy,&gauss_l1l2l3[0],VyAverageEnum); 1077 1078 inputs->GetParameterDerivativeValue(&dvx[0],&xyz_list[0][0],&gauss_l1l2l3[0],VxAverageEnum); 1079 inputs->GetParameterDerivativeValue(&dvy[0],&xyz_list[0][0],&gauss_l1l2l3[0],VyAverageEnum); 1086 1080 1087 1081 dvxdx=dvx[0]; … … 1654 1648 double gauss_weight; 1655 1649 double gauss_l1l2l3[3]; 1656 double gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}};1657 1650 1658 1651 /* matrices: */ … … 1670 1663 1671 1664 /*input parameters for structural analysis (diagnostic): */ 1672 double vx_list[numgrids]={0.0};1673 double vy_list[numgrids]={0.0};1674 1665 double dvx[2]; 1675 1666 double dvy[2]; … … 1694 1685 GetDofList(&doflist[0],&numberofdofspernode); 1695 1686 1696 /*Recover velocity: */1697 inputs->GetParameterValues(&vx_list[0],&gaussgrids[0][0],3,VxAverageEnum);1698 inputs->GetParameterValues(&vy_list[0],&gaussgrids[0][0],3,VyAverageEnum);1699 1700 1687 //Create Artificial diffusivity once for all if requested 1701 1688 if(artdiff==1){ … … 1705 1692 1706 1693 //Build K matrix (artificial diffusivity matrix) 1707 v_gauss[0]=ONETHIRD*(vx_list[0]+vx_list[1]+vx_list[2]);1708 v_gauss[1]=ONETHIRD*(vy_list[0]+vy_list[1]+vy_list[2]);1694 inputs->GetParameterAverage(&v_gauss[0],VxAverageEnum); 1695 inputs->GetParameterAverage(&v_gauss[1],VyAverageEnum); 1709 1696 1710 1697 K[0][0]=pow(Jdettria,(double).5)/2.0*fabs(v_gauss[0]); … … 1743 1730 1744 1731 //Get vx, vy and their derivatives at gauss point 1745 GetParameterValue(&vx, &vx_list[0],gauss_l1l2l3);1746 GetParameterValue(&vy, &vy_list[0],gauss_l1l2l3);1747 1748 GetParameterDerivativeValue(&dvx[0], &vx_list[0],&xyz_list[0][0], gauss_l1l2l3);1749 GetParameterDerivativeValue(&dvy[0], &vy_list[0],&xyz_list[0][0], gauss_l1l2l3);1732 inputs->GetParameterValue(&vx,&gauss_l1l2l3[0],VxAverageEnum); 1733 inputs->GetParameterValue(&vy,&gauss_l1l2l3[0],VyAverageEnum); 1734 1735 inputs->GetParameterDerivativeValue(&dvx[0],&xyz_list[0][0],&gauss_l1l2l3[0],VxAverageEnum); 1736 inputs->GetParameterDerivativeValue(&dvy[0],&xyz_list[0][0],&gauss_l1l2l3[0],VyAverageEnum); 1750 1737 1751 1738 dvxdx=dvx[0];
Note:
See TracChangeset
for help on using the changeset viewer.