Changeset 9632


Ignore:
Timestamp:
09/06/11 16:36:00 (14 years ago)
Author:
seroussi
Message:

implemented thermal

Location:
issm/trunk
Files:
8 added
4 deleted
45 edited

Legend:

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

    r9628 r9632  
    3434        SettingsLowmemEnum,
    3535        SettingsIoGatherEnum,
     36        ThermalSpctemperatureEnum,
     37        ThermalPenaltyThresholdEnum,
     38        ThermalPenaltyLockEnum,
     39        ThermalMaxiterEnum,
     40        ThermalStabilizationEnum,
     41        ThermalPenaltyFactorEnum,
     42        ThermalRequestedOutputsEnum,
    3643        MiscellaneousNameEnum, //FIXME: only used by qmu, should not be marshalled (already in queueing script)
    3744        TimesteppingTimeStepEnum,
     
    234241        SegmentOnIceShelfEnum,
    235242        ShelfDampeningEnum,
    236         StabilizeConstraintsEnum,
    237243        SurfaceAreaEnum,
    238244        SurfaceEnum,
     
    350356        MaxNonlinearIterationsEnum,
    351357        MinMechanicalConstraintsEnum,
    352         MinThermalConstraintsEnum,
    353358        NumberOfElementsEnum,
    354359        NumberOfVerticesEnum,
     
    425430        ZEnum,
    426431        SpcthicknessEnum,
    427         SpctemperatureEnum,
    428432        PenaltyLockEnum,
    429433        SpcvxEnum,
  • issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp

    r9628 r9632  
    3838                case SettingsLowmemEnum : return "SettingsLowmem";
    3939                case SettingsIoGatherEnum : return "SettingsIoGather";
     40                case ThermalSpctemperatureEnum : return "ThermalSpctemperature";
     41                case ThermalPenaltyThresholdEnum : return "ThermalPenaltyThreshold";
     42                case ThermalPenaltyLockEnum : return "ThermalPenaltyLock";
     43                case ThermalMaxiterEnum : return "ThermalMaxiter";
     44                case ThermalStabilizationEnum : return "ThermalStabilization";
     45                case ThermalPenaltyFactorEnum : return "ThermalPenaltyFactor";
     46                case ThermalRequestedOutputsEnum : return "ThermalRequestedOutputs";
    4047                case MiscellaneousNameEnum : return "MiscellaneousName";
    4148                case TimesteppingTimeStepEnum : return "TimesteppingTimeStep";
     
    201208                case SegmentOnIceShelfEnum : return "SegmentOnIceShelf";
    202209                case ShelfDampeningEnum : return "ShelfDampening";
    203                 case StabilizeConstraintsEnum : return "StabilizeConstraints";
    204210                case SurfaceAreaEnum : return "SurfaceArea";
    205211                case SurfaceEnum : return "Surface";
     
    301307                case MaxNonlinearIterationsEnum : return "MaxNonlinearIterations";
    302308                case MinMechanicalConstraintsEnum : return "MinMechanicalConstraints";
    303                 case MinThermalConstraintsEnum : return "MinThermalConstraints";
    304309                case NumberOfElementsEnum : return "NumberOfElements";
    305310                case NumberOfVerticesEnum : return "NumberOfVertices";
     
    368373                case ZEnum : return "Z";
    369374                case SpcthicknessEnum : return "Spcthickness";
    370                 case SpctemperatureEnum : return "Spctemperature";
    371375                case PenaltyLockEnum : return "PenaltyLock";
    372376                case SpcvxEnum : return "Spcvx";
  • issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r9628 r9632  
    4242        parameters->AddObject(iomodel->CopyConstantObject(HydrostaticAdjustmentEnum));
    4343        parameters->AddObject(iomodel->CopyConstantObject(PenaltyOffsetEnum));
     44        parameters->AddObject(iomodel->CopyConstantObject(ThermalPenaltyFactorEnum));
    4445        parameters->AddObject(iomodel->CopyConstantObject(SettingsLowmemEnum));
    4546        parameters->AddObject(iomodel->CopyConstantObject(ConnectivityEnum));
     
    5152        parameters->AddObject(iomodel->CopyConstantObject(ArtificialDiffusivityEnum));
    5253        parameters->AddObject(iomodel->CopyConstantObject(GroundinglineMeltingRateEnum));
    53         parameters->AddObject(iomodel->CopyConstantObject(MinThermalConstraintsEnum));
     54        parameters->AddObject(iomodel->CopyConstantObject(ThermalMaxiterEnum));
     55        parameters->AddObject(iomodel->CopyConstantObject(ThermalStabilizationEnum));
     56        parameters->AddObject(iomodel->CopyConstantObject(ThermalPenaltyThresholdEnum));
     57        parameters->AddObject(iomodel->CopyConstantObject(ThermalPenaltyLockEnum));
    5458        parameters->AddObject(iomodel->CopyConstantObject(MinMechanicalConstraintsEnum));
    55         parameters->AddObject(iomodel->CopyConstantObject(StabilizeConstraintsEnum));
    5659        parameters->AddObject(iomodel->CopyConstantObject(StokesreconditioningEnum));
    5760        parameters->AddObject(iomodel->CopyConstantObject(ShelfDampeningEnum));
  • issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp

    r9597 r9632  
    4545        /*Fetch data: */
    4646        double *spctemperature=NULL;
    47         iomodel->FetchData(&spctemperature,NULL,NULL,SpctemperatureEnum);
     47        iomodel->FetchData(&spctemperature,NULL,NULL,ThermalSpctemperatureEnum);
    4848
    4949        /*Initialize counter*/
  • issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp

    r9405 r9632  
    3333        /*Only 3d mesh supported*/
    3434        if (dim==3){
    35                 IoModelToConstraintsx(constraints,iomodel,SpctemperatureEnum,ThermalAnalysisEnum);
     35                IoModelToConstraintsx(constraints,iomodel,ThermalSpctemperatureEnum,ThermalAnalysisEnum);
    3636        }
    3737
  • issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp

    r9405 r9632  
    3636
    3737        //create penalties for nodes: no node can have a temperature over the melting point
    38         iomodel->FetchData(2,SpctemperatureEnum,ElementsEnum);
     38        iomodel->FetchData(2,ThermalSpctemperatureEnum,ElementsEnum);
    3939        CreateSingleNodeToElementConnectivity(iomodel);
    4040
     
    4343                /*keep only this partition's nodes:*/
    4444                if((iomodel->my_vertices[i]==1)){
    45                         if (isnan(iomodel->Data(SpctemperatureEnum)[i])){ //No penalty applied on spc nodes!
     45                        if (isnan(iomodel->Data(ThermalSpctemperatureEnum)[i])){ //No penalty applied on spc nodes!
    4646                                loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,ThermalAnalysisEnum));
    4747                        }
    4848                }
    4949        }
    50         iomodel->DeleteData(2,SpctemperatureEnum,ElementsEnum);
     50        iomodel->DeleteData(2,ThermalSpctemperatureEnum,ElementsEnum);
    5151
    5252        /*Assign output pointer: */
  • issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp

    r9628 r9632  
    3636        else if (strcmp(name,"SettingsLowmem")==0) return SettingsLowmemEnum;
    3737        else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
     38        else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum;
     39        else if (strcmp(name,"ThermalPenaltyThreshold")==0) return ThermalPenaltyThresholdEnum;
     40        else if (strcmp(name,"ThermalPenaltyLock")==0) return ThermalPenaltyLockEnum;
     41        else if (strcmp(name,"ThermalMaxiter")==0) return ThermalMaxiterEnum;
     42        else if (strcmp(name,"ThermalStabilization")==0) return ThermalStabilizationEnum;
     43        else if (strcmp(name,"ThermalPenaltyFactor")==0) return ThermalPenaltyFactorEnum;
     44        else if (strcmp(name,"ThermalRequestedOutputs")==0) return ThermalRequestedOutputsEnum;
    3845        else if (strcmp(name,"MiscellaneousName")==0) return MiscellaneousNameEnum;
    3946        else if (strcmp(name,"TimesteppingTimeStep")==0) return TimesteppingTimeStepEnum;
     
    199206        else if (strcmp(name,"SegmentOnIceShelf")==0) return SegmentOnIceShelfEnum;
    200207        else if (strcmp(name,"ShelfDampening")==0) return ShelfDampeningEnum;
    201         else if (strcmp(name,"StabilizeConstraints")==0) return StabilizeConstraintsEnum;
    202208        else if (strcmp(name,"SurfaceArea")==0) return SurfaceAreaEnum;
    203209        else if (strcmp(name,"Surface")==0) return SurfaceEnum;
     
    299305        else if (strcmp(name,"MaxNonlinearIterations")==0) return MaxNonlinearIterationsEnum;
    300306        else if (strcmp(name,"MinMechanicalConstraints")==0) return MinMechanicalConstraintsEnum;
    301         else if (strcmp(name,"MinThermalConstraints")==0) return MinThermalConstraintsEnum;
    302307        else if (strcmp(name,"NumberOfElements")==0) return NumberOfElementsEnum;
    303308        else if (strcmp(name,"NumberOfVertices")==0) return NumberOfVerticesEnum;
     
    366371        else if (strcmp(name,"Z")==0) return ZEnum;
    367372        else if (strcmp(name,"Spcthickness")==0) return SpcthicknessEnum;
    368         else if (strcmp(name,"Spctemperature")==0) return SpctemperatureEnum;
    369373        else if (strcmp(name,"PenaltyLock")==0) return PenaltyLockEnum;
    370374        else if (strcmp(name,"Spcvx")==0) return SpcvxEnum;
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r9628 r9632  
    18381838
    18391839        /*Intermediaries */
    1840         int        artdiff;
     1840        int        stabilization;
    18411841        int        i,j,ig,found=0;
    18421842        double     Jdet,u,v,w,um,vm,wm;
     
    18521852        double     B_conduct[3][numdof];
    18531853        double     B_advec[3][numdof];
    1854         double     B_artdiff[2][numdof];
     1854        double     B_stab[2][numdof];
    18551855        double     Bprime_advec[3][numdof];
    18561856        double     L[numdof];
    18571857        double     dbasis[3][6];
    18581858        double     D_scalar_conduct,D_scalar_advec;
    1859         double     D_scalar_trans,D_scalar_artdiff;
     1859        double     D_scalar_trans,D_scalar_stab;
    18601860        double     D[3][3];
    18611861        double     K[2][2]={0.0};
     
    18751875        thermalconductivity=matpar->GetThermalConductivity();
    18761876        this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
    1877         this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
     1877        this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
    18781878        Input* pressure_input=inputs->GetInput(PressureEnum);      _assert_(pressure_input);
    18791879        Input* enthalpy_input=inputs->GetInput(EnthalpyEnum);      _assert_(enthalpy_input);
     
    18841884        Input* vym_input=inputs->GetInput(VyMeshEnum);             _assert_(vym_input);
    18851885        Input* vzm_input=inputs->GetInput(VzMeshEnum);             _assert_(vzm_input);
    1886         if (artdiff==2) diameter=MinEdgeLength(xyz_list);
     1886        if (stabilization==2) diameter=MinEdgeLength(xyz_list);
    18871887
    18881888        /* Start  looping on the number of gaussian points: */
     
    19531953                /*Artifficial diffusivity*/
    19541954
    1955                 if(artdiff==1){
     1955                if(stabilization==1){
    19561956                        /*Build K: */
    1957                         D_scalar_artdiff=gauss->weight*Jdet/(pow(u-um,2)+pow(v-vm,2)+epsvel);
    1958                         if(dt) D_scalar_artdiff=D_scalar_artdiff*dt;
    1959                         K[0][0]=D_scalar_artdiff*pow(u,2);       K[0][1]=D_scalar_artdiff*fabs(u)*fabs(v);
    1960                         K[1][0]=D_scalar_artdiff*fabs(u)*fabs(v);K[1][1]=D_scalar_artdiff*pow(v,2);
    1961 
    1962                         GetBArtdiff(&B_artdiff[0][0],&xyz_list[0][0],gauss);
    1963 
    1964                         TripleMultiply(&B_artdiff[0][0],2,numdof,1,
     1957                        D_scalar_stab=gauss->weight*Jdet/(pow(u-um,2)+pow(v-vm,2)+epsvel);
     1958                        if(dt) D_scalar_stab=D_scalar_stab*dt;
     1959                        K[0][0]=D_scalar_stab*pow(u,2);       K[0][1]=D_scalar_stab*fabs(u)*fabs(v);
     1960                        K[1][0]=D_scalar_stab*fabs(u)*fabs(v);K[1][1]=D_scalar_stab*pow(v,2);
     1961
     1962                        GetBArtdiff(&B_stab[0][0],&xyz_list[0][0],gauss);
     1963
     1964                        TripleMultiply(&B_stab[0][0],2,numdof,1,
    19651965                                                &K[0][0],2,2,0,
    1966                                                 &B_artdiff[0][0],2,numdof,0,
     1966                                                &B_stab[0][0],2,numdof,0,
    19671967                                                &Ke->values[0],1);
    19681968                }
    1969                 else if(artdiff==2){
     1969                else if(stabilization==2){
    19701970
    19711971                        GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
     
    21152115
    21162116        /*Intermediaries */
    2117         int        artdiff;
     2117        int        stabilization;
    21182118        int        i,j,ig,found=0;
    21192119        double     Jdet,u,v,w,um,vm,wm;
     
    21272127        double     B_conduct[3][numdof];
    21282128        double     B_advec[3][numdof];
    2129         double     B_artdiff[2][numdof];
     2129        double     B_stab[2][numdof];
    21302130        double     Bprime_advec[3][numdof];
    21312131        double     L[numdof];
    21322132        double     dbasis[3][6];
    21332133        double     D_scalar_conduct,D_scalar_advec;
    2134         double     D_scalar_trans,D_scalar_artdiff;
     2134        double     D_scalar_trans,D_scalar_stab;
    21352135        double     D[3][3];
    21362136        double     K[2][2]={0.0};
     
    21492149        thermalconductivity=matpar->GetThermalConductivity();
    21502150        this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
    2151         this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
     2151        this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
    21522152        Input* vx_input=inputs->GetInput(VxEnum);      _assert_(vx_input);
    21532153        Input* vy_input=inputs->GetInput(VyEnum);      _assert_(vy_input);
     
    21562156        Input* vym_input=inputs->GetInput(VyMeshEnum); _assert_(vym_input);
    21572157        Input* vzm_input=inputs->GetInput(VzMeshEnum); _assert_(vzm_input);
    2158         if (artdiff==2) diameter=MinEdgeLength(xyz_list);
     2158        if (stabilization==2) diameter=MinEdgeLength(xyz_list);
    21592159
    21602160        /* Start  looping on the number of gaussian points: */
     
    22212221                /*Artifficial diffusivity*/
    22222222
    2223                 if(artdiff==1){
     2223                if(stabilization==1){
    22242224                        /*Build K: */
    2225                         D_scalar_artdiff=gauss->weight*Jdet/(pow(u-um,2)+pow(v-vm,2)+epsvel);
    2226                         if(dt) D_scalar_artdiff=D_scalar_artdiff*dt;
    2227                         K[0][0]=D_scalar_artdiff*pow(u,2);       K[0][1]=D_scalar_artdiff*fabs(u)*fabs(v);
    2228                         K[1][0]=D_scalar_artdiff*fabs(u)*fabs(v);K[1][1]=D_scalar_artdiff*pow(v,2);
    2229 
    2230                         GetBArtdiff(&B_artdiff[0][0],&xyz_list[0][0],gauss);
    2231 
    2232                         TripleMultiply(&B_artdiff[0][0],2,numdof,1,
     2225                        D_scalar_stab=gauss->weight*Jdet/(pow(u-um,2)+pow(v-vm,2)+epsvel);
     2226                        if(dt) D_scalar_stab=D_scalar_stab*dt;
     2227                        K[0][0]=D_scalar_stab*pow(u,2);       K[0][1]=D_scalar_stab*fabs(u)*fabs(v);
     2228                        K[1][0]=D_scalar_stab*fabs(u)*fabs(v);K[1][1]=D_scalar_stab*pow(v,2);
     2229
     2230                        GetBArtdiff(&B_stab[0][0],&xyz_list[0][0],gauss);
     2231
     2232                        TripleMultiply(&B_stab[0][0],2,numdof,1,
    22332233                                                &K[0][0],2,2,0,
    2234                                                 &B_artdiff[0][0],2,numdof,0,
     2234                                                &B_stab[0][0],2,numdof,0,
    22352235                                                &Ke->values[0],1);
    22362236                }
    2237                 else if(artdiff==2){
     2237                else if(stabilization==2){
    22382238
    22392239                        GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
     
    32873287        /*Intermediaries*/
    32883288        int    i,j,ig,found=0;
    3289         int    friction_type,artdiff;
     3289        int    friction_type,stabilization;
    32903290        double Jdet,phi,dt;
    32913291        double rho_ice,heatcapacity;
     
    33113311        thermalconductivity=matpar->GetThermalConductivity();
    33123312        this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
    3313         this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
     3313        this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
    33143314        Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
    33153315        Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
     
    33173317        Input* temperature_input=NULL;
    33183318        if (dt) temperature_input=inputs->GetInput(TemperatureEnum); _assert_(inputs);
    3319         if (artdiff==2) diameter=MinEdgeLength(xyz_list);
     3319        if (stabilization==2) diameter=MinEdgeLength(xyz_list);
    33203320
    33213321        /* Start  looping on the number of gaussian points: */
     
    33443344                }
    33453345
    3346                 if(artdiff==2){
     3346                if(stabilization==2){
    33473347                        GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
    33483348
     
    35543554        /*Intermediaries*/
    35553555        int    i,j,ig,found=0;
    3556         int    friction_type,artdiff;
     3556        int    friction_type,stabilization;
    35573557        double Jdet,phi,dt;
    35583558        double rho_ice,heatcapacity;
     
    35783578        thermalconductivity=matpar->GetThermalConductivity();
    35793579        this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
    3580         this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
     3580        this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
    35813581        Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
    35823582        Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
     
    35843584        Input* temperature_input=NULL;
    35853585        if (dt) temperature_input=inputs->GetInput(TemperatureEnum); _assert_(inputs);
    3586         if (artdiff==2) diameter=MinEdgeLength(xyz_list);
     3586        if (stabilization==2) diameter=MinEdgeLength(xyz_list);
    35873587
    35883588        /* Start  looping on the number of gaussian points: */
     
    36113611                }
    36123612
    3613                 if(artdiff==2){
     3613                if(stabilization==2){
    36143614                        GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
    36153615
  • issm/trunk/src/c/objects/Loads/Pengrid.cpp

    r9628 r9632  
    476476        int    unstable=0;
    477477        int    reset_penalties=0;
    478         int    stabilize_constraints;
     478        int    penalty_lock;
    479479
    480480        /*recover pointers: */
     
    493493
    494494        //Recover our data:
    495         parameters->FindParam(&stabilize_constraints,StabilizeConstraintsEnum);
     495        parameters->FindParam(&penalty_lock,ThermalPenaltyLockEnum);
    496496       
    497497        //Compute pressure melting point
     
    514514        else{
    515515                unstable=1;
    516                 if(stabilize_constraints)zigzag_counter++;
     516                if(penalty_lock)zigzag_counter++;
    517517        }
    518518
    519519        /*If penalty keeps zigzagging more than 5 times: */
    520         if(stabilize_constraints){
    521                 if(zigzag_counter>stabilize_constraints){
     520        if(penalty_lock){
     521                if(zigzag_counter>penalty_lock){
    522522                        unstable=0;
    523523                        active=1;
     
    566566        const int numdof=NUMVERTICES*NDOF1;
    567567        double pressure,temperature,t_pmp;
    568         double penalty_offset;
     568        double penalty_factor;
    569569
    570570        Penta* penta=(Penta*)element;
     
    577577        penta->GetParameterValue(&pressure,node,PressureEnum);
    578578        penta->GetParameterValue(&temperature,node,TemperatureEnum);
    579         parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
     579        parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
    580580       
    581581        /*Compute pressure melting point*/
     
    584584        /*Add penalty load*/
    585585        if (temperature<t_pmp){ //If T<Tpmp, there must be no melting. Therefore, melting should be  constrained to 0 when T<Tpmp, instead of using spcs, use penalties
    586                 Ke->values[0]=kmax*pow((double)10,penalty_offset);
     586                Ke->values[0]=kmax*pow((double)10,penalty_factor);
    587587        }
    588588
     
    595595
    596596        const int numdof=NUMVERTICES*NDOF1;
    597         double    penalty_offset;
     597        double    penalty_factor;
    598598
    599599        /*Initialize Element matrix and return if necessary*/
     
    602602
    603603        /*recover parameters: */
    604         parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
    605 
    606         Ke->values[0]=kmax*pow((double)10,penalty_offset);
     604        parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
     605
     606        Ke->values[0]=kmax*pow((double)10,penalty_factor);
    607607
    608608        /*Clean up and return*/
     
    618618        double melting_offset;
    619619        double t_pmp;
    620         double dt,penalty_offset;
     620        double dt,penalty_factor;
    621621
    622622        /*recover pointers: */
     
    632632        inputs->GetParameterValue(&melting_offset,MeltingOffsetEnum);
    633633        parameters->FindParam(&dt,TimesteppingTimeStepEnum);
    634         parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
     634        parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
    635635
    636636        /*Compute pressure melting point*/
     
    640640          This time, the penalty must have the same value as the one used for the thermal computation
    641641          so that the corresponding melting can be computed correctly
    642           In the thermal computation, we used kmax=melting_offset, and the same penalty_offset*/
     642          In the thermal computation, we used kmax=melting_offset, and the same penalty_factor*/
    643643        if (temperature<t_pmp){ //%no melting
    644644                pe->values[0]=0;
    645645        }
    646646        else{
    647                 if (dt) pe->values[0]=melting_offset*pow((double)10,penalty_offset)*(temperature-t_pmp)/dt;
    648                 else    pe->values[0]=melting_offset*pow((double)10,penalty_offset)*(temperature-t_pmp);
     647                if (dt) pe->values[0]=melting_offset*pow((double)10,penalty_factor)*(temperature-t_pmp)/dt;
     648                else    pe->values[0]=melting_offset*pow((double)10,penalty_factor)*(temperature-t_pmp);
    649649        }
    650650
     
    659659        double pressure;
    660660        double t_pmp;
    661         double penalty_offset;
     661        double penalty_factor;
    662662
    663663        Penta* penta=(Penta*)element;
     
    669669        /*Retrieve all inputs and parameters*/
    670670        penta->GetParameterValue(&pressure,node,PressureEnum);
    671         parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
     671        parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
    672672
    673673        /*Compute pressure melting point*/
    674674        t_pmp=matpar->GetMeltingPoint()-matpar->GetBeta()*pressure;
    675675
    676         pe->values[0]=kmax*pow((double)10,penalty_offset)*t_pmp;
     676        pe->values[0]=kmax*pow((double)10,penalty_factor)*t_pmp;
    677677
    678678        /*Clean up and return*/
  • issm/trunk/src/c/solvers/solver_thermal_nonlinear.cpp

    r9622 r9632  
    2727        int num_unstable_constraints;
    2828        int count;
    29         int min_thermal_constraints;
     29        int thermal_penalty_threshold;
     30        int thermal_maxiter;
    3031        bool reset_penalties;
    3132
     
    3940        kflag=1; pflag=1;
    4041        femmodel->parameters->FindParam(&lowmem,SettingsLowmemEnum);
    41         femmodel->parameters->FindParam(&min_thermal_constraints,MinThermalConstraintsEnum);
     42        femmodel->parameters->FindParam(&thermal_penalty_threshold,ThermalPenaltyThresholdEnum);
    4243        femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
     44        femmodel->parameters->FindParam(&thermal_maxiter,ThermalMaxiterEnum);
    4345
    4446        count=1;
     
    6567                if (!converged){
    6668                        _printf_(VerboseConvergence(),"%s%i\n","   #unstable constraints = ",num_unstable_constraints);
    67                         if (num_unstable_constraints <= min_thermal_constraints)converged=true;
     69                        if (num_unstable_constraints <= thermal_penalty_threshold)converged=true;
    6870                }
    6971                count++;
     
    7274               
    7375                if(converged)break;
     76                if(count>=thermal_maxiter){
     77                        _printf_(true,"   maximum number of iterations (%i) exceeded\n",thermal_maxiter);
     78                        break;
     79                }
    7480        }
    7581
  • issm/trunk/src/m/classes/model/model.m

    r9630 r9632  
    2323                 settings  = modelfield('default',0,'marshall',true);
    2424                 radaroverlay = modelfield('default',0,'marshall',false);
     25                 thermal   = modelfield('default',0,'marshall',true);
    2526                 miscellaneous = modelfield('default',0,'marshall',true);
    2627                 timestepping = modelfield('default',0,'marshall',true);
     
    111112                 mixed_layer_capacity       = modelfield('default',0,'marshall',true,'format','Double');
    112113                 thermal_exchange_velocity  = modelfield('default',0,'marshall',true,'format','Double');
    113                  min_thermal_constraints    = modelfield('default',0,'marshall',true,'format','Integer');
    114114                 min_mechanical_constraints = modelfield('default',0,'marshall',true,'format','Integer');
    115                  stabilize_constraints      = modelfield('default',0,'marshall',true,'format','Integer');
    116115
    117116                 %Physical parameters
     
    140139                 spcvy          = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
    141140                 spcvz          = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
    142                  spctemperature = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
    143141                 spcthickness   = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
    144142                 diagnostic_ref = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
     
    409407                         if isfield(structmd,'hydro_CR'), md.hydrology.CR=structmd.hydro_CR; end
    410408                         if isfield(structmd,'hydro_kn'), md.hydrology.kn=structmd.hydro_kn; end
     409                         if isfield(structmd,'spctemperature'), md.thermal.spctemperature=structmd.spctemperature; end
     410                         if isfield(structmd,'min_thermal_constraints'), md.thermal.penalty_threshold=structmd.min_thermal_constraints; end
     411                         if isfield(structmd,'artificial_diffusivity'), md.thermal.stabilization=structmd.artificial_diffusivity; end
     412                         if isfield(structmd,'max_nonlinear_iterations'), md.thermal.maxiter=structmd.max_nonlinear_iterations; end
     413                         if isfield(structmd,'stabilize_constraints'), md.thermal.penalty_lock=structmd.stabilize_constraints; end
     414                         if isfield(structmd,'penalty_offset'), md.thermal.penalty_factor=structmd.penalty_offset; end
    411415                         if isfield(structmd,'name'), md.miscellaneous.name=structmd.name; end
    412416                         if isfield(structmd,'notes'), md.miscellaneous.notes=structmd.notes; end
     
    530534                         md.settings=settings;
    531535                         md.radaroverlay=radaroverlay;
     536                         md.thermal=thermal;
    532537                         md.miscellaneous=miscellaneous;
    533538                         md.timestepping=timestepping;
     
    621626                         %a few constraints remain unstable. For thermal computation, this
    622627                         %parameter is often used.
    623                          md.min_thermal_constraints=0;
    624628                         md.min_mechanical_constraints=0;
    625629
     
    709713                                 if(strcmp(index1.subs,'diagnostic')), displaydiagnostic(md);return; end
    710714                                 if(strcmp(index1.subs,'prognostic')), displayprognostic(md);return; end
    711                                  if(strcmp(index1.subs,'thermal')), displaythermal(md);return; end
    712715                                 if(strcmp(index1.subs,'transient')), displaytransient(md);return; end
    713716                                 if(strcmp(index1.subs,'control')), displaycontrol(md);return; end
  • issm/trunk/src/m/model/collapse.m

    r9612 r9632  
    6060md.spcvz=project2d(md,md.spcvz,md.numlayers);
    6161md.spcthickness=project2d(md,md.spcthickness,md.numlayers);
    62 md.spctemperature=project2d(md,md.spctemperature,md.numlayers);
     62md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.numlayers);
    6363
    6464%Extrusion of Neumann BC
  • issm/trunk/src/m/model/extrude.m

    r9612 r9632  
    175175md.spcvy=project3d(md,'vector',md.spcvy,'type','node');
    176176md.spcvz=project3d(md,'vector',md.spcvz,'type','node');
    177 md.spctemperature=project3d(md,'vector',md.spctemperature,'type','node','layer',md.numlayers,'padding',NaN);
     177md.thermal.spctemperature=project3d(md,'vector',md.thermal.spctemperature,'type','node','layer',md.numlayers,'padding',NaN);
    178178md.spcthickness=project3d(md,'vector',md.spcthickness,'type','node');
    179179md.diagnostic_ref=project3d(md,'vector',md.diagnostic_ref,'type','node');
  • issm/trunk/src/m/model/ismodelselfconsistent.m

    r9629 r9632  
    166166        message('model not consistent: artificial_diffusivity should be a scalar (0 or 1 or 2)');
    167167end
     168if ~ismember(md.thermal.stabilization,[0 1 2]),
     169        message('model not consistent: thermal.stabilization should be a scalar (0 or 1 or 2)');
     170end
    168171if ~ismember(md.prognostic_DG,[0 1]),
    169172        message('model not consistent: prognostic_DG should be a scalar (1 or 0)');
     
    488491
    489492                        %CHECK THAT SPCTEMPERATURE IS AN APPROPRIATE FORCING
    490                         fields={'spctemperature'};
     493                        fields={'thermal.spctemperature'};
    491494                        checkforcing(md,fields);
    492495
    493496                        %CHECK THAT WE ARE NOT FULLY CONSTRAINED
    494                         if ~any(~isnan(md.spctemperature))
     497                        if ~any(~isnan(md.thermal.spctemperature))
    495498                                message(['model not consistent: model ' md.miscellaneous.name ' is totally constrained for temperature, no need to solve!']);
    496499                        end
     
    518521
    519522                                %CHECK SPCTEMPERATURE that are not NaN are >0.
    520                                 if find(any(md.spctemperature(find(~isnan(md.spctemperature(1:md.numberofnodes,:))))<=0)),
     523                                if find(any(md.thermal.spctemperature(find(~isnan(md.thermal.spctemperature(1:md.numberofnodes,:))))<=0)),
    521524                                        message(['model not consistent: model ' md.miscellaneous.name ' is constrained with negative or nil temperatures!']);
    522525                                end
  • issm/trunk/src/m/model/isresultconsistent.m

    r9571 r9632  
    147147                %check melting (<=0 via penalties)
    148148                if any(abs(md.results.ThermalAnalysis(iter).melting(md.numberofnodes2d+1:end))>tolerance)
    149                         disp(['''thermal'' result not consistent: increase penalty_offset (negative melting)']);
     149                        disp(['''thermal'' result not consistent: increase thermal.penalty_factor (negative melting)']);
    150150                        bool=0; return;
    151151                end
     
    197197                if (md.dim==3),
    198198                        if any(abs(md.results.TransientAnalysis(iter).melting(md.numberofnodes2d+1:end))>tolerance)
    199                                 disp(['''thermal'' result not consistent: increase penalty_offset (negative melting)']);
     199                                disp(['''thermal'' result not consistent: increase therma.penalty_factor (negative melting)']);
    200200                                bool=0; return;
    201201                        end
  • issm/trunk/src/m/model/modelextract.m

    r9627 r9632  
    208208                md2.spcvz(nodestoflag2)=0;
    209209        end
    210         if ~isnan(md1.spctemperature),
    211                 md2.spctemperature(nodestoflag2,1)=1;
     210        if ~isnan(md1.thermal.spctemperature),
     211                md2.thermal.spctemperature(nodestoflag2,1)=1;
    212212        end
    213213
  • issm/trunk/src/m/solvers/solver_thermal_nonlinear.m

    r9559 r9632  
    1111        %Get parameters
    1212        configuration_type=femmodel.parameters.ConfigurationType;
     13        thermal_maxiter=femmodel.parameters.ThermalMaxiter;
    1314
    1415        issmprintf(VerboseConvergence(),'\n%s',['   starting direct shooting method']);
     
    3637                if ~converged,
    3738                        issmprintf(VerboseConvergence(),'%s%i','   #unstable constraints ',num_unstable_constraints);
    38                         if num_unstable_constraints<=femmodel.parameters.MinThermalConstraints,
     39                        if num_unstable_constraints<=femmodel.parameters.ThermalPenaltyThreshold,
    3940                                converged=1;
    4041                        end
     42                end
     43                if(count>thermal_maxiter),
     44                        issmprintf(true,'%s%i%s','      maximum number of iterations ',thermal_maxiter,' exceeded');
     45                        break;
    4146                end
    4247                [femmodel.elements loads]=InputUpdateFromConstant(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,double(converged),ConvergedEnum);
  • issm/trunk/src/m/utils/BC/SetIceSheetBC.m

    r9612 r9632  
    5858
    5959if (length(md.temperature)==md.numberofnodes),
    60         md.spctemperature=NaN*ones(md.numberofnodes,1);
    61         pos=find(md.nodeonsurface); md.spctemperature(pos)=md.temperature(pos); %impose observed temperature on surface
     60        md.thermal.spctemperature=NaN*ones(md.numberofnodes,1);
     61        pos=find(md.nodeonsurface); md.thermal.spctemperature(pos)=md.temperature(pos); %impose observed temperature on surface
    6262        if (length(md.basalforcings.geothermalflux)~=md.numberofnodes),
    6363                md.basalforcings.geothermalflux=50*10^-3*ones(md.numberofnodes,1); %50 mW/m^2
  • issm/trunk/src/m/utils/BC/SetIceShelfBC.m

    r9612 r9632  
    9090
    9191if (length(md.temperature)==md.numberofnodes),
    92         md.spctemperature=NaN*ones(md.numberofnodes,1);
    93         pos=find(md.nodeonsurface); md.spctemperature(pos)=md.temperature(pos); %impose observed temperature on surface
     92        md.thermal.spctemperature=NaN*ones(md.numberofnodes,1);
     93        pos=find(md.nodeonsurface); md.thermal.spctemperature(pos)=md.temperature(pos); %impose observed temperature on surface
    9494        if (length(md.basalforcings.geothermalflux)~=md.numberofnodes),
    9595                md.basalforcings.geothermalflux=zeros(md.numberofnodes,1);
  • issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m

    r9617 r9632  
    101101
    102102if (length(md.temperature)==md.numberofnodes),
    103         md.spctemperature=NaN*ones(md.numberofnodes,1);
    104         pos=find(md.nodeonsurface); md.spctemperature(pos)=md.temperature(pos); %impose observed temperature on surface
     103        md.thermal.spctemperature=NaN*ones(md.numberofnodes,1);
     104        pos=find(md.nodeonsurface); md.thermal.spctemperature(pos)=md.temperature(pos); %impose observed temperature on surface
    105105        if (length(md.basalforcings.geothermalflux)~=md.numberofnodes),
    106106                md.basalforcings.geothermalflux=zeros(md.numberofnodes,1);
  • issm/trunk/test/Miscellaneous/GJM_test1/SquareShelf.par

    r9625 r9632  
    2727md.viscosity_overshoot=0.3;
    2828md.artificial_diffusivity=1;
     29md.thermal.stabilization=1;
    2930md.waitonlock=30;
    3031md.verbose=verbose(0);
  • issm/trunk/test/Miscellaneous/connectivity/Square.par

    r9597 r9632  
    55md.ndt=md.dt*10;
    66md.artificial_diffusivity=1;
     7md.thermal.stabilization=1;
    78
    89hmin=300;
  • issm/trunk/test/NightlyRun/test1110.m

    r9628 r9632  
    3636        end
    3737        pos=find(~md.nodeonbed);
    38         md.spctemperature(pos)=255;
     38        md.thermal.spctemperature(pos)=255;
    3939
    4040        %Create MPCs to have periodic boundary conditions
  • issm/trunk/test/NightlyRun/test1208.m

    r9628 r9632  
    2323md.timestepping.final_time=50000;
    2424md.artificial_diffusivity=2;
     25md.thermal.stabilization=2;
    2526
    2627%Now we can solve the problem
  • issm/trunk/test/NightlyRun/test1301.m

    r9611 r9632  
    1616md.temperature=273.15*ones(md.numberofnodes,1);
    1717pos=find(md.nodeonsurface);
    18 md.spctemperature(pos)=md.temperature(pos);
     18md.thermal.spctemperature(pos)=md.temperature(pos);
    1919md.rheology_B=paterson(md.temperature);
    2020
  • issm/trunk/test/NightlyRun/test1302.m

    r9597 r9632  
    1212
    1313%Thermal boundary conditions
    14 pos1=find(md.elementonbed);     md.spctemperature(md.elements(pos1,1:3))=10;
    15 pos2=find(md.elementonsurface); md.spctemperature(md.elements(pos2,4:6))=0;
     14pos1=find(md.elementonbed);     md.thermal.spctemperature(md.elements(pos1,1:3))=10;
     15pos2=find(md.elementonsurface); md.thermal.spctemperature(md.elements(pos2,4:6))=0;
    1616md.vz=0.1*ones(md.numberofnodes,1);
    1717md.vel=sqrt( md.vx.^2+ md.vy.^2+ md.vz.^2);
  • issm/trunk/test/NightlyRun/test1303.m

    r9433 r9632  
    1111md=extrude(md,11,2);
    1212md=setelementstype(md,'Pattyn','all');
    13 pos1=find(md.elementonbed);     md.spctemperature(md.elements(pos1,1:3))=10;
    14 pos2=find(md.elementonsurface); md.spctemperature(md.elements(pos2,4:6))=0;
     13pos1=find(md.elementonbed);     md.thermal.spctemperature(md.elements(pos1,1:3))=10;
     14pos2=find(md.elementonsurface); md.thermal.spctemperature(md.elements(pos2,4:6))=0;
    1515md.pressure=zeros(md.numberofnodes,1);
    1616
  • issm/trunk/test/NightlyRun/test1304.m

    r9611 r9632  
    1212md=setelementstype(md,'Pattyn','all');
    1313
    14 pos2=find(md.elementonsurface); md.spctemperature(md.elements(pos2,4:6))=0;
     14pos2=find(md.elementonsurface); md.thermal.spctemperature(md.elements(pos2,4:6))=0;
    1515md.pressure=zeros(md.numberofnodes,1);
    1616md.basalforcings.geothermalflux(:)=0.1; %100mW/m^2
  • issm/trunk/test/NightlyRun/test263.m

    r9628 r9632  
    55md=setelementstype(md,'macayeal','all');
    66md.cluster=none;
    7 md.spctemperature=[md.spctemperature, md.spctemperature+5, md.spctemperature+10, md.spctemperature+15; 1.5 2.5 3.5 4];
     7md.thermal.spctemperature=[md.thermal.spctemperature, md.thermal.spctemperature+5, md.thermal.spctemperature+10, md.thermal.spctemperature+15; 1.5 2.5 3.5 4];
    88md.timestepping.time_step=1;
    99md.timestepping.final_time=4;
  • issm/trunk/test/NightlyRun/test264.m

    r9628 r9632  
    55md=setelementstype(md,'macayeal','all');
    66md.cluster=generic('name',oshostname(),'np',3);
    7 md.spctemperature=[md.spctemperature, md.spctemperature+5, md.spctemperature+10, md.spctemperature+15; 1.5 2.5 3.5 4];
     7md.thermal.spctemperature=[md.thermal.spctemperature, md.thermal.spctemperature+5, md.thermal.spctemperature+10, md.thermal.spctemperature+15; 1.5 2.5 3.5 4];
    88md.timestepping.time_step=1;
    99md.timestepping.final_time=4;
  • issm/trunk/test/NightlyRun/test265.m

    r9628 r9632  
    55md=setelementstype(md,'pattyn','all');
    66md.cluster=none;
    7 md.spctemperature=[md.spctemperature, md.spctemperature+5; 1 2];
     7md.thermal.spctemperature=[md.thermal.spctemperature, md.thermal.spctemperature+5; 1 2];
    88md.timestepping.time_step=0.5;
    99md.timestepping.final_time=2;
  • issm/trunk/test/NightlyRun/test266.m

    r9628 r9632  
    55md=setelementstype(md,'pattyn','all');
    66md.cluster=generic('name',oshostname(),'np',3);
    7 md.spctemperature=[md.spctemperature, md.spctemperature+5; 1 2];
     7md.thermal.spctemperature=[md.thermal.spctemperature, md.thermal.spctemperature+5; 1 2];
    88md.timestepping.time_step=0.5;
    99md.timestepping.final_time=2;
  • issm/trunk/test/NightlyRun/test529.m

    r9611 r9632  
    44md=extrude(md,3,1);
    55md=setelementstype(md,'pattyn','all');
    6 md.artificial_diffusivity=2;
     6md.thermal.stabilization=2;
    77md=solve(md,ThermalSolutionEnum);
    88
  • issm/trunk/test/NightlyRun/test530.m

    r9611 r9632  
    44md=extrude(md,3,1);
    55md=setelementstype(md,'pattyn','all');
    6 md.artificial_diffusivity=2;
     6md.thermal.stabilization=2;
    77md.cluster=generic('name',oshostname(),'np',3);
    88md=solve(md,ThermalSolutionEnum);
  • issm/trunk/test/NightlyRun/test531.m

    r9628 r9632  
    44md=extrude(md,3,1);
    55md=setelementstype(md,'pattyn','all');
    6 md.artificial_diffusivity=2;
     6md.thermal.stabilization=2;
    77md.timestepping.time_step=0;
    8 md.min_thermal_constraints=40;
     8md.thermal.penalty_threshold=40;
    99md=solve(md,ThermalSolutionEnum);
    1010
  • issm/trunk/test/NightlyRun/test532.m

    r9628 r9632  
    44md=extrude(md,3,1);
    55md=setelementstype(md,'pattyn','all');
    6 md.artificial_diffusivity=2;
     6md.thermal.stabilization=2;
    77md.cluster=generic('name',oshostname(),'np',3);
    88md.timestepping.time_step=0;
    9 md.min_thermal_constraints=40;
     9md.thermal.penalty_threshold=40;
    1010md=solve(md,ThermalSolutionEnum);
    1111
  • issm/trunk/test/Par/79North.par

    r9628 r9632  
    3232md.viscosity_overshoot=0.3;
    3333md.artificial_diffusivity=1;
     34md.thermal.stabilization=1;
    3435md.verbose=verbose(0);
    3536md.waitonlock=30;
  • issm/trunk/test/Par/ISMIPF.par

    r9628 r9632  
    3131md.spcthickness=NaN*ones(md.numberofnodes,1);
    3232md.spcthickness(pos)=md.thickness(pos);
    33 md.spctemperature=255*ones(md.numberofnodes,1);
     33md.thermal.spctemperature=255*ones(md.numberofnodes,1);
    3434md.basalforcings.geothermalflux=0.4*ones(md.numberofnodes,1);
    3535
     
    4141md.timestepping.final_time=10;
    4242md.artificial_diffusivity=1;
    43 md.min_thermal_constraints=10^5;
     43md.thermal.stabilization=1;
     44md.thermal.penalty_threshold=10^5;
  • issm/trunk/test/Par/RoundSheetShelf.par

    r9629 r9632  
    5959md.viscosity_overshoot=0.0;
    6060md.artificial_diffusivity=1;
     61md.thermal.stabilisation=1;
    6162md.verbose=verbose(0);
    6263md.waitonlock=30;
  • issm/trunk/test/Par/SquareEISMINT.par

    r9628 r9632  
    3434md.spcthickness=NaN*ones(md.numberofnodes,1);
    3535md.spcthickness(pos)=500;
     36md.artificial_diffusivity=0; %Better result with no artificial diffusivity
     37md.thermal.statbilization=0;
    3638md.timestepping.final_time=500;
    3739md.timestepping.time_step=1;
    38 md.artificial_diffusivity=0; %Better result with no artificial diffusivity
  • issm/trunk/test/Par/SquareSheetConstrained.par

    r9628 r9632  
    3333md.viscosity_overshoot=0.0;
    3434md.artificial_diffusivity=1;
     35md.thermal.stabilization=1;
    3536md.verbose=verbose(0);
    3637md.waitonlock=30;
  • issm/trunk/test/Par/SquareSheetShelf.par

    r9628 r9632  
    4040md.viscosity_overshoot=0.0;
    4141md.artificial_diffusivity=1;
     42md.thermal.stabilization=1;
    4243md.verbose=verbose(0);
    4344md.waitonlock=30;
  • issm/trunk/test/Par/SquareShelf.par

    r9628 r9632  
    3333md.viscosity_overshoot=0.3;
    3434md.artificial_diffusivity=1;
     35md.thermal.stabilization=1;
    3536md.waitonlock=30;
    3637md.verbose=verbose(0);
  • issm/trunk/test/Par/SquareShelfConstrained.par

    r9628 r9632  
    3737md.viscosity_overshoot=0.0;
    3838md.artificial_diffusivity=1;
     39md.thermal.stabilization=1;
    3940md.verbose=verbose(0);
    4041md.waitonlock=30;
  • issm/trunk/test/Par/SquareThermal.par

    r9628 r9632  
    3939
    4040disp('      boundary conditions for thermal model');
    41 md.spctemperature(:)=md.temperature;
     41md.thermal.spctemperature(:)=md.temperature;
    4242md.basalforcings.geothermalflux=zeros(md.numberofnodes,1);
    4343pos=find(md.elementonicesheet);md.basalforcings.geothermalflux(md.elements(pos,:))=1*10^-3; %1 mW/m^2
Note: See TracChangeset for help on using the changeset viewer.