Changeset 5263


Ignore:
Timestamp:
08/13/10 17:41:15 (15 years ago)
Author:
seroussi
Message:

use approximation_enum in KMatrix PVector if appropriate

Location:
issm/trunk/src/c/objects/Elements
Files:
2 edited

Legend:

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

    r5259 r5263  
    21002100
    21012101        /* node data: */
    2102         const int    numgrids=6; // Pattyn numgrids
    2103         const int    numdof=2*numgrids;
    2104         const int    numgrids2=3; //MacAyeal numgrids
    2105         const int    numdof2=2*numgrids2;
    2106         double       xyz_list[numgrids][3];
    2107         int*         doflist=NULL;
    2108         int*         doflist2=NULL;
     2102        const int    numgridsm=3;  //MacAyealnumgrids
     2103        const int    numdofm=2*numgridsm;
     2104        const int    numgridsp=6; //Pattyn numgrids
     2105        const int    numdofp=2*numgridsp;
     2106        double       xyz_list[numgridsp][3];
     2107        int*         doflistm=NULL;
     2108        int*         doflistp=NULL;
    21092109
    21102110        /* 3d gaussian points: */
     
    21422142
    21432143        /* matrices: */
    2144         double B[3][numdof];
    2145         double Bprime[3][numdof2];
    2146         double L[2][numdof];
     2144        double B[3][numdofp];
     2145        double Bprime[3][numdofm];
     2146        double L[2][numdofp];
    21472147        double D[3][3]={0.0};            // material matrix, simple scalar matrix.
    21482148        double D_scalar;
     
    21512151
    21522152        /* local element matrices: */
    2153         double Ke_gg[numdof][numdof2]={0.0}; //local element stiffness matrix
    2154         double Ke_gg_gaussian[numdof][numdof2]; //stiffness matrix evaluated at the gaussian point.
     2153        double Ke_gg[numdofp][numdofm]={0.0}; //local element stiffness matrix
     2154        double Ke_gg_gaussian[numdofp][numdofm]; //stiffness matrix evaluated at the gaussian point.
    21552155        double Jdet;
    21562156
     
    21912191
    21922192        /* Get node coordinates and dof list: */
    2193         GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
    2194         GetDofList(&doflist);  //Pattyn dof list
    2195         GetDofList(&doflist2); //MacAyeal dof list
     2193        GetVerticesCoordinates(&xyz_list[0][0], nodes, numgridsp);
     2194        tria->GetDofList(&doflistm,MacAyealApproximationEnum);  //Pattyn dof list
     2195        GetDofList(&doflistp,PattynApproximationEnum); //MacAyeal dof list
    21962196
    21972197        /*Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore
     
    22512251
    22522252                        /*  Do the triple product tB*D*Bprime: */
    2253                         TripleMultiply( &B[0][0],3,numdof,1,
     2253                        TripleMultiply( &B[0][0],3,numdofp,1,
    22542254                                                &D[0][0],3,3,0,
    2255                                                 &Bprime[0][0],3,numdof2,0,
     2255                                                &Bprime[0][0],3,numdofm,0,
    22562256                                                &Ke_gg_gaussian[0][0],0);
    22572257
    22582258                        /* Add the Ke_gg_gaussian, and optionally Ke_gg_gaussian onto Ke_gg: */
    2259                         for( i=0; i<numdof; i++){
    2260                                 for(j=0;j<numdof2; j++){
     2259                        for( i=0; i<numdofp; i++){
     2260                                for(j=0;j<numdofm; j++){
    22612261                                        Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
    22622262                                }
     
    22672267        /*Add Ke_gg to global matrix Kgg: */
    22682268        // one need to be transposed
    2269         MatSetValues(Kgg,numdof,doflist,numdof2,doflist2,(const double*)Ke_gg,ADD_VALUES);
    2270         MatSetValues(Kgg,numdof2,doflist2,numdof,doflist,(const double*)Ke_gg,ADD_VALUES);
     2269        MatSetValues(Kgg,numdofp,doflistp,numdofm,doflistm,(const double*)Ke_gg,ADD_VALUES);
     2270        MatSetValues(Kgg,numdofm,doflistm,numdofp,doflistp,(const double*)Ke_gg,ADD_VALUES);
    22712271
    22722272        //Deal with 2d friction at the bedrock interface
     
    22932293        xfree((void**)&third_gauss_area_coord2d);
    22942294        xfree((void**)&gauss_weights2d);
    2295         xfree((void**)&doflist);
     2295        xfree((void**)&doflistm);
     2296        xfree((void**)&doflistp);
    22962297}
    22972298/*}}}*/
     
    25242525        /* Get node coordinates and dof list: */
    25252526        GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
    2526         GetDofList(&doflist);
     2527        GetDofList(&doflist,PattynApproximationEnum);
    25272528
    25282529        /*Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore
     
    37533754        /* Get node coordinates and dof list: */
    37543755        GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
    3755         GetDofList(&doflist);
     3756        GetDofList(&doflist,PattynApproximationEnum);
    37563757
    37573758        /*Get gaussian points and weights :*/
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r5259 r5263  
    29272927        /* Get node coordinates and dof list: */
    29282928        GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
    2929         GetDofList(&doflist);
     2929        GetDofList(&doflist,MacAyealApproximationEnum);
    29302930
    29312931        /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
     
    42654265        /* Get node coordinates and dof list: */
    42664266        GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
    4267         GetDofList(&doflist);
     4267        GetDofList(&doflist,MacAyealApproximationEnum);
    42684268
    42694269
Note: See TracChangeset for help on using the changeset viewer.