Changeset 15535 for issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
- Timestamp:
- 07/22/13 11:18:34 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r15517 r15535 1555 1555 1556 1556 /*Step1: Get and Extrude original input: */ 1557 if 1557 if(object_type==ElementEnum){ 1558 1558 num_inputs=1; 1559 1559 base_inputs=xNew<Input*>(num_inputs); 1560 1560 base_inputs[0]=(Input*)this->inputs->GetInput(enum_type); 1561 1561 } 1562 else if 1562 else if(object_type==MaterialsEnum){ 1563 1563 num_inputs=1; 1564 1564 base_inputs=xNew<Input*>(num_inputs); … … 9645 9645 void Penta::MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding){ 9646 9646 9647 int i,migration_style; 9648 bool floatingelement = false; 9649 bool groundedelement = false; 9650 IssmDouble bed_hydro,yts,gl_melting_rate; 9651 IssmDouble rho_water,rho_ice,density; 9652 IssmDouble melting[NUMVERTICES],phi[NUMVERTICES]; 9653 IssmDouble h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES]; 9647 int i,migration_style; 9648 bool floatingelement = false; 9649 bool groundedelement = false; 9650 IssmDouble bed_hydro,yts,gl_melting_rate; 9651 IssmDouble rho_water,rho_ice,density; 9652 IssmDouble h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],r[NUMVERTICES]; 9653 IssmDouble melting[NUMVERTICES],phi[NUMVERTICES]; 9654 bool grounded[NUMVERTICES],floating[NUMVERTICES]; 9654 9655 9655 9656 if(!IsOnBed()) return; … … 9662 9663 GetInputListOnVertices(&s[0],SurfaceEnum); 9663 9664 GetInputListOnVertices(&b[0],BedEnum); 9664 GetInputListOnVertices(& ba[0],BathymetryEnum);9665 GetInputListOnVertices(&r[0],BathymetryEnum); 9665 9666 if(migration_style==SubelementMigrationEnum) GetInputListOnVertices(&phi[0],GLlevelsetEnum); 9666 rho_water =matpar->GetRhoWater();9667 rho_ice =matpar->GetRhoIce();9668 density =rho_ice/rho_water;9667 rho_water = matpar->GetRhoWater(); 9668 rho_ice = matpar->GetRhoIce(); 9669 density = rho_ice/rho_water; 9669 9670 9670 9671 /*go through vertices, and update inputs, considering them to be PentaVertex type: */ … … 9672 9673 /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */ 9673 9674 if(reCast<bool,IssmDouble>(old_floating_ice[nodes[i]->Sid()])){ 9674 if(b[i]<=ba[i]){ 9675 b[i]=ba[i]; 9676 s[i]=b[i]+h[i]; 9675 if(b[i]<=r[i]){ 9676 b[i] = r[i]; 9677 s[i] = b[i]+h[i]; 9678 floating[i] = false; 9679 grounded[i] = true; 9677 9680 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false)); 9678 9681 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true)); … … 9683 9686 else{ 9684 9687 bed_hydro=-density*h[i]; 9685 if (bed_hydro>ba[i]){9688 if(bed_hydro>r[i]){ 9686 9689 /*Unground only if the element is connected to the ice shelf*/ 9687 9690 if(migration_style==AgressiveMigrationEnum || migration_style==SubelementMigrationEnum){ 9688 s[i]=(1-density)*h[i]; 9689 b[i]=-density*h[i]; 9691 s[i] = (1-density)*h[i]; 9692 b[i] = -density*h[i]; 9693 floating[i] = true; 9694 grounded[i] = false; 9690 9695 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true)); 9691 9696 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false)); 9692 9697 } 9693 9698 else if(migration_style==SoftMigrationEnum && reCast<int,IssmDouble>(sheet_ungrounding[nodes[i]->Sid()])){ 9694 s[i]=(1-density)*h[i]; 9695 b[i]=-density*h[i]; 9699 s[i] = (1-density)*h[i]; 9700 b[i] = -density*h[i]; 9701 floating[i] = true; 9702 grounded[i] = false; 9696 9703 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true)); 9697 9704 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false)); … … 9736 9743 /*Recalculate phi*/ 9737 9744 if(migration_style==SubelementMigrationEnum){ 9738 for(i=0;i<NUMVERTICES;i++) phi[i]=h[i]+ ba[i]/density;9745 for(i=0;i<NUMVERTICES;i++) phi[i]=h[i]+r[i]/density; 9739 9746 this->inputs->AddInput(new PentaInput(GLlevelsetEnum,&phi[0],P1Enum)); 9740 9747 this->InputExtrude(GLlevelsetEnum,ElementEnum); … … 9752 9759 void Penta::PotentialUngrounding(Vector<IssmDouble>* potential_ungrounding){ 9753 9760 9754 int i; 9755 IssmDouble h[NUMVERTICES],ba[NUMVERTICES]; 9761 IssmDouble h[NUMVERTICES],r[NUMVERTICES]; 9756 9762 IssmDouble bed_hydro; 9757 9763 IssmDouble rho_water,rho_ice,density; … … 9762 9768 density=rho_ice/rho_water; 9763 9769 GetInputListOnVertices(&h[0],ThicknessEnum); 9764 GetInputListOnVertices(& ba[0],BathymetryEnum);9770 GetInputListOnVertices(&r[0],BathymetryEnum); 9765 9771 9766 9772 /*go through vertices, and figure out which ones are on the ice sheet, and want to unground: */ 9767 for(i =0;i<NUMVERTICES;i++){9773 for(int i=0;i<NUMVERTICES;i++){ 9768 9774 /*Find if grounded vertices want to start floating*/ 9769 9775 if (!nodes[i]->IsFloating()){ 9770 9776 bed_hydro=-density*h[i]; 9771 if (bed_hydro>ba[i]){9777 if(bed_hydro>r[i]){ 9772 9778 /*Vertex that could potentially unground, flag it*/ 9773 9779 potential_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
Note:
See TracChangeset
for help on using the changeset viewer.