Changeset 25420


Ignore:
Timestamp:
08/17/20 17:32:46 (5 years ago)
Author:
schlegel
Message:

BUG: for pdd, don't look for thermal input if thermal model is off

File:
1 edited

Legend:

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

    r25412 r25420  
    29212921                        break;
    29222922                case PentaEnum:
    2923                         if(IsOnSurface()){
    2924                                 /*Here, we want to change the BC of the thermal model, keep
    2925                                  * the temperatures as they are for the base of the penta and
    2926                                  * yse yearlytemperatures for the top*/
    2927                                 PentaInput* temp_input = xDynamicCast<PentaInput*>(this->GetInput(TemperatureEnum)); _assert_(temp_input);
    2928                                 switch(temp_input->GetInputInterpolationType()){
    2929                                         case P1Enum:
    2930                                                 temp_input->element_values[3] = yearlytemperatures[3];
    2931                                                 temp_input->element_values[4] = yearlytemperatures[4];
    2932                                                 temp_input->element_values[5] = yearlytemperatures[5];
    2933                                                 temp_input->SetInput(P1Enum,NUM_VERTICES,&vertexlids[0],temp_input->element_values);
    2934                                                 break;
    2935                                         case P1xP2Enum:
    2936                                         case P1xP3Enum:
    2937                                         case P1xP4Enum:
    2938                                                 temp_input->element_values[3] = yearlytemperatures[3];
    2939                                                 temp_input->element_values[4] = yearlytemperatures[4];
    2940                                                 temp_input->element_values[5] = yearlytemperatures[5];
    2941                                                 temp_input->SetInput(temp_input->GetInputInterpolationType(),this->lid,this->GetNumberOfNodes(temp_input->GetInputInterpolationType()),temp_input->element_values);
    2942                                                 break;
    2943                                         default:
    2944                                                 _error_("Interpolation "<<EnumToStringx(temp_input->GetInputInterpolationType())<<" not supported yet");
    2945                                 }
    2946 
    2947                                 bool isenthalpy;
    2948                                 this->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum);
    2949                                 if(isenthalpy){
    2950                                         /*Convert that to enthalpy for the enthalpy model*/
    2951                                         PentaInput* enth_input = xDynamicCast<PentaInput*>(this->GetInput(EnthalpyEnum)); _assert_(enth_input);
    2952                                         switch(enth_input->GetInputInterpolationType()){
     2923                        bool isthermal;
     2924         this->parameters->FindParam(&isthermal,TransientIsthermalEnum);
     2925         if(isthermal){
     2926                                if(IsOnSurface()){
     2927                                        /*Here, we want to change the BC of the thermal model, keep
     2928                                         * the temperatures as they are for the base of the penta and
     2929                                         * yse yearlytemperatures for the top*/
     2930                                        PentaInput* temp_input = xDynamicCast<PentaInput*>(this->GetInput(TemperatureEnum)); _assert_(temp_input);
     2931                                        switch(temp_input->GetInputInterpolationType()){
    29532932                                                case P1Enum:
    2954                                                         ThermalToEnthalpy(&enth_input->element_values[3],yearlytemperatures[3],0.,0.);
    2955                                                         ThermalToEnthalpy(&enth_input->element_values[4],yearlytemperatures[4],0.,0.);
    2956                                                         ThermalToEnthalpy(&enth_input->element_values[5],yearlytemperatures[5],0.,0.);
    2957                                                         enth_input->SetInput(P1Enum,NUM_VERTICES,&vertexlids[0],enth_input->element_values);
     2933                                                        temp_input->element_values[3] = yearlytemperatures[3];
     2934                                                        temp_input->element_values[4] = yearlytemperatures[4];
     2935                                                        temp_input->element_values[5] = yearlytemperatures[5];
     2936                                                        temp_input->SetInput(P1Enum,NUM_VERTICES,&vertexlids[0],temp_input->element_values);
    29582937                                                        break;
    29592938                                                case P1xP2Enum:
    29602939                                                case P1xP3Enum:
    29612940                                                case P1xP4Enum:
    2962                                                         ThermalToEnthalpy(&enth_input->element_values[3],yearlytemperatures[3],0.,0.);
    2963                                                         ThermalToEnthalpy(&enth_input->element_values[4],yearlytemperatures[4],0.,0.);
    2964                                                         ThermalToEnthalpy(&enth_input->element_values[5],yearlytemperatures[5],0.,0.);
    2965                                                         enth_input->SetInput(enth_input->GetInputInterpolationType(),this->lid,this->GetNumberOfNodes(enth_input->GetInputInterpolationType()),enth_input->element_values);
     2941                                                        temp_input->element_values[3] = yearlytemperatures[3];
     2942                                                        temp_input->element_values[4] = yearlytemperatures[4];
     2943                                                        temp_input->element_values[5] = yearlytemperatures[5];
     2944                                                        temp_input->SetInput(temp_input->GetInputInterpolationType(),this->lid,this->GetNumberOfNodes(temp_input->GetInputInterpolationType()),temp_input->element_values);
    29662945                                                        break;
    29672946                                                default:
    29682947                                                        _error_("Interpolation "<<EnumToStringx(temp_input->GetInputInterpolationType())<<" not supported yet");
     2948                                        }
     2949
     2950                                        bool isenthalpy;
     2951                                        this->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum);
     2952                                        if(isenthalpy){
     2953                                                /*Convert that to enthalpy for the enthalpy model*/
     2954                                                PentaInput* enth_input = xDynamicCast<PentaInput*>(this->GetInput(EnthalpyEnum)); _assert_(enth_input);
     2955                                                switch(enth_input->GetInputInterpolationType()){
     2956                                                        case P1Enum:
     2957                                                                ThermalToEnthalpy(&enth_input->element_values[3],yearlytemperatures[3],0.,0.);
     2958                                                                ThermalToEnthalpy(&enth_input->element_values[4],yearlytemperatures[4],0.,0.);
     2959                                                                ThermalToEnthalpy(&enth_input->element_values[5],yearlytemperatures[5],0.,0.);
     2960                                                                enth_input->SetInput(P1Enum,NUM_VERTICES,&vertexlids[0],enth_input->element_values);
     2961                                                                break;
     2962                                                        case P1xP2Enum:
     2963                                                        case P1xP3Enum:
     2964                                                        case P1xP4Enum:
     2965                                                                ThermalToEnthalpy(&enth_input->element_values[3],yearlytemperatures[3],0.,0.);
     2966                                                                ThermalToEnthalpy(&enth_input->element_values[4],yearlytemperatures[4],0.,0.);
     2967                                                                ThermalToEnthalpy(&enth_input->element_values[5],yearlytemperatures[5],0.,0.);
     2968                                                                enth_input->SetInput(enth_input->GetInputInterpolationType(),this->lid,this->GetNumberOfNodes(enth_input->GetInputInterpolationType()),enth_input->element_values);
     2969                                                                break;
     2970                                                        default:
     2971                                                                _error_("Interpolation "<<EnumToStringx(temp_input->GetInputInterpolationType())<<" not supported yet");
     2972                                                }
    29692973                                        }
    29702974                                }
Note: See TracChangeset for help on using the changeset viewer.