source:
issm/oecreview/Archive/18296-19100/ISSM-19090-19091.diff
Last change on this file was 19102, checked in by , 10 years ago | |
---|---|
File size: 7.5 KB |
-
../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
645 645 xDelete<IssmDouble>(dbasis); 646 646 }/*}}}*/ 647 647 648 void HydrologyDCEfficientAnalysis::HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, int* eplzigzag_counter, Element* element){648 void HydrologyDCEfficientAnalysis::HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, Vector<IssmDouble>* recurence, int* eplzigzag_counter, Element* element){ 649 649 650 650 bool active_element; 651 651 int i,j; … … 671 671 672 672 int eplflip_lock; 673 673 int numnodes =basalelement->GetNumberOfNodes(); 674 IssmDouble new_active; 675 IssmDouble recurent; 674 676 IssmDouble* epl_thickness =xNew<IssmDouble>(numnodes); 675 677 IssmDouble* old_active =xNew<IssmDouble>(numnodes); 676 678 IssmDouble* sedhead =xNew<IssmDouble>(numnodes); … … 696 698 for(i=1;i<numnodes;i++) if(sedhead[i]<=sedheadmin)sedheadmin=sedhead[i]; 697 699 698 700 for(i=0;i<numnodes;i++){ 699 /*Activate EPL if residual is >0 */ 701 702 /*Dealing with the initial value to define zigzaging, preceding iteration the first time we see the node and current evolving vector after*/ 703 recurence->GetValue(&recurent,basalelement->nodes[i]->Sid()); 704 if (recurent>0)vec_mask->GetValue(&old_active[i],basalelement->nodes[i]->Sid()); 705 new_active=old_active[i]; 706 recurence->SetValue(basalelement->nodes[i]->Sid(),1.,ADD_VAL); 707 708 /*Now starting to look at the activations*/ 700 709 if(residual[i]>0.){ 701 if(old_active[i]==0) eplzigzag_counter[basalelement->nodes[i]->Lid()] ++;702 710 vec_mask->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL); 711 new_active=1.0; 703 712 } 704 705 713 /*If mask was already one, keep one or colapse*/ 706 714 else if(old_active[i]>0.){ 707 708 715 vec_mask->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL); 716 new_active=1.0; 709 717 /*If epl thickness gets under colapse thickness, close the layer*/ 710 718 if(epl_thickness[i]<colapse_thick){ 711 eplzigzag_counter[basalelement->nodes[i]->Lid()] ++; 712 /*Avoid flipfloping between open and closed states*/ 713 if(eplzigzag_counter[basalelement->nodes[i]->Lid()]<eplflip_lock |eplflip_lock==0){ 714 vec_mask->SetValue(basalelement->nodes[i]->Sid(),0.,INS_VAL); 715 epl_thickness[i]=init_thick; 716 } 719 vec_mask->SetValue(basalelement->nodes[i]->Sid(),0.,INS_VAL); 720 new_active=0.0; 717 721 } 718 722 } 723 724 if(basalelement->nodes[i]->Sid()==42){ 725 printf("old active is %e, and new active is %e, with counter= %i\n",old_active[i],new_active,eplzigzag_counter[basalelement->nodes[i]->Lid()]); 726 } 719 727 /*Increase of the efficient system is needed if the epl head reach the maximum value (sediment max value for now)*/ 720 728 GetHydrologyDCInefficientHmax(&h_max,basalelement,basalelement->nodes[i]); 721 729 if(eplhead[i]>=h_max && active_element){ 722 730 for(j=0;j<numnodes;j++){ 723 731 /*Increase of the domain is on the downstream node in term of sediment head*/ 724 732 if(sedhead[j] == sedheadmin){ 725 if(old_active[j]==0) { 726 eplzigzag_counter[basalelement->nodes[j]->Lid()] ++; 727 if(eplzigzag_counter[basalelement->nodes[i]->Lid()]<eplflip_lock |eplflip_lock==0){ 728 vec_mask->SetValue(basalelement->nodes[j]->Sid(),1.,INS_VAL); 729 } 730 else{ 731 vec_mask->SetValue(basalelement->nodes[j]->Sid(),0.,INS_VAL); 732 } 733 } 733 vec_mask->SetValue(basalelement->nodes[j]->Sid(),1.,INS_VAL); 734 734 } 735 735 } 736 736 } 737 /*Now checking for nodes zigzaging between open and close*/ 738 if (old_active[i] != new_active){ 739 eplzigzag_counter[basalelement->nodes[i]->Lid()] ++; 740 /*If node changed too much of state, fix it to it's last known state*/ 741 if(eplzigzag_counter[basalelement->nodes[i]->Lid()]>eplflip_lock & eplflip_lock!=0){ 742 vec_mask->SetValue(basalelement->nodes[i]->Sid(),old_active[i],INS_VAL); 743 new_active=old_active[i]; 744 } 745 } 746 /*If node is now closed bring its thickness back to initial*/ 747 if (new_active==0.){ 748 epl_thickness[i]=init_thick; 749 } 737 750 } 738 751 basalelement->AddInput(HydrologydcEplThicknessEnum,epl_thickness,basalelement->GetElementType()); 739 752 -
../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h
39 39 IssmDouble SedimentStoring(Element* element); 40 40 IssmDouble GetHydrologyKMatrixTransfer(Element* element, Gauss* gauss, Input* sed_head_input, Input* epl_head_input, Input* thick_input, Input* base_input); 41 41 IssmDouble GetHydrologyPVectorTransfer(Element* element, Gauss* gauss, Input* sed_head_input, Input* epl_head_input, Input* thick_input, Input* base_input); 42 void HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, int* eplzigzag_counter, Element* element);42 void HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, Vector<IssmDouble>* recurence, int* eplzigzag_counter, Element* element); 43 43 void HydrologyEPLGetActive(Vector<IssmDouble>* active_vec, Element* element); 44 44 void GetHydrologyDCInefficientHmax(IssmDouble* ph_max,Element* element, Node* innode); 45 45 void ComputeEPLThickness(FemModel* femmodel); -
../trunk-jpl/src/c/solutionsequences/solutionsequence_hydro_nonlinear.cpp
91 91 femmodel->UpdateConstraintsx(); 92 92 femmodel->parameters->SetParam(HydrologySedimentEnum,HydrologyLayerEnum); 93 93 94 /*Reset constraint on the ZigZag Lock , this thing doesn't work, it have to disapear*/94 /*Reset constraint on the ZigZag Lock*/ 95 95 ResetConstraintsx(femmodel); 96 96 97 97 /*{{{*//*Treating the sediment*/ -
../trunk-jpl/src/c/classes/FemModel.cpp
1912 1912 void FemModel::HydrologyEPLupdateDomainx(IssmDouble* pEplcount){ /*{{{*/ 1913 1913 1914 1914 Vector<IssmDouble>* mask = NULL; 1915 Vector<IssmDouble>* recurence = NULL; 1915 1916 IssmDouble* serial_mask = NULL; 1916 1917 Vector<IssmDouble>* active = NULL; 1917 1918 IssmDouble* serial_active = NULL; … … 1921 1922 HydrologyDCInefficientAnalysis* inefanalysis = new HydrologyDCInefficientAnalysis(); 1922 1923 /*Step 1: update mask, the mask might be extended by residual and/or using downstream sediment head*/ 1923 1924 mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum)); 1925 recurence=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum)); 1924 1926 this->parameters->FindParam(&eplzigzag_counter,NULL,EplZigZagCounterEnum); 1925 1926 1927 for (int i=0;i<elements->Size();i++){ 1927 1928 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 1928 effanalysis->HydrologyEPLGetMask(mask, eplzigzag_counter,element);1929 effanalysis->HydrologyEPLGetMask(mask,recurence,eplzigzag_counter,element); 1929 1930 } 1930 1931 this->parameters->SetParam(eplzigzag_counter,this->nodes->Size(),EplZigZagCounterEnum); 1931 1932 /*Assemble and serialize*/ … … 1933 1934 serial_mask=mask->ToMPISerial(); 1934 1935 xDelete<int>(eplzigzag_counter); 1935 1936 delete mask; 1937 delete recurence; 1936 1938 1937 1939 /*Update Mask*/ 1938 1940 InputUpdateFromVectorx(this,serial_mask,HydrologydcMaskEplactiveNodeEnum,NodeSIdEnum);
Note:
See TracBrowser
for help on using the repository browser.