Changeset 9512


Ignore:
Timestamp:
08/31/11 11:00:59 (14 years ago)
Author:
Mathieu Morlighem
Message:

better artificial diffusivity for bal H

File:
1 edited

Legend:

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

    r9451 r9512  
    516516        int        artdiff;
    517517        int        i,j,ig,dim;
    518         double     Jdettria ,vx,vy,dvxdx,dvydy;
     518        double     Jdettria,vx,vy,dvxdx,dvydy,vel,h;
    519519        double     dvx[2],dvy[2];
    520520        double     xyz_list[NUMVERTICES][3];
     
    546546                vyaverage_input=inputs->GetInput(VyAverageEnum); _assert_(vyaverage_input);
    547547        }
    548 
    549         /*Create Artificial diffusivity once for all if requested*/
    550         if(artdiff){
    551                 gauss=new GaussTria();
    552                 gauss->GaussCenter();
    553                 GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
    554                 delete gauss;
    555 
    556                 vxaverage_input->GetParameterAverage(&vx);
    557                 vyaverage_input->GetParameterAverage(&vy);
    558                 K[0][0]=pow(Jdettria,(double).5)/2.0*fabs(vx);
    559                 K[1][1]=pow(Jdettria,(double).5)/2.0*fabs(vy);
    560         }
     548        h=sqrt(2*this->GetArea());
     549
     550        ///*Create Artificial diffusivity once for all if requested*/
     551        //if(artdiff){
     552        //      gauss=new GaussTria();
     553        //      gauss->GaussCenter();
     554        //      GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
     555        //      delete gauss;
     556
     557        //      vxaverage_input->GetParameterAverage(&vx);
     558        //      vyaverage_input->GetParameterAverage(&vy);
     559        //      K[0][0]=pow(Jdettria,(double).5)/2.0*fabs(vx);
     560        //      K[1][1]=pow(Jdettria,(double).5)/2.0*fabs(vy);
     561        //}
    561562
    562563        /*Start looping on the number of gaussian points:*/
     
    596597
    597598                if(artdiff){
     599                        vel=sqrt(pow(vx,2.)+pow(vy,2.));
     600                        K[0][0]=h/(2*vel)*vx*vx;
     601                        K[1][0]=h/(2*vel)*vy*vx;
     602                        K[0][1]=h/(2*vel)*vx*vy;
     603                        K[1][1]=h/(2*vel)*vy*vy;
    598604                        KDL[0][0]=DL_scalar*K[0][0];
     605                        KDL[1][0]=DL_scalar*K[1][0];
     606                        KDL[0][1]=DL_scalar*K[0][1];
    599607                        KDL[1][1]=DL_scalar*K[1][1];
     608
     609                        //KDL[0][0]=DL_scalar*K[0][0];
     610                        //KDL[1][1]=DL_scalar*K[1][1];
    600611
    601612                        TripleMultiply( &Bprime[0][0],2,numdof,1,
Note: See TracChangeset for help on using the changeset viewer.