Changeset 10143


Ignore:
Timestamp:
10/07/11 15:51:08 (13 years ago)
Author:
Mathieu Morlighem
Message:

moved IsOnShelf to IsFloating for consistency

Location:
issm/trunk/src/c
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/include/typedefs.h

    r9356 r10143  
    1111#define SQRT3 1.732050807568877293527446341505872366942805253810380628055806979
    1212#define PI 3.141592653589793238462643383279502884197169399375105820974944592308
    13 #define YTS 365.0*24.0*3600.0
    1413
    1514#define NDOF1 1
     
    1817#define NDOF4 4
    1918
     19#define DIM2 2
     20#define DIM3 3
    2021#endif //ifndef _ISSMTYPEDEFS_H_
  • issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp

    r9761 r10143  
    212212        double* element_on_iceshelf=NULL;
    213213
    214         /*Create  vector holding  all the elements IsOnShelf flags: */
     214        /*Create  vector holding  all the elements IsFloating flags: */
    215215        vec_element_on_iceshelf=NewVec(elements->NumberOfElements(),true);
    216216
     
    218218        for(i=0;i<elements->Size();i++){
    219219                element=(Element*)elements->GetObjectByOffset(i);
    220                 VecSetValue(vec_element_on_iceshelf,element->Sid(),(int)element->IsOnShelf(),INSERT_VALUES);
     220                VecSetValue(vec_element_on_iceshelf,element->Sid(),(int)element->IsFloating(),INSERT_VALUES);
    221221        }
    222222
     
    248248        VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf);
    249249
    250         /*Create  vector holding  all the elements IsOnShelf flags: */
     250        /*Create  vector holding  all the elements IsFloating flags: */
    251251        vec_element_touching_iceshelf=NewVec(elements->NumberOfElements(),true);
    252252
     
    339339                node=(Node*)nodes->GetObjectByOffset(i);
    340340                if(node->InAnalysis(configuration_type)){
    341                         if(node->IsOnShelf()){
     341                        if(node->IsFloating()){
    342342                                VecSetValue(nodes_on_iceshelf,node->Sid(),1.0,INSERT_VALUES);
    343343                        }
  • issm/trunk/src/c/objects/Elements/Element.h

    r10135 r10143  
    3333                virtual int    GetNodeIndex(Node* node)=0;
    3434                virtual int    Sid()=0;
    35                 virtual bool   IsOnShelf()=0;
     35                virtual bool   IsFloating()=0;
    3636                virtual bool   IsNodeOnShelf()=0;
    3737                virtual bool   IsNodeOnShelfFromFlags(double* flags)=0;
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r10141 r10143  
    360360
    361361        /* Basal friction can only be found at the base of an ice sheet: */
    362         if (!IsOnBed() || IsOnShelf()){
     362        if (!IsOnBed() || IsFloating()){
    363363                //empty friction:
    364364                this->inputs->AddInput(new PentaVertexInput(BasalFrictionEnum,&basalfriction[0]));
     
    17851785        for(i=0;i<numdof;i++) {
    17861786                /*If shelf: hydrostatic equilibrium*/
    1787                 if (this->nodes[i]->IsOnSheet()){
     1787                if (this->nodes[i]->IsGrounded()){
    17881788                        newsurface[i]=oldbed[i]+newthickness[i]; //surface = oldbed + newthickness
    17891789                        newbed[i]=oldbed[i];               //same bed: do nothing
     
    19631963}
    19641964/*}}}*/
    1965 /*FUNCTION Penta::IsOnShelf {{{1*/
    1966 bool   Penta::IsOnShelf(){
     1965/*FUNCTION Penta::IsFloating{{{1*/
     1966bool   Penta::IsFloating(){
    19671967
    19681968        bool onshelf;
     
    19781978
    19791979        for(i=0;i<6;i++){
    1980                 if (nodes[i]->IsOnShelf()){
     1980                if (nodes[i]->IsFloating()){
    19811981                        shelf=true;
    19821982                        break;
     
    30933093
    30943094        /*Initialize Element matrix and return if necessary*/
    3095         if (!IsOnBed() || !IsOnShelf()) return NULL;
     3095        if (!IsOnBed() || !IsFloating()) return NULL;
    30963096        ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    30973097
     
    33283328
    33293329        /*Initialize Element matrix and return if necessary*/
    3330         if (!IsOnBed() || !IsOnShelf()) return NULL;
     3330        if (!IsOnBed() || !IsFloating()) return NULL;
    33313331        ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    33323332
     
    34873487
    34883488        /* Ice/ocean heat exchange flux on ice shelf base */
    3489         if (!IsOnBed() || !IsOnShelf()) return NULL;
     3489        if (!IsOnBed() || !IsFloating()) return NULL;
    34903490
    34913491        /*Retrieve all inputs and parameters*/
     
    35433543
    35443544        /* Geothermal flux on ice sheet base and basal friction */
    3545         if (!IsOnBed() || IsOnShelf()) return NULL;
     3545        if (!IsOnBed() || IsFloating()) return NULL;
    35463546
    35473547        /*Initialize Element vector*/
     
    37153715
    37163716        /* Ice/ocean heat exchange flux on ice shelf base */
    3717         if (!IsOnBed() || !IsOnShelf()) return NULL;
     3717        if (!IsOnBed() || !IsFloating()) return NULL;
    37183718
    37193719        /*Initialize Element vector*/
     
    37743774
    37753775        /* Geothermal flux on ice sheet base and basal friction */
    3776         if (!IsOnBed() || IsOnShelf()) return NULL;
     3776        if (!IsOnBed() || IsFloating()) return NULL;
    37773777
    37783778        /*Initialize Element vector*/
     
    42444244
    42454245        /*Gradient is 0 if on shelf or not on bed*/
    4246         if(IsOnShelf() || !IsOnBed()) return;
     4246        if(IsFloating() || !IsOnBed()) return;
    42474247
    42484248        /*Spawn tria*/
     
    42704270
    42714271        /*Gradient is 0 if on shelf or not on bed*/
    4272         if(IsOnShelf() || !IsOnBed()) return;
     4272        if(IsFloating() || !IsOnBed()) return;
    42734273
    42744274        /*Retrieve all inputs and parameters*/
     
    43434343
    43444344        /*Gradient is 0 if on shelf or not on bed*/
    4345         if(IsOnShelf() || !IsOnBed()) return;
     4345        if(IsFloating() || !IsOnBed()) return;
    43464346
    43474347        /*Retrieve all inputs and parameters*/
     
    48034803
    48044804        /*If on water, on shelf or not on bed, skip: */
    4805         if(IsOnWater()|| IsOnShelf() || !IsOnBed()) return 0;
     4805        if(IsOnWater()|| IsFloating() || !IsOnBed()) return 0;
    48064806
    48074807        tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria
     
    48704870
    48714871                                        /*build new bed and surface: */
    4872                                         if (this->IsOnShelf()){
     4872                                        if (this->IsFloating()){
    48734873                                                /*hydrostatic equilibrium: */
    48744874                                                double rho_ice,rho_water,di;
     
    51015101
    51025102        /*Initialize Element matrix and return if necessary*/
    5103         if(IsOnShelf() || !IsOnBed()) return NULL;
     5103        if(IsFloating() || !IsOnBed()) return NULL;
    51045104        ElementMatrix* Ke1=new ElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
    51055105        ElementMatrix* Ke2=new ElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
     
    52975297        /*If on water or not Stokes, skip stiffness: */
    52985298        inputs->GetInputValue(&approximation,ApproximationEnum);
    5299         if(IsOnShelf() || !IsOnBed()) return NULL;
     5299        if(IsFloating() || !IsOnBed()) return NULL;
    53005300        ElementMatrix* Ke1=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
    53015301        ElementMatrix* Ke2=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
     
    56175617
    56185618        /*Initialize Element matrix and return if necessary*/
    5619         if(IsOnShelf() || !IsOnBed()) return NULL;
     5619        if(IsFloating() || !IsOnBed()) return NULL;
    56205620
    56215621        /*Build a tria element using the 3 nodes of the base of the penta. Then use
     
    57615761
    57625762        /*Initialize Element matrix and return if necessary*/
    5763         if(IsOnShelf() || !IsOnBed()) return NULL;
     5763        if(IsFloating() || !IsOnBed()) return NULL;
    57645764
    57655765        ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
     
    59275927        /*If on water or not Stokes, skip stiffness: */
    59285928        inputs->GetInputValue(&approximation,ApproximationEnum);
    5929         if(IsOnShelf() || !IsOnBed() || (approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum &&  approximation!=PattynStokesApproximationEnum)) return NULL;
     5929        if(IsFloating() || !IsOnBed() || (approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum &&  approximation!=PattynStokesApproximationEnum)) return NULL;
    59305930        ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
    59315931
     
    61896189
    61906190        /*Initialize Element vector and return if necessary*/
    6191         if(!IsOnBed() || IsOnShelf()) return NULL;
     6191        if(!IsOnBed() || IsFloating()) return NULL;
    61926192        inputs->GetInputValue(&approximation,ApproximationEnum);
    61936193        if(approximation!=MacAyealStokesApproximationEnum) return NULL;
     
    63346334
    63356335        /*Initialize Element vector and return if necessary*/
    6336         if(!IsOnBed() || IsOnShelf()) return NULL;
     6336        if(!IsOnBed() || IsFloating()) return NULL;
    63376337        inputs->GetInputValue(&approximation,ApproximationEnum);
    63386338        if(approximation!=PattynStokesApproximationEnum) return NULL;
     
    67146714
    67156715        /*Initialize Element vector and return if necessary*/
    6716         if(!IsOnBed() || !IsOnShelf()) return NULL;
     6716        if(!IsOnBed() || !IsFloating()) return NULL;
    67176717        inputs->GetInputValue(&approximation,ApproximationEnum);
    67186718        this->parameters->FindParam(&shelf_dampening,DiagnosticShelfDampeningEnum);
  • issm/trunk/src/c/objects/Elements/Penta.h

    r10135 r10143  
    191191                bool      IsOnSurface(void);
    192192                bool      IsOnBed(void);
    193                 bool    IsOnShelf(void);
    194                 bool    IsNodeOnShelf(void);
     193                bool    IsFloating(void);
     194                bool    IsNodeOnShelf();
    195195                bool    IsNodeOnShelfFromFlags(double* flags);
    196196                bool    IsOnWater(void);
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r10141 r10143  
    306306        /*go through vertices, and update inputs, considering them to be TriaVertex type: */
    307307        for(i=0;i<3;i++){
    308                 if (nodes[i]->IsOnShelf()){
     308                if (nodes[i]->IsFloating()){
    309309                        /*This node is on the shelf. See if its bed is going under the bathymetry: */
    310310                        if(b[i]<=ba[i]){ //<= because Neff being 0 when b=ba, drag will be 0 anyway.
     
    16831683        for(i=0;i<numdof;i++) {
    16841684                /*If shelf: hydrostatic equilibrium*/
    1685                 if (this->nodes[i]->IsOnSheet()){
     1685                if (this->nodes[i]->IsGrounded()){
    16861686                        newsurface[i]=oldbed[i]+newthickness[i]; //surface = oldbed + newthickness
    16871687                        newbed[i]=oldbed[i];               //same bed: do nothing
     
    18951895/*}}}*/
    18961896/*FUNCTION Tria::IsOnShelf {{{1*/
    1897 bool   Tria::IsOnShelf(){
     1897bool   Tria::IsFloating(){
    18981898
    18991899        bool shelf;
     
    19091909
    19101910        for(i=0;i<3;i++){
    1911                 if (nodes[i]->IsOnShelf()){
     1911                if (nodes[i]->IsFloating()){
    19121912                        shelf=true;
    19131913                        break;
     
    19911991        GetInputListOnVertices(&ba[0],BathymetryEnum);
    19921992        for(i=0;i<3;i++){
    1993                 isonshelf[i]=nodes[i]->IsOnShelf();
     1993                isonshelf[i]=nodes[i]->IsFloating();
    19941994                if((nodes[i]->Sid()+1)==36)printf("MigrateGroundingLine: El %i Node %i shelf status %i\n",this->Id(),nodes[i]->Sid()+1,isonshelf[i]);
    19951995        }
     
    20322032        this->inputs->AddInput(new TriaVertexInput(BedEnum,&b[0]));
    20332033       
    2034         for(i=0;i<3;i++) isonshelf[i]=nodes[i]->IsOnShelf();
     2034        for(i=0;i<3;i++) isonshelf[i]=nodes[i]->IsFloating();
    20352035}
    20362036/*}}}*/
     
    21202120        /*go through vertices, and figure out which ones are on the ice sheet, and want to unground: */
    21212121        for(i=0;i<3;i++){
    2122                 if (!nodes[i]->IsOnShelf()){
     2122                if (!nodes[i]->IsFloating()){
    21232123                       
    21242124                        /*This node is on the sheet, near the grounding line. See if wants to unground. To
     
    22302230        elementonshelf=false;
    22312231        for(i=0;i<NUMVERTICES;i++){
    2232                 if(nodes[i]->IsOnShelf()){
     2232                if(nodes[i]->IsFloating()){
    22332233                        elementonshelf=true;
    22342234                        break;
    22352235                }
    22362236        }
    2237         if(!this->IsOnShelf() && elementonshelf==true)swap=1;
     2237        if(!this->IsFloating() && elementonshelf==true)swap=1;
    22382238    this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
    22392239       
     
    22682268        /*go through vertices, and update inputs, considering them to be TriaVertex type: */
    22692269        for(i=0;i<3;i++){
    2270                 if (nodes[i]->IsOnShelf()){
     2270                if (nodes[i]->IsFloating()){
    22712271                        /*This node is on the shelf. See if its bed is going under the bathymetry: */
    22722272                        if(b[i]<=ba[i]){ //<= because Neff being 0 when b=ba, drag will be 0 anyway.
     
    25442544        /*Initialize current status of nodes: */
    25452545        for(i=0;i<3;i++){
    2546                 shelfstatus[i]=nodes[i]->IsOnShelf();
     2546                shelfstatus[i]=nodes[i]->IsFloating();
    25472547                if((nodes[i]->Sid()+1)==36) printf("UpdateShelfStatus: El %i Node %i shelf status %i\n",this->Id(),nodes[i]->Sid()+1,shelfstatus[i]);
    25482548        }
     
    25742574        elementonshelf=false;
    25752575        for(i=0;i<3;i++){
    2576                 if(nodes[i]->IsOnShelf()){
     2576                if(nodes[i]->IsFloating()){
    25772577                        elementonshelf=true;
    25782578                        break;
     
    29992999
    30003000        /*Initialize Element matrix and return if necessary*/
    3001         if(IsOnShelf()) return NULL;
     3001        if(IsFloating()) return NULL;
    30023002        ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
    30033003
     
    36323632        GaussTria  *gauss=NULL;
    36333633
    3634         if(IsOnShelf())return;
     3634        if(IsFloating())return;
    36353635
    36363636        /*retrive parameters: */
     
    37153715
    37163716        /*Retrieve all inputs we will be needing: */
    3717         if(IsOnShelf())return;
     3717        if(IsFloating())return;
    37183718        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    37193719        GetDofList1(&doflist1[0]);
     
    51535153
    51545154                                        /*build new bed and surface: */
    5155                                         if (this->IsOnShelf()){
     5155                                        if (this->IsFloating()){
    51565156                                                /*hydrostatic equilibrium: */
    51575157                                                double rho_ice,rho_water,di;
  • issm/trunk/src/c/objects/Elements/Tria.h

    r10135 r10143  
    8585                int    Sid();
    8686                bool   IsOnBed();
    87                 bool   IsOnShelf();
     87                bool   IsFloating();
    8888                bool   IsNodeOnShelf();
    8989                bool   IsNodeOnShelfFromFlags(double* flags);
  • issm/trunk/src/c/objects/Node.cpp

    r10135 r10143  
    745745}
    746746/*}}}*/
    747 /*FUNCTION Node::IsOnSheet {{{1*/
    748 int   Node::IsOnSheet(){
     747/*FUNCTION Node::IsGrounded {{{1*/
     748int   Node::IsGrounded(){
    749749
    750750        bool onsheet;
     
    756756}               
    757757/*}}}*/
    758 /*FUNCTION Node::IsOnShelf {{{1*/
    759 int   Node::IsOnShelf(){
     758/*FUNCTION Node::IsFloating {{{1*/
     759int   Node::IsFloating(){
    760760       
    761761        bool onshelf;
  • issm/trunk/src/c/objects/Node.h

    r9883 r10143  
    9494                int   IsOnSurface();
    9595                void  FreezeDof(int dof);
    96                 int   IsOnShelf();
    97                 int   IsOnSheet();
     96                int   IsFloating();
     97                int   IsGrounded();
    9898                void  UpdateSpcs(double* ys);
    9999                void  VecMerge(Vec ug, double* vector_serial,int setnum);
Note: See TracChangeset for help on using the changeset viewer.