Changeset 6946


Ignore:
Timestamp:
01/05/11 11:28:39 (14 years ago)
Author:
seroussi
Message:

started to add hydrostatic adjustment

Location:
issm/trunk/src/c
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h

    r6891 r6946  
    199199        FrictionEnum,
    200200        GeothermalFluxEnum,
     201        HydrostaticAdjustmentEnum,
    201202        InternalEnum,
    202203        KflagEnum,
     
    310311        ResidualEnum,
    311312        AbsoluteEnum,
     313        IncrementalEnum,
    312314        /*}}}*/
    313315        /*Material{{{1*/
  • issm/trunk/src/c/EnumDefinitions/EnumToString.cpp

    r6891 r6946  
    171171                case FrictionEnum : return "Friction";
    172172                case GeothermalFluxEnum : return "GeothermalFlux";
     173                case HydrostaticAdjustmentEnum : return "HydrostaticAdjustment";
    173174                case InternalEnum : return "Internal";
    174175                case KflagEnum : return "Kflag";
     
    272273                case ResidualEnum : return "Residual";
    273274                case AbsoluteEnum : return "Absolute";
     275                case IncrementalEnum : return "Incremental";
    274276                case RhoIceEnum : return "RhoIce";
    275277                case RhoWaterEnum : return "RhoWater";
  • issm/trunk/src/c/EnumDefinitions/StringToEnum.cpp

    r6891 r6946  
    169169        else if (strcmp(name,"Friction")==0) return FrictionEnum;
    170170        else if (strcmp(name,"GeothermalFlux")==0) return GeothermalFluxEnum;
     171        else if (strcmp(name,"HydrostaticAdjustment")==0) return HydrostaticAdjustmentEnum;
    171172        else if (strcmp(name,"Internal")==0) return InternalEnum;
    172173        else if (strcmp(name,"Kflag")==0) return KflagEnum;
     
    270271        else if (strcmp(name,"Residual")==0) return ResidualEnum;
    271272        else if (strcmp(name,"Absolute")==0) return AbsoluteEnum;
     273        else if (strcmp(name,"Incremental")==0) return IncrementalEnum;
    272274        else if (strcmp(name,"RhoIce")==0) return RhoIceEnum;
    273275        else if (strcmp(name,"RhoWater")==0) return RhoWaterEnum;
  • issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r6379 r6946  
    5555        parameters->AddObject(new BoolParam(TimeAdaptEnum,iomodel->time_adapt));
    5656        parameters->AddObject(new DoubleParam(CflCoefficientEnum,iomodel->cfl_coefficient));
     57        parameters->AddObject(new IntParam(HydrostaticAdjustmentEnum,iomodel->hydrostatic_adjustment));
    5758        parameters->AddObject(new DoubleParam(PenaltyOffsetEnum,iomodel->penalty_offset));
    5859        parameters->AddObject(new DoubleParam(SparsityEnum,iomodel->sparsity));
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r6940 r6946  
    58055805
    58065806        /*Intermediaries*/
    5807         int    i;
     5807        int hydroadjustment;
    58085808        double rho_ice,rho_water;
    58095809
     
    58135813        /*If shelf: hydrostatic equilibrium*/
    58145814        if (this->IsOnShelf()){
     5815
     5816                /*Fing HydrostaticAdjustment to figure out how to update the geometry:*/
     5817                this->parameters->FindParam(&hydroadjustment,HydrostaticAdjustmentEnum);
    58155818
    58165819                /*recover material parameters: */
     
    58185821                rho_water=matpar->GetRhoWater();
    58195822
    5820                 /*Create New Surface: s = (1-rho_ice/rho_water) h*/
    5821                 this->inputs->DuplicateInput(ThicknessEnum,SurfaceEnum);     //1: copy thickness into surface
    5822                 InputScale(SurfaceEnum,(1-rho_ice/rho_water)); //2: surface = surface * (1-di)
    5823 
    5824                 /*Create New Bed b = -rho_ice/rho_water h*/
    5825                 this->inputs->DuplicateInput(ThicknessEnum,BedEnum);         //1: copy thickness into bed
    5826                 InputScale(BedEnum, -rho_ice/rho_water);       //2: bed = bed * (-di)
     5823                if(hydroadjustment==AbsoluteEnum){
     5824                        /*Create New Surface: s = (1-rho_ice/rho_water) h*/
     5825                        this->inputs->DuplicateInput(ThicknessEnum,SurfaceEnum);     //1: copy thickness into surface
     5826                        InputScale(SurfaceEnum,(1-rho_ice/rho_water)); //2: surface = surface * (1-di)
     5827
     5828                        /*Create New Bed b = -rho_ice/rho_water h*/
     5829                        this->inputs->DuplicateInput(ThicknessEnum,BedEnum);         //1: copy thickness into bed
     5830                        InputScale(BedEnum, -rho_ice/rho_water);       //2: bed = bed * (-di)
     5831                }
     5832                else if(hydroadjustment==IncrementalEnum){
     5833                        /*The bed is update with di*Thickness*/
     5834                        this->inputs->AXPY(SurfaceEnum,1.0-rho_ice/rho_water,ThicknessEnum);     //surface = surface + (1-di) * thickness
     5835
     5836                        /*The surface is update with (1-di)*Thickness*/
     5837                        this->inputs->AXPY(BedEnum,rho_ice/rho_water,ThicknessEnum);     //bed = bde + di * thickness
     5838                }
     5839                else _error_("Hydrostatic adjustment %i (%s) not supported yet",hydroadjustment,EnumToString(hydroadjustment));
    58275840        }
    58285841
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r6934 r6946  
    51295129
    51305130        /*Intermediaries*/
     5131        int hydroadjustment;
    51315132        double rho_ice,rho_water;
    51325133
     
    51365137        /*If shelf: hydrostatic equilibrium*/
    51375138        if (this->IsOnShelf()){
     5139
     5140                /*Fing HydrostaticAdjustment to figure out how to update the geometry:*/
     5141                this->parameters->FindParam(&hydroadjustment,HydrostaticAdjustmentEnum);
    51385142
    51395143                /*recover material parameters: */
     
    51415145                rho_water=matpar->GetRhoWater();
    51425146
    5143                 /*Create New Surface: s = (1-rho_ice/rho_water) h*/
    5144                 this->inputs->DuplicateInput(ThicknessEnum,SurfaceEnum);     //1: copy thickness into surface
    5145                 InputScale(SurfaceEnum,(1.0-rho_ice/rho_water)); //2: surface = surface * (1-di)
    5146 
    5147                 /*Create New Bed b = -rho_ice/rho_water h*/
    5148                 this->inputs->DuplicateInput(ThicknessEnum,BedEnum);         //1: copy thickness into bed
    5149                 InputScale(BedEnum, -rho_ice/rho_water);       //2: bed = bed * (-di)
     5147                if(hydroadjustment==AbsoluteEnum){
     5148                        /*Create New Surface: s = (1-rho_ice/rho_water) h*/
     5149                        this->inputs->DuplicateInput(ThicknessEnum,SurfaceEnum);     //1: copy thickness into surface
     5150                        InputScale(SurfaceEnum,(1.0-rho_ice/rho_water)); //2: surface = surface * (1-di)
     5151
     5152                        /*Create New Bed b = -rho_ice/rho_water h*/
     5153                        this->inputs->DuplicateInput(ThicknessEnum,BedEnum);         //1: copy thickness into bed
     5154                        InputScale(BedEnum, -rho_ice/rho_water);       //2: bed = bed * (-di)
     5155                }
     5156                else if(hydroadjustment==IncrementalEnum){
     5157                        /*The bed is update with di*Thickness*/
     5158                        this->inputs->AXPY(SurfaceEnum,1.0-rho_ice/rho_water,ThicknessEnum);     //surface = surface + (1-di) * thickness
     5159
     5160                        /*The surface is update with (1-di)*Thickness*/
     5161                        this->inputs->AXPY(BedEnum,rho_ice/rho_water,ThicknessEnum);     //bed = bde + di * thickness
     5162                }
     5163                else _error_("Hydrostatic adjustment %i (%s) not supported yet",hydroadjustment,EnumToString(hydroadjustment));
    51505164        }
    51515165
  • issm/trunk/src/c/objects/IoModel.cpp

    r6892 r6946  
    178178        IoModelFetchData(&this->time_adapt,iomodel_handle,"time_adapt");
    179179        IoModelFetchData(&this->cfl_coefficient,iomodel_handle,"cfl_coefficient");
     180        IoModelFetchData(&this->hydrostatic_adjustment,iomodel_handle,"hydrostatic_adjustment");
    180181        IoModelFetchData(&this->penalty_offset,iomodel_handle,"penalty_offset");
    181182        IoModelFetchData(&this->penalty_melting,iomodel_handle,"penalty_melting");
     
    326327        this->time_adapt=0;
    327328        this->cfl_coefficient=0;
     329        this->hydrostatic_adjustment=0;
    328330        this->penalty_offset=0;
    329331        this->penalty_melting=0;
  • issm/trunk/src/c/objects/IoModel.h

    r6892 r6946  
    146146                int     time_adapt;
    147147                double  cfl_coefficient;
     148                int     hydrostatic_adjustment;
    148149                double  penalty_offset;
    149150                double  penalty_melting;
Note: See TracChangeset for help on using the changeset viewer.