Changeset 17874


Ignore:
Timestamp:
04/29/14 10:12:30 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: simplifying velocity and pressure nodal functions

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Element.h

    r17862 r17874  
    242242                virtual int    VelocityInterpolation()=0;
    243243                virtual int    PressureInterpolation()=0;
     244                virtual int    TensorInterpolation()=0;
    244245                virtual bool   IsZeroLevelset(int levelset_enum)=0;
    245246                virtual bool   IsIcefront(void)=0;
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r17862 r17874  
    467467/*FUNCTION Penta::Delta18oParameterization{{{*/
    468468void  Penta::Delta18oParameterization(void){
    469         /*Are we on the base? If not, return*/
    470         if(!IsOnBase()) return;
     469
     470        /*Are we on the base? If not, return*/
     471        if(!IsOnBase()) return;
    471472
    472473        int        i;
     
    18501851
    18511852        _assert_(gauss->Enum()==GaussPentaEnum);
    1852         this->GetNodalFunctionsDerivativesVelocity(dbasis,xyz_list,(GaussPenta*)gauss);
     1853        this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussPenta*)gauss,this->VelocityInterpolation());
    18531854
    18541855}
     
    18581859
    18591860        _assert_(gauss->Enum()==GaussPentaEnum);
    1860         this->GetNodalFunctionsVelocity(basis,(GaussPenta*)gauss);
     1861        this->GetNodalFunctions(basis,(GaussPenta*)gauss,this->VelocityInterpolation());
    18611862
    18621863}
     
    18661867
    18671868        _assert_(gauss->Enum()==GaussPentaEnum);
    1868         this->GetNodalFunctionsPressure(basis,(GaussPenta*)gauss);
     1869        this->GetNodalFunctions(basis,(GaussPenta*)gauss,this->PressureInterpolation());
    18691870
    18701871}
     
    18741875
    18751876        _assert_(gauss->Enum()==GaussPentaEnum);
    1876         this->GetNodalFunctionsTensor(basis,(GaussPenta*)gauss);
     1877        this->GetNodalFunctions(basis,(GaussPenta*)gauss,this->TensorInterpolation());
    18771878
    18781879}
  • issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r17862 r17874  
    9292                int    VelocityInterpolation();
    9393                int    PressureInterpolation();
     94                int    TensorInterpolation(){_error_("not implemented yet");};
    9495                bool   IsZeroLevelset(int levelset_enum);
    9596                bool   IsIcefront(void);
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp

    r17795 r17874  
    328328                        return;
    329329                default:
    330                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     330                        _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
    331331        }
    332332}
    333333/*}}}*/
    334 /*FUNCTION PentaRef::GetNodalFunctionsVelocity{{{*/
    335 void PentaRef::GetNodalFunctionsVelocity(IssmDouble* basis,Gauss* gauss){
    336         /*This routine returns the values of the nodal functions  at the gaussian point.*/
    337 
    338         int save = this->element_type;
    339         this->element_type = VelocityInterpolation();
    340         this->GetNodalFunctions(basis,gauss);
    341         this->element_type = save;
    342 
    343 }
    344 /*}}}*/
    345 /*FUNCTION PentaRef::GetNodalFunctionsPressure{{{*/
    346 void PentaRef::GetNodalFunctionsPressure(IssmDouble* basis,Gauss* gauss){
    347         /*This routine returns the values of the nodal functions  at the gaussian point.*/
    348 
    349         int save = this->element_type;
    350         this->element_type = PressureInterpolation();
    351         this->GetNodalFunctions(basis,gauss);
    352         this->element_type = save;
    353 
    354 }
    355 /*}}}*/
    356 /*FUNCTION PentaRef::GetNodalFunctionsTensor{{{*/
    357 void PentaRef::GetNodalFunctionsTensor(IssmDouble* basis,Gauss* gauss){
    358         /*This routine returns the values of the nodal functions  at the gaussian point.*/
    359 
    360         int save = this->element_type;
    361         this->element_type = TensorInterpolation();
    362         this->GetNodalFunctions(basis,gauss);
    363         this->element_type = save;
    364 
    365 }
    366 /*}}}*/
    367 /*FUNCTION PentaRef::GetNodalFunctionsDerivatives{{{*/
     334/*FUNCTION PentaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){{{*/
    368335void PentaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){
     336        GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss,this->element_type);
     337}
     338/*}}}*/
     339/*FUNCTION PentaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss,int finiteelement){{{*/
     340void PentaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss,int finiteelement){
    369341
    370342        /*This routine returns the values of the nodal functions derivatives  (with respect to the
     
    373345
    374346        /*Fetch number of nodes for this finite element*/
    375         int numnodes = this->NumberofNodes();
     347        int numnodes = this->NumberofNodes(finiteelement);
    376348
    377349        /*Get nodal functions derivatives in reference triangle*/
    378350        IssmDouble* dbasis_ref=xNew<IssmDouble>(3*numnodes);
    379         GetNodalFunctionsDerivativesReference(dbasis_ref,gauss);
     351        GetNodalFunctionsDerivativesReference(dbasis_ref,gauss,finiteelement);
    380352
    381353        /*Get Jacobian invert: */
     
    397369        /*Clean up*/
    398370        xDelete<IssmDouble>(dbasis_ref);
    399 
    400 }
    401 /*}}}*/
    402 /*FUNCTION PentaRef::GetNodalFunctionsDerivativesVelocity{{{*/
    403 void PentaRef::GetNodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){
    404 
    405         int save = this->element_type;
    406         this->element_type = VelocityInterpolation();
    407         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    408         this->element_type = save;
    409 
    410 }
    411 /*}}}*/
    412 /*FUNCTION PentaRef::GetNodalFunctionsDerivativesPressure{{{*/
    413 void PentaRef::GetNodalFunctionsDerivativesPressure(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){
    414 
    415         int save = this->element_type;
    416         this->element_type = PressureInterpolation();
    417         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    418         this->element_type = save;
    419 }
    420 /*}}}*/
    421 /*FUNCTION PentaRef::GetNodalFunctionsDerivativesReference{{{*/
    422 void PentaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss_in){
     371}
     372/*}}}*/
     373/*FUNCTION PentaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss){{{*/
     374void PentaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss){
     375        GetNodalFunctionsDerivativesReference(dbasis,gauss,this->element_type);
     376}
     377/*}}}*/
     378/*FUNCTION PentaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss_in,int finiteelement){{{*/
     379void PentaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss_in,int finiteelement){
    423380
    424381        /*This routine returns the values of the nodal functions derivatives  (with respect to the
     
    434391        IssmDouble zeta=gauss->coord4;
    435392
    436         switch(this->element_type){
     393        switch(finiteelement){
    437394                case P0Enum:
    438395                        /*Zero derivative*/
     
    837794                        return;
    838795                default:
    839                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     796                        _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
    840797        }
    841798
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.h

    r17536 r17874  
    2424                void GetNodalFunctions(IssmDouble* basis, Gauss* gauss);
    2525                void GetNodalFunctions(IssmDouble* basis, Gauss* gauss,int finiteelement);
    26                 void GetNodalFunctionsVelocity(IssmDouble* basis, Gauss* gauss);
    27                 void GetNodalFunctionsPressure(IssmDouble* basis, Gauss* gauss);
    28                 void GetNodalFunctionsTensor(IssmDouble* basis, Gauss* gauss);
    2926                void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
    30                 void GetNodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
    31                 void GetNodalFunctionsDerivativesPressure(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
     27                void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss,int finiteelement);
    3228                void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss);
     29                void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss,int finiteelement);
    3330                void GetNodalFunctionsP1(IssmDouble* l1l6, Gauss* gauss);
    3431                void GetNodalFunctionsMINI(IssmDouble* l1l7, Gauss* gauss);
  • issm/trunk-jpl/src/c/classes/Elements/Seg.h

    r17862 r17874  
    105105                void        ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
    106106                int         VelocityInterpolation(void){_error_("not implemented yet");};
     107                int         TensorInterpolation(void){_error_("not implemented yet");};
    107108                void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
    108109                IssmDouble  GetGroundedPortion(IssmDouble* xyz_list){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/Elements/SegRef.cpp

    r17623 r17874  
    9191        _assert_(basis);
    9292
    93         switch(element_type){
     93        switch(finiteelement){
    9494                case P0Enum:
    9595                        basis[0]=1.;
     
    105105                        return;
    106106                default:
    107                         _error_("Element type "<<EnumToStringx(element_type)<<" not supported yet");
     107                        _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
    108108        }
    109109}
     
    179179                        return;
    180180                default:
    181                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     181                        _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
    182182        }
    183183
  • issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp

    r17852 r17874  
    590590
    591591        _assert_(gauss->Enum()==GaussTetraEnum);
    592         this->GetNodalFunctionsVelocity(basis,(GaussTetra*)gauss);
     592        this->GetNodalFunctions(basis,(GaussTetra*)gauss,this->VelocityInterpolation());
    593593
    594594}
     
    598598
    599599        _assert_(gauss->Enum()==GaussTetraEnum);
    600         this->GetNodalFunctionsPressure(basis,(GaussTetra*)gauss);
     600        this->GetNodalFunctions(basis,(GaussTetra*)gauss,this->PressureInterpolation());
    601601
    602602}
     
    606606
    607607        _assert_(gauss->Enum()==GaussTetraEnum);
    608         this->GetNodalFunctionsTensor(basis,(GaussTetra*)gauss);
     608        this->GetNodalFunctions(basis,(GaussTetra*)gauss,this->TensorInterpolation());
    609609
    610610}
     
    622622
    623623        _assert_(gauss->Enum()==GaussTetraEnum);
    624         this->GetNodalFunctionsDerivativesVelocity(dbasis,xyz_list,(GaussTetra*)gauss);
     624        this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussTetra*)gauss,this->VelocityInterpolation());
    625625
    626626}
     
    992992}
    993993/*}}}*/
     994/*FUNCTION Tetra::TensorInterpolation{{{*/
     995int Tetra::TensorInterpolation(void){
     996        return TetraRef::TensorInterpolation();
     997}
     998/*}}}*/
    994999/*FUNCTION Tetra::ZeroLevelsetCoordinates{{{*/
    9951000void Tetra::ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){
  • issm/trunk-jpl/src/c/classes/Elements/Tetra.h

    r17862 r17874  
    110110                void        ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
    111111                int         VelocityInterpolation(void);
     112                int         TensorInterpolation(void);
    112113                void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
    113114                IssmDouble  GetGroundedPortion(IssmDouble* xyz_list){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/Elements/TetraRef.cpp

    r17690 r17874  
    9898                        return;
    9999                default:
    100                         _error_("Element type "<<EnumToStringx(element_type)<<" not supported yet");
    101         }
    102 }
    103 /*}}}*/
    104 /*FUNCTION TetraRef::GetNodalFunctionsVelocity{{{*/
    105 void TetraRef::GetNodalFunctionsVelocity(IssmDouble* basis,GaussTetra* gauss){
    106         /*This routine returns the values of the nodal functions  at the gaussian point.*/
    107 
    108         switch(this->element_type){
    109                 case P1P1Enum:
    110                         this->element_type = P1Enum;
    111                         this->GetNodalFunctions(basis,gauss);
    112                         this->element_type = P1P1Enum;
    113                         return;
    114                 case P1P1GLSEnum:
    115                         this->element_type = P1Enum;
    116                         this->GetNodalFunctions(basis,gauss);
    117                         this->element_type = P1P1GLSEnum;
    118                         return;
    119                 case MINIcondensedEnum:
    120                         this->element_type = P1bubbleEnum;
    121                         this->GetNodalFunctions(basis,gauss);
    122                         this->element_type = MINIcondensedEnum;
    123                         return;
    124                 case MINIEnum:
    125                         this->element_type = P1bubbleEnum;
    126                         this->GetNodalFunctions(basis,gauss);
    127                         this->element_type = MINIEnum;
    128                         return;
    129                 case TaylorHoodEnum:
    130                         this->element_type = P2Enum;
    131                         this->GetNodalFunctions(basis,gauss);
    132                         this->element_type = TaylorHoodEnum;
    133                         return;
    134                 default:
    135                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    136         }
    137 }
    138 /*}}}*/
    139 /*FUNCTION TetraRef::GetNodalFunctionsPressure{{{*/
    140 void TetraRef::GetNodalFunctionsPressure(IssmDouble* basis,GaussTetra* gauss){
    141         /*This routine returns the values of the nodal functions  at the gaussian point.*/
    142 
    143         switch(this->element_type){
    144                 case P1P1Enum:
    145                         this->element_type = P1Enum;
    146                         this->GetNodalFunctions(basis,gauss);
    147                         this->element_type = P1P1Enum;
    148                         return;
    149                 case P1P1GLSEnum:
    150                         this->element_type = P1Enum;
    151                         this->GetNodalFunctions(basis,gauss);
    152                         this->element_type = P1P1GLSEnum;
    153                         return;
    154                 case MINIcondensedEnum:
    155                         this->element_type = P1Enum;
    156                         this->GetNodalFunctions(basis,gauss);
    157                         this->element_type = MINIcondensedEnum;
    158                         return;
    159                 case MINIEnum:
    160                         this->element_type = P1Enum;
    161                         this->GetNodalFunctions(basis,gauss);
    162                         this->element_type = MINIEnum;
    163                         return;
    164                 case TaylorHoodEnum:
    165                         this->element_type = P1Enum;
    166                         this->GetNodalFunctions(basis,gauss);
    167                         this->element_type = TaylorHoodEnum;
    168                         return;
    169                 default:
    170                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    171         }
    172 }
    173 /*}}}*/
    174 /*FUNCTION TetraRef::GetNodalFunctionsTensor{{{*/
    175 void TetraRef::GetNodalFunctionsTensor(IssmDouble* basis,GaussTetra* gauss){
    176         /*This routine returns the values of the nodal functions  at the gaussian point.*/
    177 
    178         switch(this->element_type){
    179                 case XTaylorHoodEnum:
    180                         this->element_type = P1DGEnum;
    181                         this->GetNodalFunctions(basis,gauss);
    182                         this->element_type = XTaylorHoodEnum;
    183                         return;
    184                 default:
    185                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     100                        _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
    186101        }
    187102}
     
    226141}
    227142/*}}}*/
    228 /*FUNCTION TetraRef::GetNodalFunctionsDerivativesPressure         (THIS ONE and following ones){{{*/
    229 void TetraRef::GetNodalFunctionsDerivativesPressure(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss){
    230         switch(this->element_type){
    231                 case P1P1Enum:
    232                         this->element_type = P1Enum;
    233                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    234                         this->element_type = P1P1Enum;
    235                         return;
    236                 case P1P1GLSEnum:
    237                         this->element_type = P1Enum;
    238                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    239                         this->element_type = P1P1GLSEnum;
    240                         return;
    241                 case MINIcondensedEnum:
    242                         this->element_type = P1Enum;
    243                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    244                         this->element_type = MINIcondensedEnum;
    245                         return;
    246                 case MINIEnum:
    247                         this->element_type = P1Enum;
    248                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    249                         this->element_type = MINIEnum;
    250                         return;
    251                 case TaylorHoodEnum:
    252                         this->element_type = P1Enum;
    253                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    254                         this->element_type = TaylorHoodEnum;
    255                         return;
    256                 default:
    257                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    258         }
    259 }
    260 /*}}}*/
    261 /*FUNCTION TetraRef::GetNodalFunctionsDerivativesVelocity{{{*/
    262 void TetraRef::GetNodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss){
    263         switch(this->element_type){
    264                 case P1P1Enum:
    265                         this->element_type = P1Enum;
    266                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    267                         this->element_type = P1P1Enum;
    268                         return;
    269                 case P1P1GLSEnum:
    270                         this->element_type = P1Enum;
    271                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    272                         this->element_type = P1P1GLSEnum;
    273                         return;
    274                 case MINIcondensedEnum:
    275                         this->element_type = P1bubbleEnum;
    276                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    277                         this->element_type = MINIcondensedEnum;
    278                         return;
    279                 case MINIEnum:
    280                         this->element_type = P1bubbleEnum;
    281                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    282                         this->element_type = MINIEnum;
    283                         return;
    284                 case TaylorHoodEnum:
    285                         this->element_type = P2Enum;
    286                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    287                         this->element_type = TaylorHoodEnum;
    288                         return;
    289                 default:
    290                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    291         }
    292 }
    293 /*}}}*/
    294143/*FUNCTION TetraRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss){{{*/
    295144void TetraRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss){
     
    395244                        return;
    396245                default:
    397                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     246                        _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
    398247        }
    399248
     
    629478
    630479        return -1;
    631 }
    632 /*}}}*/
     480}/*}}}*/
     481/*FUNCTION TetraRef::TensorInterpolation{{{*/
     482int TetraRef::TensorInterpolation(void){
     483        /*This routine returns the values of the nodal functions  at the gaussian point.*/
     484
     485        switch(this->element_type){
     486                case XTaylorHoodEnum: return P1DGEnum;
     487                default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     488        }
     489}
     490/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/TetraRef.h

    r17536 r17874  
    2929                void GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss);
    3030                void GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss,int finiteelement);
    31                 void GetNodalFunctionsVelocity(IssmDouble* basis, GaussTetra* gauss);
    32                 void GetNodalFunctionsPressure(IssmDouble* basis, GaussTetra* gauss);
    33                 void GetNodalFunctionsTensor(IssmDouble* basis, GaussTetra* gauss);
    3431                void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss);
    3532                void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss,int finiteelement);
    36                 void GetNodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,GaussTetra* gauss);
    37                 void GetNodalFunctionsDerivativesPressure(IssmDouble* dbasis,IssmDouble* xyz_list,GaussTetra* gauss);
    3833                void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss);
    3934                void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss,int finiteelement);
     
    4843                int  VelocityInterpolation(void);
    4944                int  PressureInterpolation(void);
     45                int  TensorInterpolation(void);
    5046};
    5147#endif
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r17863 r17874  
    15971597
    15981598        _assert_(gauss->Enum()==GaussTriaEnum);
    1599         this->GetNodalFunctionsDerivativesVelocity(dbasis,xyz_list,(GaussTria*)gauss);
     1599        this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussTria*)gauss,this->VelocityInterpolation());
    16001600
    16011601}
     
    16051605
    16061606        _assert_(gauss->Enum()==GaussTriaEnum);
    1607         this->GetNodalFunctionsVelocity(basis,(GaussTria*)gauss);
     1607        this->GetNodalFunctions(basis,(GaussTria*)gauss,this->VelocityInterpolation());
    16081608
    16091609}
     
    16131613
    16141614        _assert_(gauss->Enum()==GaussTriaEnum);
    1615         this->GetNodalFunctionsPressure(basis,(GaussTria*)gauss);
     1615        this->GetNodalFunctions(basis,(GaussTria*)gauss,this->PressureInterpolation());
    16161616
    16171617}
     
    16211621
    16221622        _assert_(gauss->Enum()==GaussTriaEnum);
    1623         this->GetNodalFunctionsTensor(basis,(GaussTria*)gauss);
     1623        this->GetNodalFunctions(basis,(GaussTria*)gauss,this->TensorInterpolation());
    16241624
    16251625}
     
    17021702int Tria::PressureInterpolation(void){
    17031703        return TriaRef::PressureInterpolation();
     1704}
     1705/*}}}*/
     1706/*FUNCTION Tria::TensorInterpolation{{{*/
     1707int Tria::TensorInterpolation(void){
     1708        return TriaRef::TensorInterpolation();
    17041709}
    17051710/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/Tria.h

    r17862 r17874  
    100100                int         VelocityInterpolation();
    101101                int         PressureInterpolation();
     102                int         TensorInterpolation();
    102103                IssmDouble  SurfaceArea(void);
    103104                void        Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finitelement);
  • issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp

    r17549 r17874  
    212212                        return;
    213213                default:
    214                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    215         }
    216 }
    217 /*}}}*/
    218 /*FUNCTION TriaRef::GetNodalFunctionsVelocity{{{*/
    219 void TriaRef::GetNodalFunctionsVelocity(IssmDouble* basis,Gauss* gauss){
    220         /*This routine returns the values of the nodal functions  at the gaussian point.*/
    221 
    222         switch(this->element_type){
    223                 case P1P1Enum:
    224                         this->element_type = P1Enum;
    225                         this->GetNodalFunctions(basis,gauss);
    226                         this->element_type = P1P1Enum;
    227                         return;
    228                 case P1P1GLSEnum:
    229                         this->element_type = P1Enum;
    230                         this->GetNodalFunctions(basis,gauss);
    231                         this->element_type = P1P1GLSEnum;
    232                         return;
    233                 case MINIcondensedEnum:
    234                         this->element_type = P1bubbleEnum;
    235                         this->GetNodalFunctions(basis,gauss);
    236                         this->element_type = MINIcondensedEnum;
    237                         return;
    238                 case MINIEnum:
    239                         this->element_type = P1bubbleEnum;
    240                         this->GetNodalFunctions(basis,gauss);
    241                         this->element_type = MINIEnum;
    242                         return;
    243                 case TaylorHoodEnum:
    244                         this->element_type = P2Enum;
    245                         this->GetNodalFunctions(basis,gauss);
    246                         this->element_type = TaylorHoodEnum;
    247                         return;
    248                 case XTaylorHoodEnum:
    249                         this->element_type = P2Enum;
    250                         this->GetNodalFunctions(basis,gauss);
    251                         this->element_type = XTaylorHoodEnum;
    252                         return;
    253                 default:
    254                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    255         }
    256 }
    257 /*}}}*/
    258 /*FUNCTION TriaRef::GetNodalFunctionsPressure{{{*/
    259 void TriaRef::GetNodalFunctionsPressure(IssmDouble* basis,Gauss* gauss){
    260         /*This routine returns the values of the nodal functions  at the gaussian point.*/
    261 
    262         switch(this->element_type){
    263                 case P1P1Enum:
    264                         this->element_type = P1Enum;
    265                         this->GetNodalFunctions(basis,gauss);
    266                         this->element_type = P1P1Enum;
    267                         return;
    268                 case P1P1GLSEnum:
    269                         this->element_type = P1Enum;
    270                         this->GetNodalFunctions(basis,gauss);
    271                         this->element_type = P1P1GLSEnum;
    272                         return;
    273                 case MINIcondensedEnum:
    274                         this->element_type = P1Enum;
    275                         this->GetNodalFunctions(basis,gauss);
    276                         this->element_type = MINIcondensedEnum;
    277                         return;
    278                 case MINIEnum:
    279                         this->element_type = P1Enum;
    280                         this->GetNodalFunctions(basis,gauss);
    281                         this->element_type = MINIEnum;
    282                         return;
    283                 case TaylorHoodEnum:
    284                         this->element_type = P1Enum;
    285                         this->GetNodalFunctions(basis,gauss);
    286                         this->element_type = TaylorHoodEnum;
    287                         return;
    288                 case XTaylorHoodEnum:
    289                         this->element_type = P1Enum;
    290                         this->GetNodalFunctions(basis,gauss);
    291                         this->element_type = XTaylorHoodEnum;
    292                         return;
    293                 default:
    294                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    295         }
    296 }
    297 /*}}}*/
    298 /*FUNCTION TriaRef::GetNodalFunctionsTensor{{{*/
    299 void TriaRef::GetNodalFunctionsTensor(IssmDouble* basis,Gauss* gauss){
    300         /*This routine returns the values of the nodal functions  at the gaussian point.*/
    301 
    302         switch(this->element_type){
    303                 case XTaylorHoodEnum:
    304                         this->element_type = P1DGEnum;
    305                         this->GetNodalFunctions(basis,gauss);
    306                         this->element_type = XTaylorHoodEnum;
    307                         return;
    308                 default:
    309                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     214                        _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
    310215        }
    311216}
     
    387292        xDelete<IssmDouble>(dbasis_ref);
    388293
    389 }
    390 /*}}}*/
    391 /*FUNCTION TriaRef::GetNodalFunctionsDerivativesPressure{{{*/
    392 void TriaRef::GetNodalFunctionsDerivativesPressure(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){
    393         switch(this->element_type){
    394                 case P1P1Enum:
    395                         this->element_type = P1Enum;
    396                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    397                         this->element_type = P1P1Enum;
    398                         return;
    399                 case P1P1GLSEnum:
    400                         this->element_type = P1Enum;
    401                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    402                         this->element_type = P1P1GLSEnum;
    403                         return;
    404                 case MINIcondensedEnum:
    405                         this->element_type = P1Enum;
    406                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    407                         this->element_type = MINIcondensedEnum;
    408                         return;
    409                 case MINIEnum:
    410                         this->element_type = P1Enum;
    411                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    412                         this->element_type = MINIEnum;
    413                         return;
    414                 case TaylorHoodEnum:
    415                         this->element_type = P1Enum;
    416                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    417                         this->element_type = TaylorHoodEnum;
    418                         return;
    419                 default:
    420                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    421         }
    422 }
    423 /*}}}*/
    424 /*FUNCTION TriaRef::GetNodalFunctionsDerivativesVelocity{{{*/
    425 void TriaRef::GetNodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){
    426         switch(this->element_type){
    427                 case P1P1Enum:
    428                         this->element_type = P1Enum;
    429                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    430                         this->element_type = P1P1Enum;
    431                         return;
    432                 case P1P1GLSEnum:
    433                         this->element_type = P1Enum;
    434                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    435                         this->element_type = P1P1GLSEnum;
    436                         return;
    437                 case MINIcondensedEnum:
    438                         this->element_type = P1bubbleEnum;
    439                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    440                         this->element_type = MINIcondensedEnum;
    441                         return;
    442                 case MINIEnum:
    443                         this->element_type = P1bubbleEnum;
    444                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    445                         this->element_type = MINIEnum;
    446                         return;
    447                 case TaylorHoodEnum:
    448                 case XTaylorHoodEnum:
    449                         this->element_type = P2Enum;
    450                         this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
    451                         this->element_type = XTaylorHoodEnum;
    452                         return;
    453                 default:
    454                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    455         }
    456294}
    457295/*}}}*/
     
    528366                        return;
    529367                default:
    530                         _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     368                        _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
    531369        }
    532370
     
    683521
    684522        return -1;
     523}
     524/*}}}*/
     525/*FUNCTION TriaRef::TensorInterpolation{{{*/
     526int TriaRef::TensorInterpolation(void){
     527        /*This routine returns the values of the nodal functions  at the gaussian point.*/
     528
     529        switch(this->element_type){
     530                case XTaylorHoodEnum: return P1DGEnum;
     531                default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     532        }
    685533}
    686534/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/TriaRef.h

    r17536 r17874  
    2929                void GetNodalFunctions(IssmDouble* basis,Gauss* gauss);
    3030                void GetNodalFunctions(IssmDouble* basis,Gauss* gauss,int finiteelement);
    31                 void GetNodalFunctionsVelocity(IssmDouble* basis, Gauss* gauss);
    32                 void GetNodalFunctionsPressure(IssmDouble* basis, Gauss* gauss);
    33                 void GetNodalFunctionsTensor(IssmDouble* basis, Gauss* gauss);
    3431                void GetSegmentNodalFunctions(IssmDouble* basis,Gauss* gauss, int index1,int index2);
    3532                void GetSegmentBFlux(IssmDouble* B,Gauss* gauss, int index1,int index2);
     
    3734                void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss);
    3835                void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss,int finiteelement);
    39                 void GetNodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
    40                 void GetNodalFunctionsDerivativesPressure(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
    4136                void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss);
    4237                void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss,int finiteelement);
     
    5247                int  VelocityInterpolation(void);
    5348                int  PressureInterpolation(void);
     49                int  TensorInterpolation(void);
    5450};
    5551#endif
Note: See TracChangeset for help on using the changeset viewer.