source:
issm/oecreview/Archive/16554-17801/ISSM-16760-16761.diff@
17802
Last change on this file since 17802 was 17802, checked in by , 11 years ago | |
---|---|
File size: 9.9 KB |
-
../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp
85 85 element->GetSolutionFromInputsOneDof(solution,WatercolumnEnum); 86 86 }/*}}}*/ 87 87 void HydrologyShreveAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/ 88 _error_("not implemented yet"); 88 89 /*Intermediary*/ 90 int* doflist = NULL; 91 92 /*Fetch number of nodes for this finite element*/ 93 int numnodes = element->GetNumberOfNodes(); 94 95 /*Fetch dof list and allocate solution vector*/ 96 element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum); 97 IssmDouble* values = xNew<IssmDouble>(numnodes); 98 99 /*Use the dof list to index into the solution vector: */ 100 for(int i=0;i<numnodes;i++){ 101 values[i]=solution[doflist[i]]; 102 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 103 if (values[i]<10e-10) values[i]=10e-10; //correcting the water column to positive values 104 } 105 106 /*Add input to the element: */ 107 element->AddInput(WatercolumnEnum,values,P1Enum); 108 109 /*Free ressources:*/ 110 xDelete<IssmDouble>(values); 111 xDelete<int>(doflist); 89 112 }/*}}}*/ -
../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
99 99 element->GetSolutionFromInputsOneDof(solution,EplHeadEnum); 100 100 }/*}}}*/ 101 101 void HydrologyDCEfficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/ 102 _error_("not implemented yet"); 102 int meshtype; 103 element->FindParam(&meshtype,MeshTypeEnum); 104 switch(meshtype){ 105 case Mesh2DhorizontalEnum: 106 element->InputUpdateFromSolutionOneDof(solution,EplHeadEnum); 107 break; 108 case Mesh3DEnum: 109 element->InputUpdateFromSolutionOneDofCollapsed(solution,EplHeadEnum); 110 break; 111 default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet"); 112 } 103 113 }/*}}}*/ -
../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
140 140 element->GetSolutionFromInputsOneDof(solution,SedimentHeadEnum); 141 141 }/*}}}*/ 142 142 void HydrologyDCInefficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/ 143 _error_("not implemented yet"); 143 144 int meshtype; 145 bool converged; 146 int* doflist=NULL; 147 Element* basalelement=NULL; 148 149 element->FindParam(&meshtype,MeshTypeEnum); 150 if(meshtype!=Mesh2DhorizontalEnum){ 151 if(!element->IsOnBed()) return; 152 basalelement=element->SpawnBasalElement(); 153 } 154 else{ 155 basalelement = element; 156 } 157 158 /*Fetch number of nodes for this finite element*/ 159 int numnodes = basalelement->GetNumberOfNodes(); 160 161 /*Fetch dof list and allocate solution vector*/ 162 basalelement->GetDofList(&doflist,NoneApproximationEnum,GsetEnum); 163 IssmDouble* values = xNew<IssmDouble>(numnodes); 164 IssmDouble* residual = xNew<IssmDouble>(numnodes); 165 166 /*Use the dof list to index into the solution vector: */ 167 for(int i=0;i<numnodes;i++){ 168 values[i] =solution[doflist[i]]; 169 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 170 } 171 172 /*If converged keep the residual in mind*/ 173 element->GetInputValue(&converged,ConvergedEnum); 174 175 /*Get inputs*/ 176 if(converged){ 177 IssmDouble penalty_factor,kmax,kappa,h_max; 178 element->FindParam(&kmax,HydrologySedimentKmaxEnum); 179 element->FindParam(&penalty_factor,HydrologydcPenaltyFactorEnum); 180 181 kappa=kmax*pow(10.,penalty_factor); 182 183 for(int i=0;i<numnodes;i++){ 184 basalelement->GetHydrologyDCInefficientHmax(&h_max,i); 185 if(values[i]>h_max) residual[i] = kappa*(values[i]-h_max); 186 else residual[i] = 0.; 187 } 188 } 189 190 /*Add input to the element: */ 191 element->AddBasalInput(SedimentHeadEnum,values,P1Enum); 192 element->AddBasalInput(SedimentHeadResidualEnum,residual,P1Enum); 193 194 /*Free ressources:*/ 195 xDelete<IssmDouble>(values); 196 xDelete<IssmDouble>(residual); 197 xDelete<int>(doflist); 198 if(meshtype!=Mesh2DhorizontalEnum) delete basalelement; 144 199 }/*}}}*/ -
../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp
73 73 _error_("not implemented yet"); 74 74 }/*}}}*/ 75 75 void L2ProjectionEPLAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/ 76 _error_("not implemented yet"); 76 int inputenum,meshtype; 77 78 element->FindParam(&inputenum,InputToL2ProjectEnum); 79 element->FindParam(&meshtype,MeshTypeEnum); 80 switch(meshtype){ 81 case Mesh2DhorizontalEnum: 82 element->InputUpdateFromSolutionOneDof(solution,inputenum); 83 break; 84 case Mesh2DverticalEnum: 85 element->InputUpdateFromSolutionOneDof(solution,inputenum); 86 break; 87 case Mesh3DEnum: 88 element->InputUpdateFromSolutionOneDofCollapsed(solution,inputenum); 89 break; 90 default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet"); 91 } 77 92 }/*}}}*/ 78 93 -
../trunk-jpl/src/c/classes/Elements/Element.h
168 168 169 169 #ifdef _HAVE_HYDROLOGY_ 170 170 virtual void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode)=0; 171 virtual void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, int index)=0; 171 172 virtual void GetHydrologyTransfer(Vector<IssmDouble>* transfer)=0; 172 173 virtual void HydrologyEPLGetMask(Vector<IssmDouble>* mask)=0; 173 174 virtual void HydrologyEPLGetActive(Vector<IssmDouble>* active)=0; -
../trunk-jpl/src/c/classes/Elements/Tria.cpp
7226 7226 *ph_max=h_max; 7227 7227 } 7228 7228 /*}}}*/ 7229 /*FUNCTION Tria::GetHydrologyDCInefficientHmax{{{*/ 7230 void Tria::GetHydrologyDCInefficientHmax(IssmDouble* ph_max,int index){ 7231 7232 int hmax_flag; 7233 IssmDouble h_max; 7234 IssmDouble rho_ice,rho_water; 7235 IssmDouble thickness,bed; 7236 /*Get the flag to the limitation method*/ 7237 this->parameters->FindParam(&hmax_flag,HydrologydcSedimentlimitFlagEnum); 7238 7239 /*Switch between the different cases*/ 7240 switch(hmax_flag){ 7241 case 0: 7242 h_max=1.0e+10; 7243 break; 7244 case 1: 7245 parameters->FindParam(&h_max,HydrologydcSedimentlimitEnum); 7246 break; 7247 case 2: 7248 rho_ice=matpar->GetRhoIce(); 7249 rho_water=matpar->GetRhoFreshwater(); 7250 this->GetInputValue(&thickness,this->nodes[index],ThicknessEnum); 7251 this->GetInputValue(&bed,this->nodes[index],BedEnum); 7252 h_max=((rho_ice*thickness)/rho_water)+bed; 7253 break; 7254 case 3: 7255 _error_("Using normal stress not supported yet"); 7256 break; 7257 default: 7258 _error_("no case higher than 3 for SedimentlimitFlag"); 7259 } 7260 /*Assign output pointer*/ 7261 *ph_max=h_max; 7262 } 7263 /*}}}*/ 7229 7264 /*FUNCTION Tria::GetHydrologyTransfer{{{*/ 7230 7265 void Tria::GetHydrologyTransfer(Vector<IssmDouble>* transfer){ 7231 7266 -
../trunk-jpl/src/c/classes/Elements/Tria.h
327 327 void InputUpdateFromSolutionHydrologyDCInefficient(IssmDouble* solution); 328 328 void InputUpdateFromSolutionHydrologyDCEfficient(IssmDouble* solution); 329 329 void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode); 330 void GetHydrologyDCInefficientHmax(IssmDouble* ph_max,int index); 330 331 void GetHydrologyTransfer(Vector<IssmDouble>* transfer); 331 332 void HydrologyEPLGetActive(Vector<IssmDouble>* active_vec); 332 333 void HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask); -
../trunk-jpl/src/c/classes/Elements/Penta.h
343 343 ElementVector* CreatePVectorHydrologyDCEfficient(void); 344 344 ElementVector* CreatePVectorL2ProjectionEPL(void); 345 345 void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode); 346 void GetHydrologyDCInefficientHmax(IssmDouble* ph_max,int index){_error_("not implemented yet");}; 346 347 void GetHydrologyTransfer(Vector<IssmDouble>* transfer); 347 348 void HydrologyEPLGetActive(Vector<IssmDouble>* active_vec); 348 349 void HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask); -
../trunk-jpl/src/c/classes/Elements/Seg.h
127 127 #endif 128 128 #ifdef _HAVE_HYDROLOGY_ 129 129 void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode){_error_("not implemented yet");}; 130 void GetHydrologyDCInefficientHmax(IssmDouble* ph_max,int index){_error_("not implemented yet");}; 130 131 void GetHydrologyTransfer(Vector<IssmDouble>* transfer){_error_("not implemented yet");}; 131 132 void HydrologyEPLGetActive(Vector<IssmDouble>* active_vec){_error_("not implemented yet");}; 132 133 void HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask){_error_("not implemented yet");};
Note:
See TracBrowser
for help on using the repository browser.