- Timestamp:
- 12/07/16 02:45:35 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
r21433 r21434 151 151 152 152 int* eplzigzag_counter=NULL; 153 Element* element=NULL;154 153 femmodel->parameters->FindParam(&eplzigzag_counter,NULL,EplZigZagCounterEnum); 155 154 for(int i=0;i<femmodel->nodes->Size();i++){ … … 381 380 pe->values[iv]+=residual/connectivity; 382 381 } 383 384 382 /*Clean up and return*/ 385 383 xDelete<IssmDouble>(xyz_list); … … 399 397 400 398 void HydrologyDCEfficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/ 401 402 399 /*Intermediaries*/ 403 400 bool active_element; … … 417 414 default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet"); 418 415 } 419 420 416 /*Intermediary*/ 421 417 int* doflist = NULL; … … 425 421 426 422 /*Fetch dof list and allocate solution vector*/ 427 IssmDouble* sedhead = xNew<IssmDouble>(numnodes);428 423 IssmDouble* eplHeads = xNew<IssmDouble>(numnodes); 429 430 424 basalelement->GetDofList(&doflist,NoneApproximationEnum,GsetEnum); 431 basalelement->GetInputListOnVertices(&sedhead[0],SedimentHeadEnum);432 425 433 426 Input* active_element_input=basalelement->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input); … … 435 428 436 429 /*Use the dof list to index into the solution vector: */ 437 for(int i=0;i<numnodes;i++){ 438 eplHeads[i]=solution[doflist[i]]; 439 if(xIsNan<IssmDouble>(eplHeads[i])) _error_("NaN found in solution vector"); 440 if(xIsInf<IssmDouble>(eplHeads[i])) _error_("Inf found in solution vector"); 430 /*If the EPL is not active we revert to the initialisation vallue*/ 431 /* For now we keep OldValue but it is probably not the best*/ 432 if(active_element){ 433 for(int i=0;i<numnodes;i++){ 434 eplHeads[i]=solution[doflist[i]]; 435 if(xIsNan<IssmDouble>(eplHeads[i])) _error_("NaN found in solution vector"); 436 if(xIsInf<IssmDouble>(eplHeads[i])) _error_("Inf found in solution vector"); 437 } 438 } 439 else{ 440 basalelement->GetInputListOnVertices(&eplHeads[0],EplHeadOldEnum); 441 for(int i=0;i<numnodes;i++){ 442 if(xIsNan<IssmDouble>(eplHeads[i])) _error_("NaN found in solution vector"); 443 if(xIsInf<IssmDouble>(eplHeads[i])) _error_("Inf found in solution vector"); 444 } 441 445 } 442 446 /*Add input to the element: */ 443 447 element->AddBasalInput(EplHeadEnum,eplHeads,P1Enum); 444 445 448 /*Free ressources:*/ 446 449 xDelete<IssmDouble>(eplHeads); 447 xDelete<IssmDouble>(sedhead);448 450 xDelete<int>(doflist); 449 451 if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
Note:
See TracChangeset
for help on using the changeset viewer.