Changeset 12976
- Timestamp:
- 08/10/12 10:41:52 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
r12927 r12976 4305 4305 IssmDouble xyz_list[NUMVERTICES][3]; 4306 4306 IssmDouble dp[NDOF2]; 4307 IssmDouble vx,vy ;4307 IssmDouble vx,vy,vel; 4308 4308 GaussTria *gauss = NULL; 4309 4309 … … 4334 4334 vx_input->GetInputValue(&vx,gauss); 4335 4335 vy_input->GetInputValue(&vy,gauss); 4336 vel = sqrt(vx*vx+vy*vy); 4337 vx = vx/(vel+1.e-9); 4338 vy = vy/(vel+1.e-9); 4336 4339 4337 4340 /*J = 1/2 ( vx*dH/dx + vy*dH/dy )^2 */ … … 4354 4357 IssmDouble xyz_list[NUMVERTICES][3]; 4355 4358 IssmDouble dp[NDOF2]; 4356 IssmDouble vx,vy ;4359 IssmDouble vx,vy,vel; 4357 4360 GaussTria *gauss = NULL; 4358 4361 … … 4383 4386 vx_input->GetInputValue(&vx,gauss); 4384 4387 vy_input->GetInputValue(&vy,gauss); 4388 vel = sqrt(vx*vx+vy*vy); 4389 vx = vx/(vel+1.e-9); 4390 vy = vy/(vel+1.e-9); 4385 4391 4386 4392 /*J = 1/2 ( -vy*dH/dx + vx*dH/dy )^2 */ … … 4453 4459 IssmDouble dbasis[NDOF2][NUMVERTICES]; 4454 4460 IssmDouble dH[2]; 4455 IssmDouble v [2];4461 IssmDouble vx,vy,vel; 4456 4462 GaussTria *gauss = NULL; 4457 4463 int *responses = NULL; … … 4498 4504 case ThicknessAlongGradientEnum: 4499 4505 weights_input->GetInputValue(&weight, gauss,resp); 4500 vx_input->GetInputValue(&v[0],gauss); 4501 vy_input->GetInputValue(&v[1],gauss); 4502 for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*v[0]+dH[1]*v[1])*(dbasis[0][i]*v[0]+dbasis[1][i]*v[1])*Jdet*gauss->weight; 4506 vx_input->GetInputValue(&vx,gauss); 4507 vy_input->GetInputValue(&vy,gauss); 4508 vel = sqrt(vx*vx+vy*vy); 4509 vx = vx/(vel+1.e-9); 4510 vy = vy/(vel+1.e-9); 4511 for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*vx+dH[1]*vy)*(dbasis[0][i]*vx+dbasis[1][i]*vy)*Jdet*gauss->weight; 4503 4512 break; 4504 4513 case ThicknessAcrossGradientEnum: 4505 4514 weights_input->GetInputValue(&weight, gauss,resp); 4506 vx_input->GetInputValue(&v[0],gauss); 4507 vy_input->GetInputValue(&v[1],gauss); 4508 for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*(-v[1])+dH[1]*v[0])*(dbasis[0][i]*(-v[1])+dbasis[1][i]*v[0])*Jdet*gauss->weight; 4515 vx_input->GetInputValue(&vx,gauss); 4516 vy_input->GetInputValue(&vy,gauss); 4517 vel = sqrt(vx*vx+vy*vy); 4518 vx = vx/(vel+1.e-9); 4519 vy = vy/(vel+1.e-9); 4520 for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*(-vy)+dH[1]*vx)*(dbasis[0][i]*(-vy)+dbasis[1][i]*vx)*Jdet*gauss->weight; 4509 4521 break; 4510 4522 default:
Note:
See TracChangeset
for help on using the changeset viewer.