Changeset 24556
- Timestamp:
- 02/07/20 16:27:39 (5 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
r24489 r24556 507 507 element->AddInput2(WatercolumnEnum,watercolumns,finite_element); 508 508 } 509 element->AddInput2(BasalforcingsGroundediceMeltingRateEnum,basalmeltingrates, finite_element);509 element->AddInput2(BasalforcingsGroundediceMeltingRateEnum,basalmeltingrates,P1DGEnum); 510 510 511 511 /*Clean up and return*/ … … 825 825 Input2* pressure_input=element->GetInput2(PressureEnum); _assert_(pressure_input); 826 826 Input2* enthalpy_input=NULL; 827 if(reCast<bool,IssmDouble>(dt)){enthalpy_input = element->GetInput2(EnthalpyEnum); _assert_(enthalpy_input);} 827 if(dt>0.){ 828 enthalpy_input = element->GetInput2(EnthalpyEnum); _assert_(enthalpy_input); 829 } 828 830 829 831 /* Start looping on the number of gaussian points: */ … … 864 866 865 867 /* Build transient now */ 866 if( reCast<bool,IssmDouble>(dt)){868 if(dt>0.){ 867 869 enthalpy_input->GetInputValue(&enthalpy, gauss); 868 870 scalar_transient=enthalpy*Jdet*gauss->weight; … … 891 893 element->ElementSizes(&hx,&hy,&hz); 892 894 kappa=this->EnthalpyDiffusionParameterVolume(element,EnthalpyPicardEnum); _assert_(kappa>=0.); 893 894 895 896 897 898 899 900 895 vx_input->GetInputValue(&u,gauss); 896 vy_input->GetInputValue(&v,gauss); 897 vz_input->GetInputValue(&w,gauss); 898 element->StabilizationParameterAnisotropic(&tau_parameter_anisotropic[0],u,v,w,hx,hy,hz,kappa/rho_ice); 899 tau_parameter_hor=tau_parameter_anisotropic[0]; 900 tau_parameter_ver=tau_parameter_anisotropic[1]; 901 902 for(i=0;i<numnodes;i++) pe->values[i]+=scalar_def*(tau_parameter_hor*u*dbasis[0*numnodes+i]+tau_parameter_hor*v*dbasis[1*numnodes+i]+tau_parameter_ver*w*dbasis[2*numnodes+i]); 901 903 } 902 904 } -
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r24549 r24556 18 18 #include "../Inputs2/TransientInput2.h" 19 19 #include "../Inputs2/ElementInput2.h" 20 #include "../Inputs2/PentaInput2.h" 20 21 #include "../Inputs2/DatasetInput2.h" 21 22 #include "../Inputs2/ArrayInput2.h" 22 23 /*}}}*/ 24 #define MAXVERTICES 6 /*Maximum number of vertices per element, currently Penta, to avoid dynamic mem allocation*/ 23 25 24 26 #ifdef _HAVE_SEMIC_ … … 2804 2806 const int NUM_VERTICES_MONTHS_PER_YEAR = NUM_VERTICES * 12; 2805 2807 2806 int i ;2808 int i,vertexlids[MAXVERTICES]; 2807 2809 IssmDouble* agd=xNew<IssmDouble>(NUM_VERTICES); // surface mass balance 2808 2810 IssmDouble* melt=xNew<IssmDouble>(NUM_VERTICES); // surface mass balance … … 2822 2824 IssmDouble mavg=1./12.; //factor for monthly average 2823 2825 2826 /*Get vertex Lids for later*/ 2827 this->GetVerticesLidList(&vertexlids[0]); 2828 2824 2829 /*Get material parameters :*/ 2825 2830 rho_water=this->FindParam(MaterialsRhoSeawaterEnum); … … 2915 2920 * the temperatures as they are for the base of the penta and 2916 2921 * yse yearlytemperatures for the top*/ 2917 GetInputListOnVertices(&s[0],TemperatureEnum); 2918 yearlytemperatures[0] = s[0]; 2919 yearlytemperatures[1] = s[1]; 2920 yearlytemperatures[2] = s[2]; 2922 PentaInput2* temp_input = xDynamicCast<PentaInput2*>(this->GetInput2(TemperatureEnum)); _assert_(temp_input); 2923 switch(temp_input->GetInputInterpolationType()){ 2924 case P1Enum: 2925 temp_input->element_values[3] = yearlytemperatures[3]; 2926 temp_input->element_values[4] = yearlytemperatures[4]; 2927 temp_input->element_values[5] = yearlytemperatures[5]; 2928 temp_input->SetInput(P1Enum,NUM_VERTICES,&vertexlids[0],temp_input->element_values); 2929 break; 2930 default: 2931 _error_("Interpolation "<<EnumToStringx(temp_input->GetInputInterpolationType())<<" not supported yet"); 2932 } 2921 2933 this->AddInput2(TemperatureEnum,&yearlytemperatures[0],P1Enum); 2922 2934 … … 3247 3259 } /*}}}*/ 3248 3260 void Element::ResultToVector(Vector<IssmDouble>* vector,int output_enum){/*{{{*/ 3249 3250 const int MAXVERTICES = 6;3251 3261 3252 3262 IssmDouble values[MAXVERTICES]; -
issm/trunk-jpl/src/c/classes/Inputs2/PentaInput2.cpp
r24488 r24556 85 85 /*}}}*/ 86 86 void PentaInput2::DeepEcho(void){/*{{{*/ 87 _printf_("PentaInput2 Echo:\n");88 _printf_(" interpolation: "<<EnumToStringx(this->interpolation)<<"\n");89 _printf_(" Size: "<<M<<"x"<<N<<"\n");90 _printf_(" isserved: "<<(isserved?"true":"false") << "\n");91 _printf_(" isserved_collapsed: "<<isserved_collapsed << "\n");92 if(isserved){93 _printf_(" current values: ");94 _printf_("[ ");95 for(int i=0;i<6;i++) _printf_(" "<<this->element_values[i]);96 _printf_("] ("<<EnumToStringx(this->interpolation)<<")\n");97 }98 printarray(this->values,this->M,this->N);99 //_printf_(setw(15)<<" PentaInput2 "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" "<<(value?"true":"false") << "\n");100 }101 /*}}}*/102 void PentaInput2::Echo(void){/*{{{*/103 87 _printf_("PentaInput2 Echo:\n"); 104 88 _printf_(" interpolation: "<<EnumToStringx(this->interpolation)<<"\n"); … … 123 107 } 124 108 /*}}}*/ 109 void PentaInput2::Echo(void){/*{{{*/ 110 _printf_(setw(15)<<" PentaInput "<<setw(25)<<left<<EnumToStringx(-1)); 111 if(isserved){ 112 if(isserved_collapsed){ 113 _printf_("[ "); 114 for(int i=0;i<3;i++) _printf_(" "<<this->element_values[i]); 115 _printf_("] ("<<EnumToStringx(this->interpolation)<<")\n"); 116 } 117 else{ 118 _printf_("[ "); 119 for(int i=0;i<PentaRef::NumberofNodes(this->interpolation);i++) _printf_(" "<<this->element_values[i]); 120 _printf_("] ("<<EnumToStringx(this->interpolation)<<")\n"); 121 } 122 } 123 } 124 /*}}}*/ 125 125 int PentaInput2::Id(void){/*{{{*/ 126 126 return -1;
Note:
See TracChangeset
for help on using the changeset viewer.