Changeset 21797
- Timestamp:
- 07/14/17 10:41:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
r21794 r21797 469 469 470 470 /*Intermediaries */ 471 int migration_style,point1; 472 bool mainlyfloating; 473 IssmDouble fraction1,fraction2; 471 474 IssmDouble Jdet,dt; 472 475 IssmDouble ms,mb,gmb,fmb,thickness; 473 476 IssmDouble gllevelset,phi=1.; 474 477 IssmDouble* xyz_list = NULL; 478 Gauss* gauss = NULL; 475 479 476 480 /*Fetch number of nodes and dof for this finite element*/ … … 490 494 Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input); 491 495 496 /*Recover portion of element that is grounded*/ 497 phi=element->GetGroundedPortion(xyz_list); 498 if(migration_style==SubelementMigration2Enum){ 499 gllevelset_input=element->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input); 500 element->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating); 501 gauss = element->NewGauss(point1,fraction1,fraction2,mainlyfloating,3); 502 } 503 else{ 504 gauss = element->NewGauss(3); 505 } 506 492 507 /* Start looping on the number of gaussian points: */ 493 Gauss* gauss=element->NewGauss(2);494 508 for(int ig=gauss->begin();ig<gauss->end();ig++){ 495 509 gauss->GaussPoint(ig); … … 501 515 gmb_input->GetInputValue(&gmb,gauss); 502 516 fmb_input->GetInputValue(&fmb,gauss); 503 gllevelset_input->GetInputValue(& phi,gauss);517 gllevelset_input->GetInputValue(&gllevelset,gauss); 504 518 thickness_input->GetInputValue(&thickness,gauss); 505 if(phi>0.) mb=gmb; 506 else mb=fmb; 519 520 if(migration_style==SubelementMigrationEnum){ 521 if (phi<0.00000001) mb=gmb; 522 else mb=(1-phi)*fmb+phi*gmb; // phi is the fraction of grounded ice so (1-phi) is floating 523 } 524 else if(migration_style==SubelementMigration2Enum){ 525 if(gllevelset>0.) mb=gmb; 526 else mb=fmb; 527 } 528 else if(migration_style==SubelementMigration3Enum){ 529 if (phi<0.00000001) mb=gmb; 530 else mb=gmb; 531 } 532 else{ 533 if(gllevelset>0) mb=gmb; 534 else mb=fmb; 535 } 507 536 508 537 for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb))*basis[i]; … … 521 550 522 551 /*Intermediaries */ 523 int migration_style,point1; 524 bool mainlyfloating; 525 IssmDouble Jdet,fraction1,fraction2; 526 IssmDouble dt,gllevelset; 552 IssmDouble Jdet,dt; 527 553 IssmDouble ms,mb,gmb,fmb,thickness,phi=1.; 528 554 IssmDouble* xyz_list = NULL; 529 Gauss* gauss = NULL;530 555 531 556 /*Fetch number of nodes and dof for this finite element*/ … … 545 570 Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input); 546 571 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 558 572 /* Start looping on the number of gaussian points: */ 573 Gauss* gauss=element->NewGauss(2); 559 574 for(int ig=gauss->begin();ig<gauss->end();ig++){ 560 575 gauss->GaussPoint(ig); … … 566 581 gmb_input->GetInputValue(&gmb,gauss); 567 582 fmb_input->GetInputValue(&fmb,gauss); 568 gllevelset_input->GetInputValue(& gllevelset,gauss);583 gllevelset_input->GetInputValue(&phi,gauss); 569 584 thickness_input->GetInputValue(&thickness,gauss); 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 } 585 586 if(phi>0.) mb=gmb; 587 else mb=fmb; 586 588 587 589 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.