Changeset 16697


Ignore:
Timestamp:
11/09/13 20:46:41 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: do not get Matpar pointer, use GetMaterialParameter instead

Location:
issm/trunk-jpl/src/c
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp

    r16693 r16697  
    978978        /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
    979979        for(i=0;i<numnodes;i++){
    980                 vx[i]=values[i*NDOF2+0];
    981                 vy[i]=values[i*NDOF2+1];
     980                vx[i]=values[i*2+0];
     981                vy[i]=values[i*2+1];
    982982
    983983                /*Check solution*/
     
    992992        /*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D,
    993993         *so the pressure is just the pressure at the bedrock: */
    994         Matpar* matpar=element->GetMatparPointer();
    995         rho_ice=matpar->GetRhoIce();
    996         g=matpar->GetG();
     994        rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
     995        g       = element->GetMaterialParameter(ConstantsGEnum);
    997996        element->GetInputListOnNodes(&thickness[0],ThicknessEnum);
    998997        for(i=0;i<numnodes;i++) pressure[i]=rho_ice*g*thickness[i];
  • issm/trunk-jpl/src/c/classes/Elements/Element.h

    r16693 r16697  
    4747                virtual void   FindParam(IssmDouble* pvalue,int paramenum)=0;
    4848                virtual int    FiniteElement(void)=0;
    49                 virtual Matpar* GetMatparPointer(void)=0;
     49                virtual IssmDouble GetMaterialParameter(int enum_in)=0;
    5050                virtual void   TransformSolutionCoord(IssmDouble* values,int transformenum)=0;
    5151                virtual void    GetDofList(int** pdoflist,int approximation_enum,int setenum)=0;
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r16694 r16697  
    10741074        /*Assign output pointers:*/
    10751075        *pdoflist=doflist;
     1076}
     1077/*}}}*/
     1078/*FUNCTION Penta::GetMaterialParameter{{{*/
     1079IssmDouble Penta::GetMaterialParameter(int enum_in){
     1080
     1081        _assert_(this->matpar);
     1082        return this->matpar->GetMaterialParameter(enum_in);
    10761083}
    10771084/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r16693 r16697  
    9191                void   GetNodesLidList(int* lidlist);
    9292                int    GetNumberOfNodes(void);
    93                 Matpar* GetMatparPointer(void){_error_("not implemented yet");};
     93                IssmDouble GetMaterialParameter(int enum_in);
    9494                void   GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int enum_type);
    9595                IssmDouble GetZcoord(GaussPenta* gauss);
  • issm/trunk-jpl/src/c/classes/Elements/Seg.cpp

    r16675 r16697  
    146146/*}}}*/
    147147
     148/*FUNCTION Seg::GetMaterialParameter{{{*/
     149IssmDouble Seg::GetMaterialParameter(int enum_in){
     150
     151        _assert_(this->matpar);
     152        return this->matpar->GetMaterialParameter(enum_in);
     153}
     154/*}}}*/
    148155/*FUNCTION Seg::GetSize{{{*/
    149156IssmDouble Seg::GetSize(void){
  • issm/trunk-jpl/src/c/classes/Elements/Seg.h

    r16693 r16697  
    8787                void        GetInputListOnNodes(IssmDouble* pvalue,int enumtype){_error_("not implemented yet");};
    8888                void        GetInputListOnNodes(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue){_error_("not implemented yet");};
    89                 Matpar*     GetMatparPointer(void){_error_("not implemented yet");};
     89                IssmDouble  GetMaterialParameter(int enum_in);
    9090                int         GetNodeIndex(Node* node){_error_("not implemented yet");};
    9191                void        GetNodesSidList(int* sidlist){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r16694 r16697  
    11891189}
    11901190/*}}}*/
     1191/*FUNCTION Tria::GetMaterialParameter{{{*/
     1192IssmDouble Tria::GetMaterialParameter(int enum_in){
     1193
     1194        _assert_(this->matpar);
     1195        return this->matpar->GetMaterialParameter(enum_in);
     1196}
     1197/*}}}*/
    11911198/*FUNCTION Tria::GetSegmentNormal {{{*/
    11921199void Tria:: GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[2][3]){
     
    14951502        input->GetInputValue(pvalue,gauss);
    14961503        delete gauss;
    1497 }
    1498 /*}}}*/
    1499 /*FUNCTION Tria::GetMatparPointer(void) {{{*/
    1500 Matpar* Tria::GetMatparPointer(void){
    1501         return this->matpar;
    15021504}
    15031505/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/Tria.h

    r16693 r16697  
    238238                IssmDouble     GetGroundedPortion(IssmDouble* xyz_list);
    239239                void           GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[2][3]);
    240       Matpar*        GetMatparPointer(void);
     240                IssmDouble     GetMaterialParameter(int enum_in);
    241241                void           GetZeroLevelsetCoordinates(IssmDouble* xyz_zero,IssmDouble xyz_list[3][3],int levelsetenum);
    242242                Input*         GetInput(int inputenum);
  • issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp

    r16638 r16697  
    241241}
    242242/*}}}*/
     243/*FUNCTION Matpar::Configure {{{*/
     244IssmDouble Matpar::GetMaterialParameter(int enum_in){
     245
     246        switch(enum_in){
     247                case MaterialsRhoIceEnum:                   return this->rho_ice;
     248                case MaterialsRhoWaterEnum:                 return this->rho_water;
     249                case MaterialsRhoFreshwaterEnum:            return this->rho_freshwater;
     250                case MaterialsMuWaterEnum:                  return this->mu_water;
     251                case MaterialsHeatcapacityEnum:             return this->heatcapacity;
     252                case MaterialsThermalconductivityEnum:      return this->thermalconductivity;
     253                case MaterialsTemperateiceconductivityEnum: return this->temperateiceconductivity;
     254                case MaterialsLatentheatEnum:               return this->latentheat;
     255                case MaterialsBetaEnum:                     return this->beta;
     256                case MaterialsMeltingpointEnum:             return this->meltingpoint;
     257                case ConstantsReferencetemperatureEnum:     return this->referencetemperature;
     258                case MaterialsMixedLayerCapacityEnum:       return this->mixed_layer_capacity;
     259                case MaterialsThermalExchangeVelocityEnum:  return this->thermal_exchange_velocity;
     260                case ConstantsGEnum:                        return this->g;
     261                default: _error_("Enum "<<EnumToStringx(enum_in)<<" not supported yet");
     262        }
     263
     264}
     265/*}}}*/
    243266/*FUNCTION Matpar::GetBeta {{{*/
    244267IssmDouble Matpar::GetBeta(){
  • issm/trunk-jpl/src/c/classes/Materials/Matpar.h

    r16638 r16697  
    1515
    1616        private:
    17                 int       mid;
     17                int           mid;
    1818                IssmDouble  rho_ice;
    1919                IssmDouble  rho_water;
     
    133133                IssmDouble GetMantleShearModulus();
    134134                IssmDouble GetMantleDensity();
    135                 void   EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
    136                 void   ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
     135                void       EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
     136                void       ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
    137137                IssmDouble GetDesFac();
    138138                IssmDouble GetS0p();
     139                IssmDouble GetMaterialParameter(int in_enum);
    139140                bool       IsInput(int name);
    140141                /*}}}*/
Note: See TracChangeset for help on using the changeset viewer.