Changeset 18860


Ignore:
Timestamp:
11/25/14 14:11:13 (10 years ago)
Author:
hongjuy
Message:

CHG: add support of FSContactMigration for coupling

Location:
issm/trunk-jpl/src/c/classes/Elements
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r18855 r18860  
    688688        if(!IsOnBase()) return;
    689689
    690         /*Intermediaries*/
    691         IssmDouble* xyz_list = NULL;
    692         IssmDouble  pressure,water_pressure,sigma_nn,viscosity,bed,base;
    693         IssmDouble  bed_normal[3];
    694         IssmDouble  epsilon[6]; /* epsilon=[exx eyy ezz exy exz eyz];*/
    695         IssmDouble  surface=0,value=0;
    696         bool grounded;
    697 
    698         /* Get node coordinates and dof list: */
    699         GetVerticesCoordinates(&xyz_list);
    700 
    701         /*Retrieve all inputs we will be needing: */
    702         Input* pressure_input = inputs->GetInput(PressureEnum); _assert_(pressure_input);
    703         Input* base_input     = inputs->GetInput(BaseEnum);     _assert_(base_input);
    704         Input* bed_input      = inputs->GetInput(BedEnum);      _assert_(bed_input);
    705         Input* vx_input       = inputs->GetInput(VxEnum);       _assert_(vx_input);
    706         Input* vy_input       = inputs->GetInput(VyEnum);       _assert_(vy_input);
    707         Input* vz_input       = inputs->GetInput(VzEnum);       _assert_(vz_input);
    708 
    709         /*Create gauss point in the middle of the basal edge*/
    710         Gauss* gauss=NewGaussBase(1);
    711         gauss->GaussPoint(0);
    712 
    713         if(!IsFloating()){
    714                 /*Check for basal force only if grounded and touching GL*/
    715                 if(this->inputs->Min(MaskGroundediceLevelsetEnum)==0.){
     690        int approximation;
     691        inputs->GetInputValue(&approximation,ApproximationEnum);
     692        if(approximation==HOApproximationEnum || approximation==SSAApproximationEnum || approximation==SSAHOApproximationEnum){
     693                for(int i=0;i<NUMVERTICES;i++){
     694                        vertexgrounded->SetValue(vertices[i]->Pid(),+9999.,INS_VAL);
     695                        vertexfloating->SetValue(vertices[i]->Pid(),+9999.,INS_VAL);
     696                }
     697        }
     698        else {
     699                /*Intermediaries*/
     700                IssmDouble* xyz_list = NULL;
     701                IssmDouble  pressure,water_pressure,sigma_nn,viscosity,bed,base;
     702                IssmDouble  bed_normal[3];
     703                IssmDouble  epsilon[6]; /* epsilon=[exx eyy ezz exy exz eyz];*/
     704                IssmDouble  surface=0,value=0;
     705                bool grounded;
     706
     707                /* Get node coordinates and dof list: */
     708                GetVerticesCoordinates(&xyz_list);
     709
     710                /*Retrieve all inputs we will be needing: */
     711                Input* pressure_input = inputs->GetInput(PressureEnum); _assert_(pressure_input);
     712                Input* base_input     = inputs->GetInput(BaseEnum);     _assert_(base_input);
     713                Input* bed_input      = inputs->GetInput(BedEnum);      _assert_(bed_input);
     714                Input* vx_input       = inputs->GetInput(VxEnum);       _assert_(vx_input);
     715                Input* vy_input       = inputs->GetInput(VyEnum);       _assert_(vy_input);
     716                Input* vz_input       = inputs->GetInput(VzEnum);       _assert_(vz_input);
     717
     718                /*Create gauss point in the middle of the basal edge*/
     719                Gauss* gauss=NewGaussBase(1);
     720                gauss->GaussPoint(0);
     721
     722                if(!IsFloating()){
     723                        /*Check for basal force only if grounded and touching GL*/
    716724                        this->StrainRateFS(&epsilon[0],xyz_list,gauss,vx_input,vy_input,vz_input);
    717725                        this->ViscosityFS(&viscosity,3,xyz_list,gauss,vx_input,vy_input,vz_input);
     
    745753                }
    746754                else{
    747                         grounded=true;
    748                 }
    749         }
    750         else{
    751                 /*Check for basal elevation if floating*/
    752                 base_input->GetInputValue(&base, gauss);
    753                 bed_input->GetInputValue(&bed, gauss);
    754                 if (base<bed) grounded=true;
    755                 else          grounded=false;
    756         }
    757         for(int i=0;i<NUMVERTICES;i++){
    758                 if(grounded) vertexgrounded->SetValue(vertices[i]->Pid(),+1.,INS_VAL);
    759                 else         vertexfloating->SetValue(vertices[i]->Pid(),+1.,INS_VAL);
    760         }
    761 
    762         /*clean up*/
    763         delete gauss;
    764         xDelete<IssmDouble>(xyz_list);
     755                        /*Check for basal elevation if floating*/
     756                        base_input->GetInputValue(&base, gauss);
     757                        bed_input->GetInputValue(&bed, gauss);
     758                        if(base<bed) grounded=true;
     759                        else          grounded=false;
     760                }
     761                for(int i=0;i<NUMVERTICES;i++){
     762                        if(grounded) vertexgrounded->SetValue(vertices[i]->Pid(),+1.,INS_VAL);
     763                        else         vertexfloating->SetValue(vertices[i]->Pid(),+1.,INS_VAL);
     764                }
     765
     766                /*clean up*/
     767                delete gauss;
     768                xDelete<IssmDouble>(xyz_list);
     769        }
    765770}
    766771/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r18855 r18860  
    15471547        if(!IsOnBase()) return;
    15481548
    1549         /*Intermediaries*/
    1550         IssmDouble* xyz_list = NULL;
    1551         IssmDouble* xyz_list_base = NULL;
    1552         IssmDouble  pressure,water_pressure,sigma_nn,viscosity,bed,base;
    1553         IssmDouble  bed_normal[2];
    1554         IssmDouble  epsilon[3]; /* epsilon=[exx,eyy,exy];*/
    1555         IssmDouble  surface=0,value=0;
    1556         bool grounded;
    1557 
    1558         /* Get node coordinates and dof list: */
    1559         GetVerticesCoordinates(&xyz_list);
    1560         GetVerticesCoordinatesBase(&xyz_list_base);
    1561 
    1562         /*Retrieve all inputs we will be needing: */
    1563         Input* pressure_input = inputs->GetInput(PressureEnum); _assert_(pressure_input);
    1564         Input* base_input     = inputs->GetInput(BaseEnum);     _assert_(base_input);
    1565         Input* bed_input      = inputs->GetInput(BedEnum);      _assert_(bed_input);
    1566         Input* vx_input       = inputs->GetInput(VxEnum);       _assert_(vx_input);
    1567         Input* vy_input       = inputs->GetInput(VyEnum);       _assert_(vy_input);
    1568 
    1569         /*Create gauss point in the middle of the basal edge*/
    1570         Gauss* gauss=NewGaussBase(1);
    1571         gauss->GaussPoint(0);
    1572 
    1573         if(!IsFloating()){
    1574                 /*Check for basal force only if grounded and touching GL*/
    1575                 if(this->inputs->Min(MaskGroundediceLevelsetEnum)==0.){
     1549        int approximation;
     1550        inputs->GetInputValue(&approximation,ApproximationEnum);
     1551
     1552        if(approximation==HOApproximationEnum || approximation==SSAApproximationEnum || approximation==SSAHOApproximationEnum){
     1553                for(int i=0;i<NUMVERTICES;i++){
     1554                        vertexgrounded->SetValue(vertices[i]->Pid(),+9999.,INS_VAL);
     1555                        vertexfloating->SetValue(vertices[i]->Pid(),+9999.,INS_VAL);
     1556                }
     1557        }
     1558        else{
     1559                /*Intermediaries*/
     1560                IssmDouble* xyz_list = NULL;
     1561                IssmDouble* xyz_list_base = NULL;
     1562                IssmDouble  pressure,water_pressure,sigma_nn,viscosity,bed,base;
     1563                IssmDouble  bed_normal[2];
     1564                IssmDouble  epsilon[3]; /* epsilon=[exx,eyy,exy];*/
     1565                IssmDouble  surface=0,value=0;
     1566                bool grounded;
     1567
     1568                /* Get node coordinates and dof list: */
     1569                GetVerticesCoordinates(&xyz_list);
     1570                GetVerticesCoordinatesBase(&xyz_list_base);
     1571
     1572                /*Retrieve all inputs we will be needing: */
     1573                Input* pressure_input = inputs->GetInput(PressureEnum); _assert_(pressure_input);
     1574                Input* base_input     = inputs->GetInput(BaseEnum);     _assert_(base_input);
     1575                Input* bed_input      = inputs->GetInput(BedEnum);      _assert_(bed_input);
     1576                Input* vx_input       = inputs->GetInput(VxEnum);       _assert_(vx_input);
     1577                Input* vy_input       = inputs->GetInput(VyEnum);       _assert_(vy_input);
     1578
     1579                /*Create gauss point in the middle of the basal edge*/
     1580                Gauss* gauss=NewGaussBase(1);
     1581                gauss->GaussPoint(0);
     1582
     1583                if(!IsFloating()){
     1584                        /*Check for basal force only if grounded and touching GL*/
     1585                        //              if(this->inputs->Min(MaskGroundediceLevelsetEnum)==0.){
    15761586                        this->StrainRateSSA(&epsilon[0],xyz_list,gauss,vx_input,vy_input);
    15771587                        this->ViscosityFS(&viscosity,2,xyz_list,gauss,vx_input,vy_input,NULL);
    15781588                        pressure_input->GetInputValue(&pressure, gauss);
    1579                         base_input->GetInputValue(&base, gauss); _assert_(base<0.);
     1589                        base_input->GetInputValue(&base, gauss);
    15801590
    15811591                        /*Compute Stress*/
     
    16011611                }
    16021612                else{
    1603                         grounded=true;
    1604                 }
    1605         }
    1606         else{
    1607                 /*Check for basal elevation if floating*/
    1608                 base_input->GetInputValue(&base, gauss);
    1609                 bed_input->GetInputValue(&bed, gauss);
    1610                 if (base<bed) grounded=true;
    1611                 else          grounded=false;
    1612         }
    1613         for(int i=0;i<NUMVERTICES;i++){
    1614                 if(grounded) vertexgrounded->SetValue(vertices[i]->Pid(),+1.,INS_VAL);
    1615                 else         vertexfloating->SetValue(vertices[i]->Pid(),+1.,INS_VAL);
    1616         }
    1617 
    1618         /*clean up*/
    1619         delete gauss;
    1620         xDelete<IssmDouble>(xyz_list);
    1621         xDelete<IssmDouble>(xyz_list_base);
     1613                        /*Check for basal elevation if floating*/
     1614                        base_input->GetInputValue(&base, gauss);
     1615                        bed_input->GetInputValue(&bed, gauss);
     1616                        if(base<bed) grounded=true;
     1617                        else         grounded=false;
     1618                }
     1619                for(int i=0;i<NUMVERTICES;i++){
     1620                        if(grounded) vertexgrounded->SetValue(vertices[i]->Pid(),+1.,INS_VAL);
     1621                        else         vertexfloating->SetValue(vertices[i]->Pid(),+1.,INS_VAL);
     1622                }
     1623
     1624                /*clean up*/
     1625                delete gauss;
     1626                xDelete<IssmDouble>(xyz_list);
     1627                xDelete<IssmDouble>(xyz_list_base);
     1628        }
    16221629}
    16231630/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.