Changeset 15741 for issm/trunk-jpl/src/c/classes/Elements
- Timestamp:
- 08/07/13 11:25:05 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r15738 r15741 3938 3938 /*Build K: */ 3939 3939 GetElementSizes(&hx,&hy,&hz); 3940 vel=sqrt( pow(vx,2.)+pow(vy,2.)+pow(vz,2.))+1.e-14;3941 h=sqrt( pow(hx*vx/vel,2 .) + pow(hy*vy/vel,2.) + pow(hz*vz/vel,2.));3940 vel=sqrt(vx*vx + vy*vy + vz*vz)+1.e-14; 3941 h=sqrt( pow(hx*vx/vel,2) + pow(hy*vy/vel,2) + pow(hz*vz/vel,2)); 3942 3942 K[0][0]=h/(2*vel)*vx*vx; K[0][1]=h/(2*vel)*vx*vy; K[0][2]=h/(2*vel)*vx*vz; 3943 3943 K[1][0]=h/(2*vel)*vy*vx; K[1][1]=h/(2*vel)*vy*vy; K[1][2]=h/(2*vel)*vy*vz; … … 4167 4167 /*Build K: */ 4168 4168 GetElementSizes(&hx,&hy,&hz); 4169 vel=sqrt( pow(vx,2.)+pow(vy,2.)+pow(vz,2.))+1.e-14;4170 h=sqrt( pow(hx*vx/vel,2 .) + pow(hy*vy/vel,2.) + pow(hz*vz/vel,2.));4169 vel=sqrt(vx*vx + vy*vy + vz*vz)+1.e-14; 4170 h=sqrt( pow(hx*vx/vel,2) + pow(hy*vy/vel,2) + pow(hz*vz/vel,2)); 4171 4171 4172 4172 K[0][0]=h/(2*vel)*fabs(vx*vx); K[0][1]=h/(2*vel)*fabs(vx*vy); K[0][2]=h/(2*vel)*fabs(vx*vz); … … 8496 8496 /*Deal with lower surface*/ 8497 8497 if(IsOnBed()){ 8498 constant_part=-1.58* pow(10.,-10.)*rho_ice*gravity*thickness;8498 constant_part=-1.58*1.e-10*rho_ice*gravity*thickness; 8499 8499 ub=constant_part*slope[0]; 8500 8500 vb=constant_part*slope[1]; -
issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp
r15694 r15741 1874 1874 /*Jdet = (Area of the trapezoid)/(Area trapezoid ref) with AreaRef = 4*/ 1875 1875 /*Area of a trabezoid = altitude * (base1 + base2)/2 */ 1876 *Jdet= pow(pow(x2-x1,2.) + pow(y2-y1,2.),0.5) * (z4-z1 + z3-z2)/8;1877 if(*Jdet<0 ) _error_("negative jacobian determinant!");1876 *Jdet= sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)) * (z4-z1 + z3-z2)/8.; 1877 if(*Jdet<0.) _error_("negative jacobian determinant!"); 1878 1878 1879 1879 } -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15732 r15741 3321 3321 constant_part=-2.*pow(rho_ice*gravity,n)*pow(slope2,((n-1.)/2.)); 3322 3322 3323 ub=-1.58* pow(10.,-10.)*rho_ice*gravity*thickness*slope[0];3324 vb=-1.58* pow(10.,-10.)*rho_ice*gravity*thickness*slope[1];3323 ub=-1.58*1.e-10*rho_ice*gravity*thickness*slope[0]; 3324 vb=-1.58*1.e-10*rho_ice*gravity*thickness*slope[1]; 3325 3325 3326 3326 pe->values[2*i+0]=(ub-2.*pow(rho_ice*gravity,n)*pow(slope2,((n-1.)/2.))*pow(thickness,n)/(pow(B,n)*(n+1))*slope[0])/connectivity; … … 4429 4429 4430 4430 /*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 4431 Jelem+=weight*1/2*( pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;4431 Jelem+=weight*1/2*(dp[0]*dp[0] + dp[1]*dp[1])*Jdet*gauss->weight; 4432 4432 } 4433 4433
Note:
See TracChangeset
for help on using the changeset viewer.