Changeset 15746


Ignore:
Timestamp:
08/07/13 17:04:40 (12 years ago)
Author:
seroussi
Message:

BUG: condensation only if DiagnosticHoriz

File:
1 edited

Legend:

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

    r15745 r15746  
    401401
    402402        if(Ke){
    403                 int approximation;
    404                 inputs->GetInputValue(&approximation,ApproximationEnum);
    405                 if(approximation==HOFSApproximationEnum){
    406                         //Do nothing condensatino already done for Stokes part
    407                 }
    408                 else{
    409                         /*Condense if requested*/
    410                         if(this->element_type==MINIcondensedEnum){
    411                                 int indices[3]={18,19,20};
    412                                 Ke->StaticCondensation(3,&indices[0]);
     403                int analysis_type;
     404                parameters->FindParam(&analysis_type,AnalysisTypeEnum);
     405                if(analysis_type==DiagnosticHorizAnalysisEnum){
     406                        int approximation;
     407                        inputs->GetInputValue(&approximation,ApproximationEnum);
     408                        if(approximation==HOFSApproximationEnum){
     409                                //Do nothing condensatino already done for Stokes part
    413410                        }
    414                         else if(this->element_type==P1bubblecondensedEnum){
    415                                 int size   = nodes[6]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    416                                 int offset = 0;
    417                                 for(int i=0;i<6;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    418                                 int* indices=xNew<int>(size);
    419                                 for(int i=0;i<size;i++) indices[i] = offset+i;
    420                                 Ke->StaticCondensation(size,indices);
    421                                 xDelete<int>(indices);
     411                        else{
     412                                /*Condense if requested*/
     413                                if(this->element_type==MINIcondensedEnum){
     414                                        int indices[3]={18,19,20};
     415                                        Ke->StaticCondensation(3,&indices[0]);
     416                                }
     417                                else if(this->element_type==P1bubblecondensedEnum){
     418                                        int size   = nodes[6]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     419                                        int offset = 0;
     420                                        for(int i=0;i<6;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     421                                        int* indices=xNew<int>(size);
     422                                        for(int i=0;i<size;i++) indices[i] = offset+i;
     423                                        Ke->StaticCondensation(size,indices);
     424                                        xDelete<int>(indices);
     425                                }
    422426                        }
    423427                }
     
    570574
    571575        if(pe){
    572                 /*StaticCondensation if requested*/
    573                 if(this->element_type==MINIcondensedEnum){
    574                         int approximation;
    575                         inputs->GetInputValue(&approximation,ApproximationEnum);
    576                         if(approximation==HOFSApproximationEnum){
    577                                 //Do nothing, condensation already done in PVectorCoupling
     576                int analysis_type;
     577                parameters->FindParam(&analysis_type,AnalysisTypeEnum);
     578                if(analysis_type==DiagnosticHorizAnalysisEnum){
     579                        /*StaticCondensation if requested*/
     580                        if(this->element_type==MINIcondensedEnum){
     581                                int approximation;
     582                                inputs->GetInputValue(&approximation,ApproximationEnum);
     583                                if(approximation==HOFSApproximationEnum){
     584                                        //Do nothing, condensation already done in PVectorCoupling
     585                                }
     586                                else{
     587                                        int indices[3]={18,19,20};
     588
     589                                        this->element_type=MINIEnum;
     590                                        ElementMatrix* Ke = CreateKMatrixDiagnosticFS();
     591                                        this->element_type=MINIcondensedEnum;
     592
     593                                        pe->StaticCondensation(Ke,3,&indices[0]);
     594                                        delete Ke;
     595                                }
    578596                        }
    579                         else{
    580                                 int indices[3]={18,19,20};
    581 
    582                                 this->element_type=MINIEnum;
    583                                 ElementMatrix* Ke = CreateKMatrixDiagnosticFS();
    584                                 this->element_type=MINIcondensedEnum;
    585 
    586                                 pe->StaticCondensation(Ke,3,&indices[0]);
     597                        else if(this->element_type==P1bubblecondensedEnum){
     598                                int size   = nodes[6]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     599                                int offset = 0;
     600                                for(int i=0;i<6;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     601                                int* indices=xNew<int>(size);
     602                                for(int i=0;i<size;i++) indices[i] = offset+i;
     603
     604                                this->element_type=P1bubbleEnum;
     605                                ElementMatrix* Ke = CreateKMatrix();
     606                                this->element_type=P1bubblecondensedEnum;
     607                                pe->StaticCondensation(Ke,size,indices);
     608                                xDelete<int>(indices);
    587609                                delete Ke;
    588610                        }
    589 
    590                 }
    591                 else if(this->element_type==P1bubblecondensedEnum){
    592                         int size   = nodes[6]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    593                         int offset = 0;
    594                         for(int i=0;i<6;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    595                         int* indices=xNew<int>(size);
    596                         for(int i=0;i<size;i++) indices[i] = offset+i;
    597 
    598                         this->element_type=P1bubbleEnum;
    599                         ElementMatrix* Ke = CreateKMatrix();
    600                         this->element_type=P1bubblecondensedEnum;
    601                         pe->StaticCondensation(Ke,size,indices);
    602                         xDelete<int>(indices);
    603                         delete Ke;
    604611                }
    605612
     
    84408447        delete Ke;
    84418448        ElementVector* pe3=CreatePVectorCouplingHOFS();
    8442         ElementVector* pe =new ElementVector(pe1,pe2);
     8449        ElementVector* pe =new ElementVector(pe1,pe2,pe3);
    84438450
    84448451        /*clean-up and return*/
Note: See TracChangeset for help on using the changeset viewer.