Ignore:
Timestamp:
09/17/10 17:18:54 (15 years ago)
Author:
Mathieu Morlighem
Message:

ElementMatrix in Vert

File:
1 edited

Legend:

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

    r5875 r5877  
    30453045}
    30463046/*}}}*/
    3047 /*FUNCTION Tria::CreateKMatrixDiagnosticSurfaceVert {{{1*/
    3048 void  Tria::CreateKMatrixDiagnosticSurfaceVert(Mat Kgg){
     3047/*FUNCTION Tria::CreateKMatrixDiagnosticVertSurface {{{1*/
     3048ElementMatrix* Tria::CreateKMatrixDiagnosticVertSurface(void){
    30493049
    30503050        /*Constants*/
     
    30593059        double    L[3];
    30603060        GaussTria *gauss=NULL;
    3061 
    3062         /* local element matrices: */
    3063         double Ke_gg[numdof][numdof]={0.0}; //local element stiffness matrix
    3064         double Ke_gg_gaussian[numdof][numdof]; //stiffness matrix evaluated at the gaussian point.
    3065 
    3066         /* Get node coordinates and dof list: */
     3061        double Ke_g[numdof][numdof]; //stiffness matrix evaluated at the gaussian point.
     3062
     3063        /*Initialize Element matrix and return if necessary*/
     3064        if(IsOnWater()) return NULL;
     3065        ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     3066
     3067        /*Retrieve all inputs and parameters*/
    30673068        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    3068         GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
    30693069        SurfaceNormal(&surface_normal[0],xyz_list);
    30703070
     
    30853085                                        &DL_scalar,1,1,0,
    30863086                                        L,1,3,0,
    3087                                         &Ke_gg_gaussian[0][0],0);
    3088 
    3089                 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
    3090         }
    3091 
    3092         MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES);
     3087                                        &Ke_g[0][0],0);
     3088
     3089                for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g[i][j];
     3090        }
    30933091
    30943092        /*Clean up and return*/
    30953093        delete gauss;
    3096         xfree((void**)&doflist);
     3094        return Ke;
    30973095}
    30983096/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.