Changeset 17142


Ignore:
Timestamp:
01/17/14 13:50:57 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: simplifying Nodalfunctions Velocity and Pressure

File:
1 edited

Legend:

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

    r17099 r17142  
    320320        /*This routine returns the values of the nodal functions  at the gaussian point.*/
    321321
    322         switch(this->element_type){
    323                 case P1P1Enum:
    324                         this->element_type = P1Enum;
    325                         this->GetNodalFunctions(basis,gauss);
    326                         this->element_type = P1P1Enum;
    327                         return;
    328                 case P1P1GLSEnum:
    329                         this->element_type = P1Enum;
    330                         this->GetNodalFunctions(basis,gauss);
    331                         this->element_type = P1P1GLSEnum;
    332                         return;
    333                 case MINIcondensedEnum:
    334                         this->element_type = P1bubbleEnum;
    335                         this->GetNodalFunctions(basis,gauss);
    336                         this->element_type = MINIcondensedEnum;
    337                         return;
    338                 case MINIEnum:
    339                         this->element_type = P1bubbleEnum;
    340                         this->GetNodalFunctions(basis,gauss);
    341                         this->element_type = MINIEnum;
    342                         return;
    343                 case TaylorHoodEnum:
    344                         this->element_type = P2Enum;
    345                         this->GetNodalFunctions(basis,gauss);
    346                         this->element_type = TaylorHoodEnum;
    347                         return;
    348                 case OneLayerP4zEnum:
    349                         this->element_type = P2xP4Enum;
    350                         this->GetNodalFunctions(basis,gauss);
    351                         this->element_type = OneLayerP4zEnum;
    352                         return;
    353                 default:
    354                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    355         }
     322        int save = this->element_type;
     323        this->element_type = VelocityInterpolation();
     324        this->GetNodalFunctions(basis,gauss);
     325        this->element_type = save;
     326
    356327}
    357328/*}}}*/
     
    360331        /*This routine returns the values of the nodal functions  at the gaussian point.*/
    361332
    362         switch(this->element_type){
    363                 case P1P1Enum:
    364                         this->element_type = P1Enum;
    365                         this->GetNodalFunctions(basis,gauss);
    366                         this->element_type = P1P1Enum;
    367                         return;
    368                 case P1P1GLSEnum:
    369                         this->element_type = P1Enum;
    370                         this->GetNodalFunctions(basis,gauss);
    371                         this->element_type = P1P1GLSEnum;
    372                         return;
    373                 case MINIcondensedEnum:
    374                         this->element_type = P1Enum;
    375                         this->GetNodalFunctions(basis,gauss);
    376                         this->element_type = MINIcondensedEnum;
    377                         return;
    378                 case MINIEnum:
    379                         this->element_type = P1Enum;
    380                         this->GetNodalFunctions(basis,gauss);
    381                         this->element_type = MINIEnum;
    382                         return;
    383                 case TaylorHoodEnum:
    384                         this->element_type = P1Enum;
    385                         this->GetNodalFunctions(basis,gauss);
    386                         this->element_type = TaylorHoodEnum;
    387                         return;
    388                 case OneLayerP4zEnum:
    389                         this->element_type = P1xP3Enum;
    390                         this->GetNodalFunctions(basis,gauss);
    391                         this->element_type = OneLayerP4zEnum;
    392                         return;
    393                 default:
    394                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    395         }
     333        int save = this->element_type;
     334        this->element_type = PressureInterpolation();
     335        this->GetNodalFunctions(basis,gauss);
     336        this->element_type = save;
     337
    396338}
    397339/*}}}*/
     
    433375/*FUNCTION PentaRef::GetNodalFunctionsDerivativesVelocity{{{*/
    434376void PentaRef::GetNodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){
    435         switch(this->element_type){
    436                 case P1P1Enum:
    437                         this->element_type = P1Enum;
    438                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    439                         this->element_type = P1P1Enum;
    440                         return;
    441                 case P1P1GLSEnum:
    442                         this->element_type = P1Enum;
    443                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    444                         this->element_type = P1P1GLSEnum;
    445                         return;
    446                 case MINIcondensedEnum:
    447                         this->element_type = P1bubbleEnum;
    448                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    449                         this->element_type = MINIcondensedEnum;
    450                         return;
    451                 case MINIEnum:
    452                         this->element_type = P1bubbleEnum;
    453                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    454                         this->element_type = MINIEnum;
    455                         return;
    456                 case TaylorHoodEnum:
    457                         this->element_type = P2Enum;
    458                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    459                         this->element_type = TaylorHoodEnum;
    460                         return;
    461                 case OneLayerP4zEnum:
    462                         this->element_type = P2xP4Enum;
    463                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    464                         this->element_type = OneLayerP4zEnum;
    465                         return;
    466                 default:
    467                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    468         }
     377
     378        int save = this->element_type;
     379        this->element_type = VelocityInterpolation();
     380        this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
     381        this->element_type = save;
     382
    469383}
    470384/*}}}*/
    471385/*FUNCTION PentaRef::GetNodalFunctionsDerivativesPressure{{{*/
    472386void PentaRef::GetNodalFunctionsDerivativesPressure(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){
    473         switch(this->element_type){
    474                 case P1P1Enum:
    475                         this->element_type = P1Enum;
    476                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    477                         this->element_type = P1P1Enum;
    478                         return;
    479                 case P1P1GLSEnum:
    480                         this->element_type = P1Enum;
    481                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    482                         this->element_type = P1P1GLSEnum;
    483                         return;
    484                 case MINIcondensedEnum:
    485                         this->element_type = P1Enum;
    486                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    487                         this->element_type = MINIcondensedEnum;
    488                         return;
    489                 case MINIEnum:
    490                         this->element_type = P1Enum;
    491                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    492                         this->element_type = MINIEnum;
    493                         return;
    494                 case TaylorHoodEnum:
    495                         this->element_type = P1Enum;
    496                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    497                         this->element_type = TaylorHoodEnum;
    498                         return;
    499                 default:
    500                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    501         }
     387
     388        int save = this->element_type;
     389        this->element_type = PressureInterpolation();
     390        this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
     391        this->element_type = save;
    502392}
    503393/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.