- Timestamp:
- 01/05/15 11:21:22 (10 years ago)
- File:
-
- 1 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++){
Note:
See TracChangeset
for help on using the changeset viewer.