Changeset 5669
- Timestamp:
- 09/03/10 10:47:10 (15 years ago)
- Location:
- issm/trunk/src/c/objects/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Tria.cpp
r5663 r5669 1108 1108 void Tria::GradjDhDt(Vec gradient){ 1109 1109 1110 int i; 1111 1112 /* node data: */ 1113 int doflist1[NUMVERTICES]; 1114 1115 /*Gauss*/ 1116 double gauss[NUMVERTICES][NUMVERTICES]={{1,0,0},{0,1,0},{0,0,1}}; 1117 1118 /* grid data: */ 1119 double lambda; 1120 1121 /*element vector at the gaussian points: */ 1122 double gradient_g[NUMVERTICES]; 1123 1124 /*Inputs*/ 1125 Input* adjoint_input=NULL; 1110 /*Intermediaries*/ 1111 int doflist1[NUMVERTICES]; 1112 double lambda[NUMVERTICES]; 1113 double gradient_g[NUMVERTICES]; 1126 1114 1127 1115 /*Retrieve dof list*/ 1128 1116 GetDofList1(&doflist1[0]); 1129 1117 1130 /*Retrieve all inputs we will be needing: */ 1131 adjoint_input=(Input*)inputs->GetInput(AdjointEnum); 1132 1133 /* Start looping on the vertices: */ 1134 for(i=0; i<NUMVERTICES;i++){ 1135 adjoint_input->GetParameterValue(&lambda,&gauss[i][0]); 1136 gradient_g[i]=-lambda; 1137 } 1118 /*Compute Gradient*/ 1119 GetParameterListOnVertices(&lambda[0],AdjointEnum); 1120 for(int i=0;i<NUMVERTICES;i++) gradient_g[i]=-lambda[i]; 1138 1121 1139 1122 /*Add grade_g to global vector gradient: */ … … 5793 5776 } 5794 5777 /*}}}*/ 5795 /*FUNCTION Tria::GetStrainRate2d(double* epsilon,double* xyz_list, double* gauss, Input* vx_input, Input* vy_input){{{1*/5796 void Tria::GetStrainRate2d(double* epsilon,double* xyz_list, double* gauss, Input* vx_input, Input* vy_input){5797 /*Compute the 2d Strain Rate (3 components):5798 *5799 * epsilon=[exx eyy exy]5800 */5801 5802 int i;5803 5804 double epsilonvx[3];5805 double epsilonvy[3];5806 5807 /*Check that both inputs have been found*/5808 if (!vx_input || !vy_input){5809 ISSMERROR("Input missing. Here are the input pointers we have for vx: %p, vy: %p\n",vx_input,vy_input);5810 }5811 5812 /*Get strain rate assuming that epsilon has been allocated*/5813 vx_input->GetVxStrainRate2d(epsilonvx,xyz_list,gauss);5814 vy_input->GetVyStrainRate2d(epsilonvy,xyz_list,gauss);5815 5816 /*Sum all contributions*/5817 for(i=0;i<3;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i];5818 5819 }5820 /*}}}*/5821 5778 /*FUNCTION Tria::GetStrainRate2d(double* epsilon,double* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){{{1*/ 5822 5779 void Tria::GetStrainRate2d(double* epsilon,double* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){ -
issm/trunk/src/c/objects/Elements/Tria.h
r5662 r5669 158 158 void GetSolutionFromInputsDiagnosticHoriz(Vec solution); 159 159 void GetSolutionFromInputsDiagnosticHutter(Vec solution); 160 void GetStrainRate2d(double* epsilon,double* xyz_list, double* gauss, Input* vx_input, Input* vy_input);161 160 void GetStrainRate2d(double* epsilon,double* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input); 162 161 void GradjDragStokes(Vec gradient);
Note:
See TracChangeset
for help on using the changeset viewer.