Ignore:
Timestamp:
08/02/13 15:05:10 (12 years ago)
Author:
Mathieu Morlighem
Message:

NEW: extending P1bubble and P1bubblecondensed to SSA

Location:
issm/trunk-jpl/src/c/classes/Elements
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r15689 r15694  
    456456        }
    457457
    458         /*Add to global matrix*/
    459458        if(Ke){
     459                /*Condense if requested*/
     460                if(this->element_type==MINIcondensedEnum){
     461                        int indices[3]={18,19,20};
     462                        Ke->StaticCondensation(3,&indices[0]);
     463                }
     464
     465                /*Add to global matrix*/
    460466                Ke->AddToGlobal(Kff,Kfs);
    461467                delete Ke;
     
    592598        }
    593599
    594         /*Add to global Vector*/
    595600        if(pe){
     601
     602                /*StaticCondensation if requested*/
     603                if(this->element_type==MINIcondensedEnum){
     604                        int indices[3]={18,19,20};
     605
     606                        this->element_type=MINIEnum;
     607                        ElementMatrix* Ke = CreateKMatrixDiagnosticFS();
     608                        this->element_type=MINIcondensedEnum;
     609
     610                        pe->StaticCondensation(Ke,3,&indices[0]);
     611                        delete Ke;
     612                }
     613
     614                /*Add to global Vector*/
    596615                pe->AddToGlobal(pf);
    597616                delete pe;
     
    11651184                GaussPenta* gauss=new GaussPenta();
    11661185                for(int iv=0;iv<this->NumberofNodes();iv++){
    1167                         gauss->GaussNode(numnodes,iv);
     1186                        gauss->GaussNode(this->element_type,iv);
    11681187                        input->GetInputValue(&pvalue[iv],gauss);
    11691188                }
     
    11881207        GaussPenta* gauss=new GaussPenta();
    11891208        for (int iv=0;iv<this->NumberofNodes();iv++){
    1190                 gauss->GaussNode(numnodes,iv);
     1209                gauss->GaussNode(this->element_type,iv);
    11911210                input->GetInputValue(&pvalue[iv],gauss);
    11921211        }
     
    74297448        Ke =new ElementMatrix(Ke1,Ke2);
    74307449
    7431         /*Condense if requested*/
    7432         if(this->element_type==MINIcondensedEnum){
    7433                 int indices[3]={18,19,20};
    7434                 Ke->StaticCondensation(3,&indices[0]);
    7435         }
    7436 
    74377450        /*clean-up and return*/
    74387451        delete Ke1;
     
    84588471        pe =new ElementVector(pe1,pe2,pe3);
    84598472
    8460         /*Condense if requested*/
    8461         if(this->element_type==MINIcondensedEnum){
    8462                 int indices[3]={18,19,20};
    8463 
    8464                 this->element_type=MINIEnum;
    8465                 ElementMatrix* Ke = CreateKMatrixDiagnosticFS();
    8466                 this->element_type=MINIcondensedEnum;
    8467 
    8468                 pe->StaticCondensation(Ke,3,&indices[0]);
    8469                 delete Ke;
    8470         }
    8471 
    84728473        /*clean-up and return*/
    84738474        delete pe1;
     
    91829183        GaussPenta* gauss=new GaussPenta();
    91839184        for(int i=0;i<numnodes;i++){
    9184                 gauss->GaussNode(numnodes,i);
     9185                gauss->GaussNode(this->element_type,i);
    91859186
    91869187                /*Recover vx and vy*/
     
    93019302        gauss = new GaussPenta();
    93029303        for(int i=0;i<vnumnodes;i++){
    9303                 gauss->GaussNode(vnumnodes,i);
     9304                gauss->GaussNode(this->VelocityInterpolation(),i);
    93049305
    93059306                vx_input->GetInputValue(&vx,gauss);
     
    93119312        }
    93129313        for(int i=0;i<pnumnodes;i++){
    9313                 gauss->GaussNode(pnumnodes,i);
     9314                gauss->GaussNode(this->PressureInterpolation(),i);
    93149315
    93159316                p_input ->GetInputValue(&p ,gauss);
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp

    r15689 r15694  
    19681968}
    19691969/*}}}*/
     1970/*FUNCTION PentaRef::VelocityInterpolation{{{*/
     1971int PentaRef::VelocityInterpolation(void){
     1972
     1973        switch(this->element_type){
     1974                case P1P1Enum:          return P1Enum;
     1975                case P1P1GLSEnum:       return P1Enum;
     1976                case MINIcondensedEnum: return P1bubbleEnum;
     1977                case MINIEnum:          return P1bubbleEnum;
     1978                case TaylorHoodEnum:    return P2Enum;
     1979                default:       _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     1980        }
     1981
     1982        return -1;
     1983}
     1984/*}}}*/
     1985/*FUNCTION PentaRef::PressureInterpolation{{{*/
     1986int PentaRef::PressureInterpolation(void){
     1987
     1988        switch(this->element_type){
     1989                case P1P1Enum:          return P1Enum;
     1990                case P1P1GLSEnum:       return P1Enum;
     1991                case MINIcondensedEnum: return P1Enum;
     1992                case MINIEnum:          return P1Enum;
     1993                case TaylorHoodEnum:    return P1Enum;
     1994                default:       _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     1995        }
     1996
     1997        return -1;
     1998}
     1999/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.h

    r15688 r15694  
    7272                int  NumberofNodesVelocity(void);
    7373                int  NumberofNodesPressure(void);
     74                int  VelocityInterpolation(void);
     75                int  PressureInterpolation(void);
    7476};
    7577#endif
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r15689 r15694  
    231231        }
    232232
    233         /*Add to global matrix*/
    234233        if(Ke){
     234                /*Static condensation if requested*/
     235                if(this->element_type==P1bubblecondensedEnum){
     236                        int size   = nodes[3]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     237                        int offset = 0;
     238                        for(int i=0;i<3;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     239                        int* indices=xNew<int>(size);
     240                        for(int i=0;i<size;i++) indices[i] = offset+i;
     241                        printarray(indices,1,size);
     242                        Ke->StaticCondensation(size,indices);
     243                        xDelete<int>(indices);
     244                }
     245
     246                /*Add to global matrix*/
    235247                Ke->AddToGlobal(Kff,Kfs);
    236248                delete Ke;
     
    346358        /*Add to global Vector*/
    347359        if(pe){
     360                /*Static condensation if requested*/
     361                if(this->element_type==P1bubblecondensedEnum){
     362                        int size   = nodes[3]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     363                        int offset = 0;
     364                        for(int i=0;i<3;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     365                        int* indices=xNew<int>(size);
     366                        for(int i=0;i<size;i++) indices[i] = offset+i;
     367
     368                        this->element_type=P1bubbleEnum;
     369                        ElementMatrix* Ke = CreateKMatrixDiagnosticSSA();
     370                        this->element_type=P1bubblecondensedEnum;
     371
     372                        pe->StaticCondensation(Ke,size,indices);
     373                        xDelete<int>(indices);
     374                        delete Ke;
     375                }
     376
    348377                pe->AddToGlobal(pf);
    349378                delete pe;
     
    11291158                GaussTria* gauss=new GaussTria();
    11301159                for(int iv=0;iv<this->NumberofNodes();iv++){
    1131                         gauss->GaussNode(numnodes,iv);
     1160                        gauss->GaussNode(this->element_type,iv);
    11321161                        input->GetInputValue(&pvalue[iv],gauss);
    11331162                }
     
    11521181        GaussTria* gauss=new GaussTria();
    11531182        for (int iv=0;iv<this->NumberofNodes();iv++){
    1154                 gauss->GaussNode(numnodes,iv);
     1183                gauss->GaussNode(this->element_type,iv);
    11551184                input->GetInputValue(&pvalue[iv],gauss);
    11561185        }
     
    33593388        gauss=new GaussTria();
    33603389        for(int i=0;i<numnodes;i++){
    3361                 gauss->GaussNode(numnodes,i);
     3390                gauss->GaussNode(this->element_type,i);
    33623391
    33633392                /*Recover vx and vy*/
  • issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp

    r15689 r15694  
    444444                        /*bubble*/
    445445                        basis[3]=27.*gauss->coord1*gauss->coord2*gauss->coord3;
     446                        return;
    446447                case P2Enum:
    447448                        /*Corner nodes*/
     
    560561                        dbasis[NUMNODESP1b*1+2] = SQRT3/3.;
    561562                        /*Nodal function 4*/
    562                         dbasis[NUMNODESP1b*0+2] = 27.*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3);;
    563                         dbasis[NUMNODESP1b*1+2] = 27.*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2);
     563                        dbasis[NUMNODESP1b*0+3] = 27.*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3);;
     564                        dbasis[NUMNODESP1b*1+3] = 27.*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2);
    564565                        return;
    565566                case P2Enum:
Note: See TracChangeset for help on using the changeset viewer.