Changeset 21794
- Timestamp:
- 07/13/17 17:02:28 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp ¶
r21719 r21794 470 470 /*Intermediaries */ 471 471 IssmDouble Jdet,dt; 472 IssmDouble ms,mb,gmb,fmb,thickness,phi; 472 IssmDouble ms,mb,gmb,fmb,thickness; 473 IssmDouble gllevelset,phi=1.; 473 474 IssmDouble* xyz_list = NULL; 474 475 … … 485 486 Input* gmb_input = element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(gmb_input); 486 487 Input* fmb_input = element->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(fmb_input); 487 Input* g roundedice_input = element->GetInput(MaskGroundediceLevelsetEnum); _assert_(groundedice_input);488 Input* gllevelset_input = element->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input); 488 489 Input* ms_input = element->GetInput(SmbMassBalanceEnum); _assert_(ms_input); 489 490 Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input); … … 500 501 gmb_input->GetInputValue(&gmb,gauss); 501 502 fmb_input->GetInputValue(&fmb,gauss); 502 g roundedice_input->GetInputValue(&phi,gauss);503 gllevelset_input->GetInputValue(&phi,gauss); 503 504 thickness_input->GetInputValue(&thickness,gauss); 504 505 if(phi>0.) mb=gmb; … … 520 521 521 522 /*Intermediaries */ 522 IssmDouble Jdet,dt; 523 IssmDouble ms,mb,gmb,fmb,thickness,phi; 523 int migration_style,point1; 524 bool mainlyfloating; 525 IssmDouble Jdet,fraction1,fraction2; 526 IssmDouble dt,gllevelset; 527 IssmDouble ms,mb,gmb,fmb,thickness,phi=1.; 524 528 IssmDouble* xyz_list = NULL; 529 Gauss* gauss = NULL; 525 530 526 531 /*Fetch number of nodes and dof for this finite element*/ … … 537 542 Input* fmb_input = element->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(fmb_input); 538 543 Input* ms_input = element->GetInput(SmbMassBalanceEnum); _assert_(ms_input); 539 Input* g roundedice_input = element->GetInput(MaskGroundediceLevelsetEnum); _assert_(groundedice_input);544 Input* gllevelset_input = element->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input); 540 545 Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input); 541 546 547 /*Recover portion of element that is grounded*/ 548 phi=element->GetGroundedPortion(xyz_list); 549 if(migration_style==SubelementMigration2Enum){ 550 gllevelset_input=element->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input); 551 element->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating); 552 gauss = element->NewGauss(point1,fraction1,fraction2,mainlyfloating,3); 553 } 554 else{ 555 gauss = element->NewGauss(3); 556 } 557 542 558 /* Start looping on the number of gaussian points: */ 543 Gauss* gauss=element->NewGauss(2);544 559 for(int ig=gauss->begin();ig<gauss->end();ig++){ 545 560 gauss->GaussPoint(ig); … … 551 566 gmb_input->GetInputValue(&gmb,gauss); 552 567 fmb_input->GetInputValue(&fmb,gauss); 553 g roundedice_input->GetInputValue(&phi,gauss);568 gllevelset_input->GetInputValue(&gllevelset,gauss); 554 569 thickness_input->GetInputValue(&thickness,gauss); 555 if(phi>0) mb=gmb; 556 else mb=fmb; 570 if(migration_style==SubelementMigrationEnum){ 571 if (phi<0.00000001) mb=gmb; 572 else mb=(1-phi)*fmb+phi*gmb; // phi is the fraction of grounded ice so (1-phi) is floating 573 } 574 else if(migration_style==SubelementMigration2Enum){ 575 if(gllevelset>0.) mb=gmb; 576 else mb=fmb; 577 } 578 else if(migration_style==SubelementMigration3Enum){ 579 if (phi<0.00000001) mb=gmb; 580 else mb=gmb; 581 } 582 else{ 583 if(gllevelset>0) mb=gmb; 584 else mb=fmb; 585 } 557 586 558 587 for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb))*basis[i];
Note:
See TracChangeset
for help on using the changeset viewer.