Changeset 7367


Ignore:
Timestamp:
02/07/11 08:31:58 (14 years ago)
Author:
Eric.Larour
Message:

Covering the case of water elements

File:
1 edited

Legend:

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

    r7323 r7367  
    12431243/*FUNCTION Penta::CreateKMatrixDiagnosticPattyn{{{1*/
    12441244ElementMatrix* Penta::CreateKMatrixDiagnosticPattyn(void){
     1245       
     1246        ElementMatrix* Ke =NULL;
    12451247
    12461248        /*compute all stiffness matrices for this element*/
    12471249        ElementMatrix* Ke1=CreateKMatrixDiagnosticPattynViscous();
    12481250        ElementMatrix* Ke2=CreateKMatrixDiagnosticPattynFriction();
    1249         ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
    1250 
    1251         /*clean-up and return*/
    1252         delete Ke1;
    1253         delete Ke2;
     1251
     1252        if(Ke1 || Ke2){
     1253                 Ke=new ElementMatrix(Ke1,Ke2);
     1254
     1255                /*clean-up and return*/
     1256                delete Ke1;
     1257                delete Ke2;
     1258        }
    12541259        return Ke;
     1260
    12551261}
    12561262/*}}}*/
     
    15161522/*FUNCTION Penta::CreateKMatrixDiagnosticVert {{{1*/
    15171523ElementMatrix* Penta::CreateKMatrixDiagnosticVert(void){
     1524       
     1525        ElementMatrix* Ke =NULL;
    15181526
    15191527        /*compute all stiffness matrices for this element*/
    15201528        ElementMatrix* Ke1=CreateKMatrixDiagnosticVertVolume();
    15211529        ElementMatrix* Ke2=CreateKMatrixDiagnosticVertSurface();
    1522         ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
    1523 
    1524         /*clean-up and return*/
    1525         delete Ke1;
    1526         delete Ke2;
     1530       
     1531        if(Ke1 || Ke2){
     1532                 Ke=new ElementMatrix(Ke1,Ke2);
     1533
     1534                /*clean-up and return*/
     1535                delete Ke1;
     1536                delete Ke2;
     1537        }
    15271538        return Ke;
     1539
    15281540}
    15291541/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.