Changeset 5862


Ignore:
Timestamp:
09/17/10 08:28:51 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added ElementMatrix for Slope and Prognostic

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

Legend:

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

    r5859 r5862  
    708708                        break;
    709709                case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
    710                         CreateKMatrixSlope( Kgg);
     710                        Ke=CreateKMatrixSlope();
     711                        if(Ke) Ke->AddToGlobal(Kgg,NULL,NULL);
     712                        delete Ke;
    711713                        break;
    712714                case PrognosticAnalysisEnum:
    713                         CreateKMatrixPrognostic( Kgg);
     715                        Ke=CreateKMatrixPrognostic();
     716                        if(Ke) Ke->AddToGlobal(Kgg,NULL,NULL);
     717                        delete Ke;
    714718                        break;
    715719                case BalancedthicknessAnalysisEnum:
     
    28312835/*}}}*/
    28322836/*FUNCTION Penta::CreateKMatrixPrognostic {{{1*/
    2833 void  Penta::CreateKMatrixPrognostic(Mat Kgg){
    2834 
    2835         /*Collapsed formulation: */
    2836         Tria*  tria=NULL;
    2837 
    2838         /*If on water, skip: */
    2839         if(IsOnWater())return;
    2840 
    2841         /*Is this element on the bed? :*/
    2842         if(!IsOnBed())return;
     2837ElementMatrix* Penta::CreateKMatrixPrognostic(void){
     2838
     2839        if (!IsOnBed() || IsOnWater()) return NULL;
    28432840
    28442841        /*Depth Averaging Vx and Vy*/
     
    28462843        this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
    28472844
    2848         /*Spawn Tria element from the base of the Penta: */
    2849         tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    2850         tria->CreateKMatrix(Kgg,NULL,NULL);
     2845        Tria* tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
     2846        ElementMatrix* Ke=tria->CreateKMatrixPrognostic();
    28512847        delete tria->matice; delete tria;
    28522848
     
    28552851        this->inputs->DeleteInput(VyAverageEnum);
    28562852
    2857         return;
    2858 
     2853        /*clean up and return*/
     2854        return Ke;
    28592855}
    28602856/*}}}*/
    28612857/*FUNCTION Penta::CreateKMatrixSlope {{{1*/
    2862 void  Penta::CreateKMatrixSlope(Mat Kgg){
    2863 
    2864         /*Collapsed formulation: */
    2865         Tria*  tria=NULL;
    2866 
    2867         /*If on water, skip: */
    2868         if(IsOnWater())return;
    2869 
    2870         /*Is this element on the bed? :*/
    2871         if(!IsOnBed())return;
    2872 
    2873         /*Spawn Tria element from the base of the Penta: */
    2874         tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    2875         tria->CreateKMatrix(Kgg,NULL,NULL);
     2858ElementMatrix* Penta::CreateKMatrixSlope(void){
     2859
     2860        if (!IsOnBed() || IsOnWater()) return NULL;
     2861
     2862        Tria* tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
     2863        ElementMatrix* Ke=tria->CreateKMatrixSlope();
    28762864        delete tria->matice; delete tria;
    2877         return;
    2878 
     2865
     2866        /*clean up and return*/
     2867        return Ke;
    28792868}
    28802869/*}}}*/
  • issm/trunk/src/c/objects/Elements/Penta.h

    r5859 r5862  
    141141                void      CreateKMatrixDiagnosticVert( Mat Kgg);
    142142                ElementMatrix* CreateKMatrixMelting(void);
    143                 void      CreateKMatrixPrognostic(Mat Kggg);
    144                 void      CreateKMatrixSlope(Mat Kggg);
     143                ElementMatrix* CreateKMatrixPrognostic(void);
     144                ElementMatrix* CreateKMatrixSlope(void);
    145145                void      CreateKMatrixThermal(Mat Kggg);
    146146                void      CreatePVectorBalancedthickness( Vec pg);
Note: See TracChangeset for help on using the changeset viewer.