Changeset 18975
- Timestamp:
- 01/05/15 11:21:22 (10 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
r18903 r18975 24 24 iomodel->Constant(&isefficientlayer,HydrologydcIsefficientlayerEnum); 25 25 26 /*If not return*/ 26 27 if(!isefficientlayer) return; 28 29 /*If yes, initialize a flip flop counter*/ 27 30 iomodel->FetchData(&eplflip_lock,HydrologydcEplflipLockEnum); 28 29 31 parameters->AddObject(new IntParam(HydrologydcEplflipLockEnum,eplflip_lock)); 30 32 31 /*Nothing for now*/32 33 }/*}}}*/ 33 34 void HydrologyDCEfficientAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/ … … 35 36 bool isefficientlayer; 36 37 int hydrology_model; 37 38 38 39 39 /*Now, do we really want DC?*/ … … 61 61 iomodel->FetchDataToInput(elements,HydrologydcEplInitialThicknessEnum); 62 62 iomodel->FetchDataToInput(elements,HydrologydcEplMaxThicknessEnum); 63 iomodel->FetchDataToInput(elements,HydrologydcSedimentTransmitivityEnum);64 63 iomodel->FetchDataToInput(elements,HydrologydcEplThicknessEnum); 65 if(iomodel->domaintype!=Domain2DhorizontalEnum){64 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 66 65 iomodel->FetchDataToInput(elements,MeshVertexonbaseEnum); 67 66 iomodel->FetchDataToInput(elements,MeshVertexonsurfaceEnum); … … 85 84 iomodel->DeleteData(2,MeshVertexonbaseEnum,MeshVertexonsurfaceEnum); 86 85 }/*}}}*/ 86 87 87 void HydrologyDCEfficientAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/ 88 88 … … 98 98 99 99 IoModelToConstraintsx(constraints,iomodel,HydrologydcSpceplHeadEnum,HydrologyDCEfficientAnalysisEnum,P1Enum); 100 101 }/*}}}*/ 100 }/*}}}*/ 101 102 102 void HydrologyDCEfficientAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/ 103 103 /*Nothing for now*/ … … 131 131 }/*}}}*/ 132 132 133 133 ElementVector* HydrologyDCEfficientAnalysis::CreateDVector(Element* element){/*{{{*/ 134 134 /*Default, return NULL*/ 135 135 return NULL; 136 136 }/*}}}*/ 137 137 138 138 ElementMatrix* HydrologyDCEfficientAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/ 139 139 _error_("Not implemented"); 140 140 }/*}}}*/ 141 141 142 142 ElementMatrix* HydrologyDCEfficientAnalysis::CreateKMatrix(Element* element){/*{{{*/ 143 143 144 144 /*Intermediaries*/ … … 244 244 if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;}; 245 245 return Ke; 246 247 }/*}}}*/ 246 }/*}}}*/ 247 248 248 ElementVector* HydrologyDCEfficientAnalysis::CreatePVector(Element* element){/*{{{*/ 249 249 … … 348 348 return pe; 349 349 }/*}}}*/ 350 350 351 void HydrologyDCEfficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/ 351 352 element->GetSolutionFromInputsOneDof(solution,EplHeadEnum); 352 353 }/*}}}*/ 354 353 355 void HydrologyDCEfficientAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/ 354 356 _error_("Not implemented yet"); 355 357 }/*}}}*/ 358 356 359 void HydrologyDCEfficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/ 357 360 … … 375 378 /*Fetch number of nodes for this finite element*/ 376 379 int numnodes = basalelement->GetNumberOfNodes(); 377 378 380 379 381 /*Fetch dof list and allocate solution vector*/ … … 401 403 if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;}; 402 404 } /*}}}*/ 405 403 406 void HydrologyDCEfficientAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/ 404 407 /*Default, do nothing*/ … … 415 418 return rho_freshwater*g*epl_porosity*(water_compressibility+(epl_compressibility/epl_porosity)); 416 419 }/*}}}*/ 420 417 421 IssmDouble HydrologyDCEfficientAnalysis::SedimentStoring(Element* element){/*{{{*/ 418 422 IssmDouble rho_freshwater = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum); … … 535 539 _error_("not Implemented Yet"); 536 540 } 537 541 538 542 int numnodes = element->GetNumberOfNodes(); 539 543 IssmDouble* thickness = xNew<IssmDouble>(numnodes); … … 602 606 xDelete<IssmDouble>(bed); 603 607 } 604 } 605 /*}}}*/ 608 }/*}}}*/ 609 606 610 void HydrologyDCEfficientAnalysis::GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/ 607 611 /*Compute B matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. … … 631 635 xDelete<IssmDouble>(dbasis); 632 636 }/*}}}*/ 637 633 638 void HydrologyDCEfficientAnalysis::HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, int* eplzigzag_counter, Element* element){ 634 639 … … 655 660 /*Intermediaries*/ 656 661 657 int penalty_lock;662 int eplflip_lock; 658 663 int numnodes =basalelement->GetNumberOfNodes(); 659 664 IssmDouble* epl_thickness =xNew<IssmDouble>(numnodes); … … 669 674 active_element_input->GetInputValue(&active_element); 670 675 671 basalelement->parameters->FindParam(& penalty_lock,HydrologydcEplflipLockEnum);676 basalelement->parameters->FindParam(&eplflip_lock,HydrologydcEplflipLockEnum); 672 677 673 678 basalelement-> GetInputListOnVertices(&old_active[0],HydrologydcMaskEplactiveNodeEnum); … … 691 696 else if(old_active[i]>0.){ 692 697 vec_mask->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL); 693 /*If epl thickness gets under 10-3 initialthickness, close the layer*/698 /*If epl thickness gets under colapse thickness, close the layer*/ 694 699 if(epl_thickness[i]<colapse_thick){ 695 700 eplzigzag_counter[basalelement->nodes[i]->Lid()] ++; 696 if(eplzigzag_counter[basalelement->nodes[i]->Lid()]<penalty_lock |penalty_lock==0){ 701 /*Avoid flipfloping between open and closed states*/ 702 if(eplzigzag_counter[basalelement->nodes[i]->Lid()]<eplflip_lock |eplflip_lock==0){ 697 703 vec_mask->SetValue(basalelement->nodes[i]->Sid(),0.,INS_VAL); 698 704 epl_thickness[i]=init_thick; … … 705 711 /*Increase of the efficient system is needed if the epl head reach the maximum value (sediment max value for now)*/ 706 712 GetHydrologyDCInefficientHmax(&h_max,basalelement,basalelement->nodes[i]); 707 708 713 if(eplhead[i]>=h_max && active_element){ 709 714 for(j=0;j<numnodes;j++){ … … 729 734 } 730 735 /*}}}*/ 736 731 737 void HydrologyDCEfficientAnalysis::HydrologyEPLGetActive(Vector<IssmDouble>* active_vec, Element* element){ 732 738 /*Constants*/ … … 750 756 IssmDouble flag = 0.; 751 757 IssmDouble* active = xNew<IssmDouble>(numnodes); 752 758 759 /*Pass the activity mask from elements to nodes*/ 753 760 basalelement->GetInputListOnVertices(&active[0],HydrologydcMaskEplactiveNodeEnum); 754 761 bool active_element; … … 758 765 for(int i=0;i<numnodes;i++) flag+=active[i]; 759 766 767 /*If any node is active all the node in the element are active*/ 760 768 if(flag>0.){ 761 769 for(int i=0;i<numnodes;i++){ … … 763 771 } 764 772 } 773 /*If the element is active all its nodes are active*/ 765 774 else if(active_element){ 766 775 for(int i=0;i<numnodes;i++){ -
issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
r18903 r18975 10 10 return 1; 11 11 }/*}}}*/ 12 12 13 void HydrologyDCInefficientAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ 13 14 … … 17 18 int penalty_lock; 18 19 int hydro_maxiter; 19 /* int* elementactive_counter =NULL; */20 20 bool isefficientlayer; 21 21 IssmDouble sedimentlimit; … … 56 56 parameters->AddObject(new IntParam(HydrologydcPenaltyLockEnum,penalty_lock)); 57 57 parameters->AddObject(new IntParam(HydrologydcMaxIterEnum,hydro_maxiter)); 58 59 }/*}}}*/ 58 }/*}}}*/ 59 60 60 void HydrologyDCInefficientAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/ 61 61 … … 97 97 if(isefficientlayer){ 98 98 iomodel->FetchDataToInput(elements,HydrologydcMaskEplactiveNodeEnum); 99 100 /* for(int i=0;i<elements->Size();i++){ */ 101 /* Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); */ 102 /* Input* node_mask_input = element->GetInput(HydrologydcMaskEplactiveNodeEnum); _assert_(node_mask_input); */ 103 104 /* if(node_mask_input->Max()>0.) { */ 105 /* element_active = true; */ 106 /* } */ 107 /* else{ */ 108 /* element_active = false; */ 109 /* } */ 110 /* element->AddInput(new BoolInput(HydrologydcMaskEplactiveEltEnum,element_active)); */ 111 /* } */ 112 } 113 }/*}}}*/ 99 } 100 }/*}}}*/ 101 114 102 void HydrologyDCInefficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ 115 103 … … 125 113 iomodel->DeleteData(2,MeshVertexonbaseEnum,MeshVertexonsurfaceEnum); 126 114 }/*}}}*/ 115 127 116 void HydrologyDCInefficientAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/ 128 117 … … 134 123 IoModelToConstraintsx(constraints,iomodel,HydrologydcSpcsedimentHeadEnum,HydrologyDCInefficientAnalysisEnum,P1Enum); 135 124 }/*}}}*/ 125 136 126 void HydrologyDCInefficientAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/ 137 127 … … 165 155 _error_("not implemented"); 166 156 }/*}}}*/ 157 167 158 ElementVector* HydrologyDCInefficientAnalysis::CreateDVector(Element* element){/*{{{*/ 168 159 /*Default, return NULL*/ 169 160 return NULL; 170 161 }/*}}}*/ 162 171 163 ElementMatrix* HydrologyDCInefficientAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/ 172 164 _error_("Not implemented"); 173 165 }/*}}}*/ 166 174 167 ElementMatrix* HydrologyDCInefficientAnalysis::CreateKMatrix(Element* element){/*{{{*/ 175 168 … … 275 268 return Ke; 276 269 }/*}}}*/ 270 277 271 ElementVector* HydrologyDCInefficientAnalysis::CreatePVector(Element* element){/*{{{*/ 278 272 … … 312 306 IssmDouble* basis = xNew<IssmDouble>(numnodes); 313 307 314 315 308 /*Retrieve all inputs and parameters*/ 316 309 basalelement->GetVerticesCoordinates(&xyz_list); … … 342 335 /*Loading term*/ 343 336 water_input->GetInputValue(&water_load,gauss); 344 345 337 scalar = Jdet*gauss->weight*(water_load); 346 347 338 if(dt!=0.) scalar = scalar*dt; 348 339 for(int i=0;i<numnodes;i++){ … … 378 369 return pe; 379 370 }/*}}}*/ 371 380 372 void HydrologyDCInefficientAnalysis::GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/ 381 373 /*Compute B matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. … … 405 397 xDelete<IssmDouble>(dbasis); 406 398 }/*}}}*/ 399 407 400 void HydrologyDCInefficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/ 408 401 element->GetSolutionFromInputsOneDof(solution,SedimentHeadEnum); 409 402 }/*}}}*/ 403 410 404 void HydrologyDCInefficientAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/ 411 405 _error_("Not implemented yet"); 412 406 }/*}}}*/ 407 413 408 void HydrologyDCInefficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/ 414 409 … … 489 484 if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;}; 490 485 }/*}}}*/ 486 491 487 void HydrologyDCInefficientAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/ 492 488 /*Default, do nothing*/ … … 551 547 return h_max; 552 548 }/*}}}*/ 549 553 550 void HydrologyDCInefficientAnalysis::GetHydrologyDCInefficientHmax(IssmDouble* ph_max,Element* element, Node* innode){/*{{{*/ 554 551 -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r18953 r18975 1979 1979 counter=sum_counter; 1980 1980 if(VerboseSolution()) _printf0_(" Number of active nodes L2 Projection: "<< counter <<"\n"); 1981 1982 /*+++++++this is done in the solution sequence+++++++++++++++*/ 1983 /*Update dof indexings*/ 1984 // this->UpdateConstraintsx(); 1985 /*++++++++++++++++++++++++++*/ 1986 } 1987 /*}}}*/ 1981 } 1982 /*}}}*/ -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_hydro_nonlinear.cpp
r18726 r18975 127 127 128 128 /*}}}*//*End of the sediment penalization loop*/ 129 /*Update EPL mask*/130 131 /*++++++This is probably useless+++++++*/132 /* if(isefficientlayer){ */133 /* inefanalysis->ElementizeEplMask(femmodel); */134 /* } */135 /*+++++++++++++*/136 137 129 sedconverged=false; 138 130
Note:
See TracChangeset
for help on using the changeset viewer.