Changeset 3831


Ignore:
Timestamp:
05/18/10 17:25:33 (15 years ago)
Author:
Eric.Larour
Message:

Using GetParameterAverage all over

File:
1 edited

Legend:

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

    r3830 r3831  
    972972        int          doflist[numdof];
    973973        int          numberofdofspernode;
     974        double  gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}};
    974975
    975976        /* gaussian points: */
     
    981982        double  gauss_weight;
    982983        double  gauss_l1l2l3[3];
    983         double  gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}};
    984984
    985985        /* matrices: */
     
    10001000        double  surface_list[3];
    10011001        double  nx,ny,norm;
    1002         double  vx_list[numgrids]={0.0};
    1003         double  vy_list[numgrids]={0.0};
    10041002        double  dvx[2];
    10051003        double  dvy[2];
     
    10151013        double artdiff;
    10161014
    1017         /*Recover velocity: */
    1018         inputs->GetParameterValues(&vx_list[0],&gaussgrids[0][0],3,VxAverageEnum);
    1019         inputs->GetParameterValues(&vy_list[0],&gaussgrids[0][0],3,VyAverageEnum);
    1020 
    10211015        /*retrieve some parameters: */
    10221016        this->parameters->FindParam(&artdiff,ArtDiffEnum);
     
    10311025
    10321026        /*Get normal vector to the surface*/
    1033         nx=(vx_list[0]+vx_list[1]+vx_list[2])/3;
    1034         ny=(vy_list[0]+vy_list[1]+vy_list[2])/3;
     1027        inputs->GetParameterAverage(&nx,VxAverageEnum);
     1028        inputs->GetParameterAverage(&ny,VyAverageEnum);
    10351029        if(nx==0 && ny==0){
    10361030                SurfaceNormal(&surface_normal[0],xyz_list);
     
    10531047
    10541048                //Build K matrix (artificial diffusivity matrix)
    1055                 v_gauss[0]=ONETHIRD*(vx_list[0]+vx_list[1]+vx_list[2]);
    1056                 v_gauss[1]=ONETHIRD*(vy_list[0]+vy_list[1]+vy_list[2]);
     1049                inputs->GetParameterAverage(&v_gauss[0],VxAverageEnum);
     1050                inputs->GetParameterAverage(&v_gauss[1],VyAverageEnum);
    10571051
    10581052                K[0][0]=pow(10,2)*pow(Jdettria,(double).5)/2.0*fabs(v_gauss[0]); //pow should be zero!!
     
    10791073
    10801074                //Get vx, vy and their derivatives at gauss point
    1081                 GetParameterValue(&vx, &vx_list[0],gauss_l1l2l3);
    1082                 GetParameterValue(&vy, &vy_list[0],gauss_l1l2l3);
    1083 
    1084                 GetParameterDerivativeValue(&dvx[0], &vx_list[0],&xyz_list[0][0], gauss_l1l2l3);
    1085                 GetParameterDerivativeValue(&dvy[0], &vy_list[0],&xyz_list[0][0], gauss_l1l2l3);
     1075                inputs->GetParameterValue(&vx,&gauss_l1l2l3[0],VxAverageEnum);
     1076                inputs->GetParameterValue(&vy,&gauss_l1l2l3[0],VyAverageEnum);
     1077
     1078                inputs->GetParameterDerivativeValue(&dvx[0],&xyz_list[0][0],&gauss_l1l2l3[0],VxAverageEnum);
     1079                inputs->GetParameterDerivativeValue(&dvy[0],&xyz_list[0][0],&gauss_l1l2l3[0],VyAverageEnum);
    10861080
    10871081                dvxdx=dvx[0];
     
    16541648        double  gauss_weight;
    16551649        double  gauss_l1l2l3[3];
    1656         double  gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}};
    16571650
    16581651        /* matrices: */
     
    16701663
    16711664        /*input parameters for structural analysis (diagnostic): */
    1672         double  vx_list[numgrids]={0.0};
    1673         double  vy_list[numgrids]={0.0};
    16741665        double  dvx[2];
    16751666        double  dvy[2];
     
    16941685        GetDofList(&doflist[0],&numberofdofspernode);
    16951686
    1696         /*Recover velocity: */
    1697         inputs->GetParameterValues(&vx_list[0],&gaussgrids[0][0],3,VxAverageEnum);
    1698         inputs->GetParameterValues(&vy_list[0],&gaussgrids[0][0],3,VyAverageEnum);
    1699 
    17001687        //Create Artificial diffusivity once for all if requested
    17011688        if(artdiff==1){
     
    17051692
    17061693                //Build K matrix (artificial diffusivity matrix)
    1707                 v_gauss[0]=ONETHIRD*(vx_list[0]+vx_list[1]+vx_list[2]);
    1708                 v_gauss[1]=ONETHIRD*(vy_list[0]+vy_list[1]+vy_list[2]);
     1694                inputs->GetParameterAverage(&v_gauss[0],VxAverageEnum);
     1695                inputs->GetParameterAverage(&v_gauss[1],VyAverageEnum);
    17091696
    17101697                K[0][0]=pow(Jdettria,(double).5)/2.0*fabs(v_gauss[0]);
     
    17431730
    17441731                //Get vx, vy and their derivatives at gauss point
    1745                 GetParameterValue(&vx, &vx_list[0],gauss_l1l2l3);
    1746                 GetParameterValue(&vy, &vy_list[0],gauss_l1l2l3);
    1747 
    1748                 GetParameterDerivativeValue(&dvx[0], &vx_list[0],&xyz_list[0][0], gauss_l1l2l3);
    1749                 GetParameterDerivativeValue(&dvy[0], &vy_list[0],&xyz_list[0][0], gauss_l1l2l3);
     1732                inputs->GetParameterValue(&vx,&gauss_l1l2l3[0],VxAverageEnum);
     1733                inputs->GetParameterValue(&vy,&gauss_l1l2l3[0],VyAverageEnum);
     1734
     1735                inputs->GetParameterDerivativeValue(&dvx[0],&xyz_list[0][0],&gauss_l1l2l3[0],VxAverageEnum);
     1736                inputs->GetParameterDerivativeValue(&dvy[0],&xyz_list[0][0],&gauss_l1l2l3[0],VyAverageEnum);
    17501737
    17511738                dvxdx=dvx[0];
Note: See TracChangeset for help on using the changeset viewer.