Changeset 14695
- Timestamp:
- 04/22/13 13:02:02 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/objects
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
r14679 r14695 5870 5870 /* Intermediaries */ 5871 5871 IssmDouble D_scalar,Jdet; 5872 IssmDouble sediment_compressibility, sediment_porosity, sediment_thickness, 5873 sediment_transmitivity, water_compressibility, rho_freshwater, gravity, dt; 5872 IssmDouble sediment_transmitivity,dt; 5874 5873 IssmDouble sediment_storing; 5875 5874 IssmDouble xyz_list[NUMVERTICES][3]; … … 5884 5883 /*Retrieve all inputs and parameters*/ 5885 5884 GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES); 5886 sediment_compressibility = matpar->GetSedimentCompressibility(); 5887 sediment_porosity = matpar->GetSedimentPorosity(); 5888 sediment_thickness = matpar->GetSedimentThickness(); 5889 sediment_transmitivity = matpar->GetSedimentTransmitivity(); 5890 water_compressibility = matpar->GetWaterCompressibility(); 5891 rho_freshwater = matpar->GetRhoFreshwater(); 5892 gravity = matpar->GetG(); 5885 5886 sediment_storing = matpar->GetSedimentStoring(); 5887 sediment_transmitivity = matpar->GetSedimentTransmitivity(); 5893 5888 5894 5889 this->parameters->FindParam(&dt,TimesteppingTimeStepEnum); 5895 5896 /*Compute Storing coefficient from the above */5897 5898 sediment_storing = rho_freshwater*gravity*sediment_porosity*sediment_thickness*5899 (water_compressibility+(sediment_compressibility/sediment_porosity));5900 5890 5901 5891 /* Start looping on the number of gaussian points: */ … … 6010 6000 IssmDouble Jdet; 6011 6001 IssmDouble xyz_list[NUMVERTICES][3]; 6012 IssmDouble dt,gravity,scalar,water_head; 6002 IssmDouble dt,scalar,water_head; 6003 IssmDouble water_load; 6004 IssmDouble sediment_storing; 6013 6005 IssmDouble basis[numdof]; 6014 6006 GaussTria* gauss=NULL; … … 6018 6010 6019 6011 /*Retrieve all inputs and parameters*/ 6012 6013 sediment_storing = matpar->GetSedimentStoring(); 6014 6020 6015 GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES); 6021 gravity = matpar->GetG(); 6016 6017 Input* water_input=inputs->GetInput(BasalforcingsMeltingRateEnum); _assert_(water_input); 6022 6018 Input* old_wh_input=NULL; 6019 6023 6020 if(reCast<bool,IssmDouble>(dt)){ 6024 6021 old_wh_input=inputs->GetInput(SedimentHeadEnum); _assert_(old_wh_input); 6025 6022 } 6026 6023 6027 6024 /* Start looping on the number of gaussian points: */ 6028 6025 gauss=new GaussTria(2); … … 6034 6031 GetNodalFunctions(basis, gauss); 6035 6032 6036 /*Gravity term*/ 6037 scalar = Jdet*gauss->weight*gravity; 6033 /*Loading term*/ 6034 water_input->GetInputValue(&water_load,gauss); 6035 scalar = Jdet*gauss->weight*water_load; 6038 6036 if(reCast<bool,IssmDouble>(dt)) scalar = scalar*dt; 6039 6037 for(int i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i]; … … 6042 6040 if(reCast<bool,IssmDouble>(dt)){ 6043 6041 old_wh_input->GetInputValue(&water_head,gauss); 6044 scalar = Jdet*gauss->weight*water_head ;6042 scalar = Jdet*gauss->weight*water_head*sediment_storing; 6045 6043 for(int i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i]; 6046 6044 } … … 6091 6089 void Tria::InputUpdateFromSolutionHydrology(IssmDouble* solution){ 6092 6090 6091 int hydrology_model; 6092 parameters->FindParam(&hydrology_model,HydrologyEnum); 6093 6094 switch(hydrology_model){ 6095 case HydrologyshreveEnum: 6096 return InputUpdateFromSolutionHydrologyShreve(solution); 6097 case HydrologydcEnum: 6098 return InputUpdateFromSolutionHydrologyDC(solution); 6099 default: 6100 _error_("Approximation " << EnumToStringx(hydrology_model) << " not supported yet"); 6101 } 6102 } 6103 /*}}}*/ 6104 /*FUNCTION Tria::InputUpdateFromSolutionHydrologyShreve{{{*/ 6105 void Tria::InputUpdateFromSolutionHydrologyShreve(IssmDouble* solution){ 6106 6093 6107 /*Intermediaries*/ 6094 6108 const int numdof = NDOF1 *NUMVERTICES; … … 6108 6122 /*Add input to the element: */ 6109 6123 this->inputs->AddInput(new TriaP1Input(WatercolumnEnum,values)); 6124 6125 /*Free ressources:*/ 6126 xDelete<int>(doflist); 6127 } 6128 /*}}}*/ 6129 /*FUNCTION Tria::InputUpdateFromSolutionHydrologyDC{{{*/ 6130 void Tria::InputUpdateFromSolutionHydrologyDC(IssmDouble* solution){ 6131 6132 /*Intermediaries*/ 6133 const int numdof = NDOF1 *NUMVERTICES; 6134 int *doflist = NULL; 6135 IssmDouble values[numdof]; 6136 6137 /*Get dof list: */ 6138 GetDofList(&doflist,NoneApproximationEnum,GsetEnum); 6139 6140 /*Use the dof list to index into the solution vector: */ 6141 for(int i=0;i<numdof;i++){ 6142 values[i]=solution[doflist[i]]; 6143 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 6144 } 6145 6146 /*Add input to the element: */ 6147 this->inputs->AddInput(new TriaP1Input(SedimentHeadEnum,values)); 6110 6148 6111 6149 /*Free ressources:*/ -
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h
r14650 r14695 244 244 ElementVector* CreatePVectorHydrologyShreve(void); 245 245 ElementVector* CreatePVectorHydrologyDC(void); 246 void 246 void CreateHydrologyWaterVelocityInput(void); 247 247 void GetSolutionFromInputsHydrology(Vector<IssmDouble>* solution); 248 248 void InputUpdateFromSolutionHydrology(IssmDouble* solution); 249 void InputUpdateFromSolutionHydrologyShreve(IssmDouble* solution); 250 void InputUpdateFromSolutionHydrologyDC(IssmDouble* solution); 249 251 #endif 250 252 #ifdef _HAVE_BALANCED_ -
issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp
r14655 r14695 315 315 } 316 316 /*}}}*/ 317 /*FUNCTION Matpar::GetSedimentCompressibility {{{*/ 318 IssmDouble Matpar::GetSedimentCompressibility(){ 319 return sediment_compressibility; 320 } 321 /*}}}*/ 322 /*FUNCTION Matpar::GetSedimentPorosity {{{*/ 323 IssmDouble Matpar::GetSedimentPorosity(){ 324 return sediment_porosity; 325 } 326 /*}}}*/ 327 /*FUNCTION Matpar::GetSedimentThickness {{{*/ 328 IssmDouble Matpar::GetSedimentThickness(){ 329 return sediment_thickness; 317 /*FUNCTION Matpar::GetSedimentStoring {{{*/ 318 IssmDouble Matpar::GetSedimentStoring(){ 319 return this->rho_freshwater* this->g* this->sediment_porosity* this->sediment_thickness* 320 ( this->water_compressibility+( this->sediment_compressibility/ this->sediment_porosity)); 330 321 } 331 322 /*}}}*/ … … 334 325 return sediment_transmitivity; 335 326 } 336 /*}}}*/337 /*FUNCTION Matpar::GetWaterCompressibility {{{*/338 IssmDouble Matpar::GetWaterCompressibility(){339 return water_compressibility;340 }341 327 /*}}}*/ 342 328 /*FUNCTION Matpar::TMeltingPoint {{{*/ -
issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h
r14660 r14695 106 106 IssmDouble GetHydrologyCR(); 107 107 IssmDouble GetHydrologyN(); 108 IssmDouble GetSedimentCompressibility(); 109 IssmDouble GetSedimentPorosity(); 110 IssmDouble GetSedimentThickness(); 108 IssmDouble GetSedimentStoring(); 111 109 IssmDouble GetSedimentTransmitivity(); 112 IssmDouble GetWaterCompressibility();113 110 IssmDouble TMeltingPoint(IssmDouble pressure); 114 111 IssmDouble PureIceEnthalpy(IssmDouble pressure);
Note:
See TracChangeset
for help on using the changeset viewer.