Changeset 12976


Ignore:
Timestamp:
08/10/12 10:41:52 (13 years ago)
Author:
Mathieu Morlighem
Message:

normalize velocity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp

    r12927 r12976  
    43054305        IssmDouble  xyz_list[NUMVERTICES][3];
    43064306        IssmDouble  dp[NDOF2];
    4307         IssmDouble  vx,vy;
     4307        IssmDouble  vx,vy,vel;
    43084308        GaussTria  *gauss                    = NULL;
    43094309
     
    43344334                vx_input->GetInputValue(&vx,gauss);
    43354335                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);
    43364339
    43374340                /*J = 1/2 ( vx*dH/dx + vy*dH/dy )^2 */
     
    43544357        IssmDouble  xyz_list[NUMVERTICES][3];
    43554358        IssmDouble  dp[NDOF2];
    4356         IssmDouble  vx,vy;
     4359        IssmDouble  vx,vy,vel;
    43574360        GaussTria  *gauss                    = NULL;
    43584361
     
    43834386                vx_input->GetInputValue(&vx,gauss);
    43844387                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);
    43854391
    43864392                /*J = 1/2 ( -vy*dH/dx + vx*dH/dy )^2 */
     
    44534459        IssmDouble  dbasis[NDOF2][NUMVERTICES];
    44544460        IssmDouble  dH[2];
    4455         IssmDouble  v[2];
     4461        IssmDouble  vx,vy,vel;
    44564462        GaussTria *gauss     = NULL;
    44574463        int       *responses = NULL;
     
    44984504                        case ThicknessAlongGradientEnum:
    44994505                                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;
    45034512                                break;
    45044513                        case ThicknessAcrossGradientEnum:
    45054514                                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;
    45094521                                break;
    45104522                        default:
Note: See TracChangeset for help on using the changeset viewer.