Changeset 17491


Ignore:
Timestamp:
03/20/14 05:28:30 (11 years ago)
Author:
Mathieu Morlighem
Message:

NEW: done with Tetra P1bubblecondensed

File:
1 edited

Legend:

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

    r17490 r17491  
    580580void Tetra::ReduceMatrices(ElementMatrix* Ke,ElementVector* pe){
    581581
    582         int analysis_type;
    583         parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    584 
    585582        if(pe){
    586                 if(analysis_type==StressbalanceAnalysisEnum){
    587                         if(this->element_type==MINIcondensedEnum){
    588                                 int approximation;
    589                                 inputs->GetInputValue(&approximation,ApproximationEnum);
    590                                 if(approximation==HOFSApproximationEnum || approximation==SSAFSApproximationEnum){
    591                                         //Do nothing, condensation already done in PVectorCoupling
    592                                 }
    593                                 else{
    594                                         _error_("Not implemented");
    595                                 }
    596                         }
    597                         else if(this->element_type==P1bubblecondensedEnum){
    598                                 _error_("Not implemented");
    599                         }
     583                if(this->element_type==MINIcondensedEnum){
     584                        _error_("Not implemented");
     585                }
     586                else if(this->element_type==P1bubblecondensedEnum){
     587                        int size   = nodes[4]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     588                        int offset = 0;
     589                        for(int i=0;i<4;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     590                        int* indices=xNew<int>(size);
     591                        for(int i=0;i<size;i++) indices[i] = offset+i;
     592                        pe->StaticCondensation(Ke,size,indices);
     593                        xDelete<int>(indices);
    600594                }
    601595        }
    602596
    603597        if(Ke){
    604                 if(analysis_type==StressbalanceAnalysisEnum){
    605                         int approximation;
    606                         inputs->GetInputValue(&approximation,ApproximationEnum);
    607                         if(approximation==HOFSApproximationEnum || approximation==SSAFSApproximationEnum){
    608                                 //Do nothing condensatino already done for Stokes part
    609                         }
    610                         else{
    611                                 if(this->element_type==MINIcondensedEnum){
    612                                         _error_("Not implemented");
    613                                 }
    614                                 else if(this->element_type==P1bubblecondensedEnum){
    615                                         _error_("Not implemented");
    616                                 }
    617                         }
     598                if(this->element_type==MINIcondensedEnum){
     599                        _error_("Not implemented");
     600                }
     601                else if(this->element_type==P1bubblecondensedEnum){
     602                        int size   = nodes[4]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     603                        int offset = 0;
     604                        for(int i=0;i<4;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
     605                        int* indices=xNew<int>(size);
     606                        for(int i=0;i<size;i++) indices[i] = offset+i;
     607                        Ke->StaticCondensation(size,indices);
     608                        xDelete<int>(indices);
    618609                }
    619610        }
Note: See TracChangeset for help on using the changeset viewer.