Changeset 25420
- Timestamp:
- 08/17/20 17:32:46 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r25412 r25420 2921 2921 break; 2922 2922 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()){ 2953 2932 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); 2958 2937 break; 2959 2938 case P1xP2Enum: 2960 2939 case P1xP3Enum: 2961 2940 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); 2966 2945 break; 2967 2946 default: 2968 2947 _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 } 2969 2973 } 2970 2974 }
Note:
See TracChangeset
for help on using the changeset viewer.