Changeset 14660
- Timestamp:
- 04/19/13 13:48:09 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/objects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
r14652 r14660 5758 5758 } 5759 5759 /*}}}*/ 5760 /*FUNCTION Tria::CreateKMatrixHydrologyShreve {{{*/5760 /*FUNCTION Tria::CreateKMatrixHydrologyShreve(void){{{*/ 5761 5761 ElementMatrix* Tria::CreateKMatrixHydrologyShreve(void){ 5762 5762 5763 5763 /*Constants*/ 5764 5764 const int numdof=NDOF1*NUMVERTICES; 5765 5766 5765 5766 /*Intermediaries */ 5767 5767 IssmDouble diffusivity; 5768 5768 IssmDouble Jdettria,DL_scalar,dt,h; … … 5779 5779 IssmDouble DLprime[2][2] ={0.0}; 5780 5780 GaussTria *gauss=NULL; 5781 5782 5781 5782 /*Skip if water or ice shelf element*/ 5783 5783 if(IsOnWater() | IsFloating()) return NULL; 5784 5785 5784 5785 /*Initialize Element matrix*/ 5786 5786 ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum); 5787 5788 5787 5788 /*Create water velocity vx and vy from current inputs*/ 5789 5789 CreateHydrologyWaterVelocityInput(); 5790 5791 5790 5791 /*Retrieve all inputs and parameters*/ 5792 5792 GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES); 5793 5793 this->parameters->FindParam(&dt,TimesteppingTimeStepEnum); … … 5796 5796 Input* vy_input=inputs->GetInput(HydrologyWaterVyEnum); _assert_(vy_input); 5797 5797 h=sqrt(2*this->GetArea()); 5798 5799 5798 5799 /* Start looping on the number of gaussian points: */ 5800 5800 gauss=new GaussTria(2); 5801 5801 for(int ig=gauss->begin();ig<gauss->end();ig++){ 5802 5802 5803 5803 gauss->GaussPoint(ig); 5804 5804 5805 5805 GetJacobianDeterminant(&Jdettria, &xyz_list[0][0],gauss); 5806 5806 GetL(&L[0], &xyz_list[0][0], gauss,NDOF1); 5807 5807 5808 5808 vx_input->GetInputValue(&vx,gauss); 5809 5809 vy_input->GetInputValue(&vy,gauss); 5810 5810 vx_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss); 5811 5811 vy_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss); 5812 5812 5813 5813 DL_scalar=gauss->weight*Jdettria; 5814 5814 5815 5815 TripleMultiply( &L[0],1,numdof,1, 5816 &DL_scalar,1,1,0,5817 &L[0],1,numdof,0,5818 &Ke->values[0],1);5819 5816 &DL_scalar,1,1,0, 5817 &L[0],1,numdof,0, 5818 &Ke->values[0],1); 5819 5820 5820 GetBPrognostic(&B[0][0], &xyz_list[0][0], gauss); 5821 5821 GetBprimePrognostic(&Bprime[0][0], &xyz_list[0][0], gauss); 5822 5822 5823 5823 dvxdx=dvx[0]; 5824 5824 dvydy=dvy[1]; 5825 5825 DL_scalar=dt*gauss->weight*Jdettria; 5826 5826 5827 5827 DL[0][0]=DL_scalar*dvxdx; 5828 5828 DL[1][1]=DL_scalar*dvydy; 5829 5829 DLprime[0][0]=DL_scalar*vx; 5830 5830 DLprime[1][1]=DL_scalar*vy; 5831 5831 5832 5832 TripleMultiply( &B[0][0],2,numdof,1, 5833 &DL[0][0],2,2,0,5834 &B[0][0],2,numdof,0,5835 &Ke->values[0],1);5836 5833 &DL[0][0],2,2,0, 5834 &B[0][0],2,numdof,0, 5835 &Ke->values[0],1); 5836 5837 5837 TripleMultiply( &B[0][0],2,numdof,1, 5838 &DLprime[0][0],2,2,0,5839 &Bprime[0][0],2,numdof,0,5840 &Ke->values[0],1);5841 5838 &DLprime[0][0],2,2,0, 5839 &Bprime[0][0],2,numdof,0, 5840 &Ke->values[0],1); 5841 5842 5842 /*Artificial diffusivity*/ 5843 5843 vel=sqrt(vx*vx+vy*vy); … … 5850 5850 KDL[0][1]=DL_scalar*K[0][1]; 5851 5851 KDL[1][1]=DL_scalar*K[1][1]; 5852 5852 5853 5853 TripleMultiply( &Bprime[0][0],2,numdof,1, 5854 &KDL[0][0],2,2,0,5855 &Bprime[0][0],2,numdof,0,5856 &Ke->values[0],1);5857 } 5858 5859 5854 &KDL[0][0],2,2,0, 5855 &Bprime[0][0],2,numdof,0, 5856 &Ke->values[0],1); 5857 } 5858 5859 /*Clean up and return*/ 5860 5860 delete gauss; 5861 5861 return Ke; … … 5870 5870 /* Intermediaries */ 5871 5871 IssmDouble D_scalar,Jdet; 5872 IssmDouble sediment_porosity,dt; 5872 IssmDouble sediment_compressibility, sediment_porosity, sediment_thickness, 5873 sediment_transmitivity, water_compressibility, rho_freshwater, gravity, dt; 5874 IssmDouble sediment_storing; 5873 5875 IssmDouble xyz_list[NUMVERTICES][3]; 5874 5876 IssmDouble B[2][numdof]; 5875 IssmDouble L[NUMVERTICES];5877 IssmDouble L[NUMVERTICES]; 5876 5878 IssmDouble D[2][2]; 5877 GaussTria *gauss = NULL;5879 GaussTria *gauss = NULL; 5878 5880 5879 5881 /*Initialize Element matrix*/ … … 5882 5884 /*Retrieve all inputs and parameters*/ 5883 5885 GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES); 5884 sediment_porosity = matpar->GetSedimentPorosity(); 5886 sediment_compressibility = matpar->GetSedimentCompressibility(); 5887 sediment_porosity = matpar->GetSedimentPorosity(); 5888 sediment_thickness = matpar->GetSedimentThickness(); 5889 sediment_transmitivity = matpar->GetSedimentTransmitivity(); 5890 water_compressibility = matpar->GetWaterCompressibility(); 5891 rho_freshwater = matpar->GetRhoFreshwater(); 5892 gravity = matpar->GetG(); 5893 5885 5894 this->parameters->FindParam(&dt,TimesteppingTimeStepEnum); 5895 5896 /*Compute Storing coefficient fro the above */ 5897 5898 sediment_storing = rho_freshwater*gravity*sediment_porosity*sediment_thickness* 5899 (water_compressibility+(sediment_compressibility/sediment_porosity)); 5886 5900 5887 5901 /* Start looping on the number of gaussian points: */ … … 5900 5914 GetBHydro(&B[0][0],&xyz_list[0][0],gauss); 5901 5915 TripleMultiply(&B[0][0],2,numdof,1, 5902 &D[0][0],2,2,0,5903 &B[0][0],2,numdof,0,5904 &Ke->values[0],1);5916 &D[0][0],2,2,0, 5917 &B[0][0],2,numdof,0, 5918 &Ke->values[0],1); 5905 5919 5906 5920 /*Transient*/ … … 5908 5922 GetL(&L[0], &xyz_list[0][0], gauss,NDOF1); 5909 5923 D_scalar=gauss->weight*Jdet; 5910 5924 5911 5925 TripleMultiply(&L[0],numdof,1,0, 5912 &D_scalar,1,1,0,5913 &L[0],1,numdof,0,5914 &Ke->values[0],1);5926 &D_scalar,1,1,0, 5927 &L[0],1,numdof,0, 5928 &Ke->values[0],1); 5915 5929 } 5916 5930 } -
issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h
r14655 r14660 111 111 IssmDouble GetSedimentTransmitivity(); 112 112 IssmDouble GetWaterCompressibility(); 113 IssmDouble GetWaterDensity();114 113 IssmDouble TMeltingPoint(IssmDouble pressure); 115 114 IssmDouble PureIceEnthalpy(IssmDouble pressure);
Note:
See TracChangeset
for help on using the changeset viewer.