Changeset 5863


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

Added Hutter 3d

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

Legend:

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

    r5862 r5863  
    702702                        break;
    703703                case DiagnosticHutterAnalysisEnum:
    704                         CreateKMatrixDiagnosticHutter( Kgg);
     704                        Ke=CreateKMatrixDiagnosticHutter();
     705                        if(Ke) Ke->AddToGlobal(Kgg,NULL,NULL);
     706                        delete Ke;
    705707                        break;
    706708                case DiagnosticVertAnalysisEnum:
     
    22482250/*}}}*/
    22492251/*FUNCTION Penta::CreateKMatrixDiagnosticHutter{{{1*/
    2250 void  Penta::CreateKMatrixDiagnosticHutter(Mat Kgg){
    2251 
    2252         /*Collapsed formulation: */
    2253         int       i;
    2254         const int numdofs=NDOF2*NUMVERTICES;
    2255         int*      doflist=NULL;
    2256         double    Ke_gg[numdofs][numdofs]={0.0};
     2252ElementMatrix* Penta::CreateKMatrixDiagnosticHutter(void){
     2253
     2254        /*Intermediaries*/
     2255        const int numdof=NDOF2*NUMVERTICES;
    22572256        int       connectivity[2];
    22582257        double    one0,one1;
    2259         int       i0,i1,j0,j1;
    2260        
    2261         /*If on water, skip: */
    2262         if(IsOnWater())return;
    2263 
    2264         GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
     2258        int       i,i0,i1,j0,j1;
     2259
     2260        /*Initialize Element matrix and return if necessary*/
     2261        if(IsOnWater()) return NULL;
     2262        ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
    22652263
    22662264        /*Spawn 3 beam elements: */
     
    22812279                /*Create matrix for these two nodes*/
    22822280                if (IsOnBed() && IsOnSurface()){
    2283                         Ke_gg[i0][i0]=one0;
    2284                         Ke_gg[i1][i1]=one0;
    2285                         Ke_gg[j0][i0]=-one1;
    2286                         Ke_gg[j0][j0]=one1;
    2287                         Ke_gg[j1][i1]=-one1;
    2288                         Ke_gg[j1][j1]=one1;
     2281                        Ke->values[i0*numdof+i0]=one0;
     2282                        Ke->values[i1*numdof+i1]=one0;
     2283                        Ke->values[j0*numdof+i0]=-one1;
     2284                        Ke->values[j0*numdof+j0]=one1;
     2285                        Ke->values[j1*numdof+i1]=-one1;
     2286                        Ke->values[j1*numdof+j1]=one1;
    22892287                }
    22902288                else if (IsOnBed()){
    2291                         Ke_gg[i0][i0]=one0;
    2292                         Ke_gg[i1][i1]=one0;
    2293                         Ke_gg[j0][i0]=-2*one1;
    2294                         Ke_gg[j0][j0]=2*one1;
    2295                         Ke_gg[j1][i1]=-2*one1;
    2296                         Ke_gg[j1][j1]=2*one1;
     2289                        Ke->values[i0*numdof+i0]=one0;
     2290                        Ke->values[i1*numdof+i1]=one0;
     2291                        Ke->values[j0*numdof+i0]=-2*one1;
     2292                        Ke->values[j0*numdof+j0]=2*one1;
     2293                        Ke->values[j1*numdof+i1]=-2*one1;
     2294                        Ke->values[j1*numdof+j1]=2*one1;
    22972295                }
    22982296                else if (IsOnSurface()){
    2299                         Ke_gg[j0][i0]=-one1;
    2300                         Ke_gg[j0][j0]=one1;
    2301                         Ke_gg[j1][i1]=-one1;
    2302                         Ke_gg[j1][j1]=one1;
     2297                        Ke->values[j0*numdof+i0]=-one1;
     2298                        Ke->values[j0*numdof+j0]=one1;
     2299                        Ke->values[j1*numdof+i1]=-one1;
     2300                        Ke->values[j1*numdof+j1]=one1;
    23032301                }
    23042302                else{ //node is on two horizontal layers and beams include the values only once, so the have to use half of the connectivity
    2305                         Ke_gg[j0][i0]=-2*one1;
    2306                         Ke_gg[j0][j0]=2*one1;
    2307                         Ke_gg[j1][i1]=-2*one1;
    2308                         Ke_gg[j1][j1]=2*one1;
    2309                 }
    2310         }
    2311 
    2312         /*Add Ke_gg to global matrix Kgg: */
    2313         MatSetValues(Kgg,numdofs,doflist,numdofs,doflist,(const double*)Ke_gg,ADD_VALUES);
    2314 
    2315         /*Free ressources:*/
    2316         xfree((void**)&doflist);
    2317 
     2303                        Ke->values[j0*numdof+i0]=-2*one1;
     2304                        Ke->values[j0*numdof+j0]=2*one1;
     2305                        Ke->values[j1*numdof+i1]=-2*one1;
     2306                        Ke->values[j1*numdof+j1]=2*one1;
     2307                }
     2308        }
     2309
     2310        /*Clean up and return*/
     2311        return Ke;
    23182312}
    23192313/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyeal2d{{{1*/
  • issm/trunk/src/c/objects/Elements/Penta.h

    r5862 r5863  
    128128                void      CreateKMatrixCouplingPattynStokes( Mat Kgg);
    129129                void      CreateKMatrixDiagnosticHoriz( Mat Kgg);
    130                 void      CreateKMatrixDiagnosticHutter( Mat Kgg);
     130                ElementMatrix* CreateKMatrixDiagnosticHutter(void);
    131131                ElementMatrix* CreateKMatrixDiagnosticMacAyeal2d(void);
    132132                ElementMatrix* CreateKMatrixDiagnosticMacAyeal3d(void);
Note: See TracChangeset for help on using the changeset viewer.