Changeset 5859


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

Added ElementMatrix far Balanced flux 3d

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

Legend:

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

    r5854 r5859  
    714714                        break;
    715715                case BalancedthicknessAnalysisEnum:
    716                         CreateKMatrixBalancedthickness( Kgg);
     716                        Ke=CreateKMatrixBalancedthickness();
     717                        if(Ke) Ke->AddToGlobal(Kgg,NULL,NULL);
     718                        delete Ke;
    717719                        break;
    718720                case BalancedvelocitiesAnalysisEnum:
    719                         CreateKMatrixBalancedvelocities( Kgg);
     721                        Ke=CreateKMatrixBalancedvelocities();
     722                        if(Ke) Ke->AddToGlobal(Kgg,NULL,NULL);
     723                        delete Ke;
    720724                        break;
    721725                case ThermalAnalysisEnum:
     
    19441948/*}}}*/
    19451949/*FUNCTION Penta::CreateKMatrixBalancedthickness {{{1*/
    1946 void  Penta::CreateKMatrixBalancedthickness(Mat Kgg){
    1947 
    1948         /*Collapsed formulation: */
    1949         Tria*  tria=NULL;
    1950 
    1951         /*If on water, skip: */
    1952         if(IsOnWater())return;
    1953 
    1954         /*Is this element on the bed? :*/
    1955         if(!IsOnBed())return;
     1950ElementMatrix* Penta::CreateKMatrixBalancedthickness(void){
     1951
     1952        /*Figure out if this penta is collapsed. If so, then bailout, except if it is at the
     1953          bedrock, in which case we spawn a tria element using the 3 first grids, and use it to build
     1954          the stiffness matrix. */
     1955        if (!IsOnBed() || IsOnWater()) return NULL;
    19561956
    19571957        /*Depth Averaging Vx and Vy*/
     
    19601960
    19611961        /*Spawn Tria element from the base of the Penta: */
    1962         tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    1963         tria->CreateKMatrix(Kgg,NULL,NULL);
     1962        Tria* tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
     1963        ElementMatrix* Ke=tria->CreateKMatrixBalancedthickness();
    19641964        delete tria->matice; delete tria;
    19651965
     
    19681968        this->inputs->DeleteInput(VyAverageEnum);
    19691969
    1970         return;
    1971 
     1970        /*clean up and return*/
     1971        return Ke;
    19721972}
    19731973/*}}}*/
    19741974/*FUNCTION Penta::CreateKMatrixBalancedvelocities {{{1*/
    1975 
    1976 void  Penta::CreateKMatrixBalancedvelocities(Mat Kgg){
    1977 
    1978         /*Collapsed formulation: */
    1979         Tria*  tria=NULL;
    1980 
    1981         /*If on water, skip: */
    1982         if(IsOnWater())return;
    1983 
    1984         /*Is this element on the bed? :*/
    1985         if(!IsOnBed())return;
     1975ElementMatrix* Penta::CreateKMatrixBalancedvelocities(void){
     1976
     1977        /*Figure out if this penta is collapsed. If so, then bailout, except if it is at the
     1978          bedrock, in which case we spawn a tria element using the 3 first grids, and use it to build
     1979          the stiffness matrix. */
     1980        if (!IsOnBed() || IsOnWater()) return NULL;
    19861981
    19871982        /*Depth Averaging Vx and Vy*/
     
    19901985
    19911986        /*Spawn Tria element from the base of the Penta: */
    1992         tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    1993         tria->CreateKMatrix(Kgg,NULL,NULL);
     1987        Tria* tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
     1988        ElementMatrix* Ke=tria->CreateKMatrixBalancedvelocities();
    19941989        delete tria->matice; delete tria;
    19951990
     
    19981993        this->inputs->DeleteInput(VyAverageEnum);
    19991994
    2000         return;
    2001 
     1995        /*clean up and return*/
     1996        return Ke;
    20021997}
    20031998/*}}}*/
  • issm/trunk/src/c/objects/Elements/Penta.h

    r5854 r5859  
    121121                /*Penta specific routines:{{{1*/
    122122                void      BedNormal(double* bed_normal, double xyz_list[3][3]);
    123                 void      CreateKMatrixBalancedthickness(Mat Kggg);
    124                 void      CreateKMatrixBalancedvelocities(Mat Kggg);
     123                ElementMatrix* CreateKMatrixBalancedthickness(void);
     124                ElementMatrix* CreateKMatrixBalancedvelocities(void);
    125125                void      CreateKMatrixCouplingMacAyealPattyn( Mat Kgg);
    126126                void      CreateKMatrixCouplingMacAyealPattynViscous( Mat Kgg);
Note: See TracChangeset for help on using the changeset viewer.