Changeset 10143
- Timestamp:
- 10/07/11 15:51:08 (13 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/include/typedefs.h
r9356 r10143 11 11 #define SQRT3 1.732050807568877293527446341505872366942805253810380628055806979 12 12 #define PI 3.141592653589793238462643383279502884197169399375105820974944592308 13 #define YTS 365.0*24.0*3600.014 13 15 14 #define NDOF1 1 … … 18 17 #define NDOF4 4 19 18 19 #define DIM2 2 20 #define DIM3 3 20 21 #endif //ifndef _ISSMTYPEDEFS_H_ -
issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp
r9761 r10143 212 212 double* element_on_iceshelf=NULL; 213 213 214 /*Create vector holding all the elements Is OnShelfflags: */214 /*Create vector holding all the elements IsFloating flags: */ 215 215 vec_element_on_iceshelf=NewVec(elements->NumberOfElements(),true); 216 216 … … 218 218 for(i=0;i<elements->Size();i++){ 219 219 element=(Element*)elements->GetObjectByOffset(i); 220 VecSetValue(vec_element_on_iceshelf,element->Sid(),(int)element->Is OnShelf(),INSERT_VALUES);220 VecSetValue(vec_element_on_iceshelf,element->Sid(),(int)element->IsFloating(),INSERT_VALUES); 221 221 } 222 222 … … 248 248 VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf); 249 249 250 /*Create vector holding all the elements Is OnShelfflags: */250 /*Create vector holding all the elements IsFloating flags: */ 251 251 vec_element_touching_iceshelf=NewVec(elements->NumberOfElements(),true); 252 252 … … 339 339 node=(Node*)nodes->GetObjectByOffset(i); 340 340 if(node->InAnalysis(configuration_type)){ 341 if(node->Is OnShelf()){341 if(node->IsFloating()){ 342 342 VecSetValue(nodes_on_iceshelf,node->Sid(),1.0,INSERT_VALUES); 343 343 } -
issm/trunk/src/c/objects/Elements/Element.h
r10135 r10143 33 33 virtual int GetNodeIndex(Node* node)=0; 34 34 virtual int Sid()=0; 35 virtual bool Is OnShelf()=0;35 virtual bool IsFloating()=0; 36 36 virtual bool IsNodeOnShelf()=0; 37 37 virtual bool IsNodeOnShelfFromFlags(double* flags)=0; -
issm/trunk/src/c/objects/Elements/Penta.cpp
r10141 r10143 360 360 361 361 /* Basal friction can only be found at the base of an ice sheet: */ 362 if (!IsOnBed() || Is OnShelf()){362 if (!IsOnBed() || IsFloating()){ 363 363 //empty friction: 364 364 this->inputs->AddInput(new PentaVertexInput(BasalFrictionEnum,&basalfriction[0])); … … 1785 1785 for(i=0;i<numdof;i++) { 1786 1786 /*If shelf: hydrostatic equilibrium*/ 1787 if (this->nodes[i]->Is OnSheet()){1787 if (this->nodes[i]->IsGrounded()){ 1788 1788 newsurface[i]=oldbed[i]+newthickness[i]; //surface = oldbed + newthickness 1789 1789 newbed[i]=oldbed[i]; //same bed: do nothing … … 1963 1963 } 1964 1964 /*}}}*/ 1965 /*FUNCTION Penta::Is OnShelf{{{1*/1966 bool Penta::Is OnShelf(){1965 /*FUNCTION Penta::IsFloating{{{1*/ 1966 bool Penta::IsFloating(){ 1967 1967 1968 1968 bool onshelf; … … 1978 1978 1979 1979 for(i=0;i<6;i++){ 1980 if (nodes[i]->Is OnShelf()){1980 if (nodes[i]->IsFloating()){ 1981 1981 shelf=true; 1982 1982 break; … … 3093 3093 3094 3094 /*Initialize Element matrix and return if necessary*/ 3095 if (!IsOnBed() || !Is OnShelf()) return NULL;3095 if (!IsOnBed() || !IsFloating()) return NULL; 3096 3096 ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum); 3097 3097 … … 3328 3328 3329 3329 /*Initialize Element matrix and return if necessary*/ 3330 if (!IsOnBed() || !Is OnShelf()) return NULL;3330 if (!IsOnBed() || !IsFloating()) return NULL; 3331 3331 ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum); 3332 3332 … … 3487 3487 3488 3488 /* Ice/ocean heat exchange flux on ice shelf base */ 3489 if (!IsOnBed() || !Is OnShelf()) return NULL;3489 if (!IsOnBed() || !IsFloating()) return NULL; 3490 3490 3491 3491 /*Retrieve all inputs and parameters*/ … … 3543 3543 3544 3544 /* Geothermal flux on ice sheet base and basal friction */ 3545 if (!IsOnBed() || Is OnShelf()) return NULL;3545 if (!IsOnBed() || IsFloating()) return NULL; 3546 3546 3547 3547 /*Initialize Element vector*/ … … 3715 3715 3716 3716 /* Ice/ocean heat exchange flux on ice shelf base */ 3717 if (!IsOnBed() || !Is OnShelf()) return NULL;3717 if (!IsOnBed() || !IsFloating()) return NULL; 3718 3718 3719 3719 /*Initialize Element vector*/ … … 3774 3774 3775 3775 /* Geothermal flux on ice sheet base and basal friction */ 3776 if (!IsOnBed() || Is OnShelf()) return NULL;3776 if (!IsOnBed() || IsFloating()) return NULL; 3777 3777 3778 3778 /*Initialize Element vector*/ … … 4244 4244 4245 4245 /*Gradient is 0 if on shelf or not on bed*/ 4246 if(Is OnShelf() || !IsOnBed()) return;4246 if(IsFloating() || !IsOnBed()) return; 4247 4247 4248 4248 /*Spawn tria*/ … … 4270 4270 4271 4271 /*Gradient is 0 if on shelf or not on bed*/ 4272 if(Is OnShelf() || !IsOnBed()) return;4272 if(IsFloating() || !IsOnBed()) return; 4273 4273 4274 4274 /*Retrieve all inputs and parameters*/ … … 4343 4343 4344 4344 /*Gradient is 0 if on shelf or not on bed*/ 4345 if(Is OnShelf() || !IsOnBed()) return;4345 if(IsFloating() || !IsOnBed()) return; 4346 4346 4347 4347 /*Retrieve all inputs and parameters*/ … … 4803 4803 4804 4804 /*If on water, on shelf or not on bed, skip: */ 4805 if(IsOnWater()|| Is OnShelf() || !IsOnBed()) return 0;4805 if(IsOnWater()|| IsFloating() || !IsOnBed()) return 0; 4806 4806 4807 4807 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria … … 4870 4870 4871 4871 /*build new bed and surface: */ 4872 if (this->Is OnShelf()){4872 if (this->IsFloating()){ 4873 4873 /*hydrostatic equilibrium: */ 4874 4874 double rho_ice,rho_water,di; … … 5101 5101 5102 5102 /*Initialize Element matrix and return if necessary*/ 5103 if(Is OnShelf() || !IsOnBed()) return NULL;5103 if(IsFloating() || !IsOnBed()) return NULL; 5104 5104 ElementMatrix* Ke1=new ElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum); 5105 5105 ElementMatrix* Ke2=new ElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum); … … 5297 5297 /*If on water or not Stokes, skip stiffness: */ 5298 5298 inputs->GetInputValue(&approximation,ApproximationEnum); 5299 if(Is OnShelf() || !IsOnBed()) return NULL;5299 if(IsFloating() || !IsOnBed()) return NULL; 5300 5300 ElementMatrix* Ke1=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum); 5301 5301 ElementMatrix* Ke2=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,StokesApproximationEnum); … … 5617 5617 5618 5618 /*Initialize Element matrix and return if necessary*/ 5619 if(Is OnShelf() || !IsOnBed()) return NULL;5619 if(IsFloating() || !IsOnBed()) return NULL; 5620 5620 5621 5621 /*Build a tria element using the 3 nodes of the base of the penta. Then use … … 5761 5761 5762 5762 /*Initialize Element matrix and return if necessary*/ 5763 if(Is OnShelf() || !IsOnBed()) return NULL;5763 if(IsFloating() || !IsOnBed()) return NULL; 5764 5764 5765 5765 ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum); … … 5927 5927 /*If on water or not Stokes, skip stiffness: */ 5928 5928 inputs->GetInputValue(&approximation,ApproximationEnum); 5929 if(Is OnShelf() || !IsOnBed() || (approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum && approximation!=PattynStokesApproximationEnum)) return NULL;5929 if(IsFloating() || !IsOnBed() || (approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum && approximation!=PattynStokesApproximationEnum)) return NULL; 5930 5930 ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum); 5931 5931 … … 6189 6189 6190 6190 /*Initialize Element vector and return if necessary*/ 6191 if(!IsOnBed() || Is OnShelf()) return NULL;6191 if(!IsOnBed() || IsFloating()) return NULL; 6192 6192 inputs->GetInputValue(&approximation,ApproximationEnum); 6193 6193 if(approximation!=MacAyealStokesApproximationEnum) return NULL; … … 6334 6334 6335 6335 /*Initialize Element vector and return if necessary*/ 6336 if(!IsOnBed() || Is OnShelf()) return NULL;6336 if(!IsOnBed() || IsFloating()) return NULL; 6337 6337 inputs->GetInputValue(&approximation,ApproximationEnum); 6338 6338 if(approximation!=PattynStokesApproximationEnum) return NULL; … … 6714 6714 6715 6715 /*Initialize Element vector and return if necessary*/ 6716 if(!IsOnBed() || !Is OnShelf()) return NULL;6716 if(!IsOnBed() || !IsFloating()) return NULL; 6717 6717 inputs->GetInputValue(&approximation,ApproximationEnum); 6718 6718 this->parameters->FindParam(&shelf_dampening,DiagnosticShelfDampeningEnum); -
issm/trunk/src/c/objects/Elements/Penta.h
r10135 r10143 191 191 bool IsOnSurface(void); 192 192 bool IsOnBed(void); 193 bool Is OnShelf(void);194 bool IsNodeOnShelf( void);193 bool IsFloating(void); 194 bool IsNodeOnShelf(); 195 195 bool IsNodeOnShelfFromFlags(double* flags); 196 196 bool IsOnWater(void); -
issm/trunk/src/c/objects/Elements/Tria.cpp
r10141 r10143 306 306 /*go through vertices, and update inputs, considering them to be TriaVertex type: */ 307 307 for(i=0;i<3;i++){ 308 if (nodes[i]->Is OnShelf()){308 if (nodes[i]->IsFloating()){ 309 309 /*This node is on the shelf. See if its bed is going under the bathymetry: */ 310 310 if(b[i]<=ba[i]){ //<= because Neff being 0 when b=ba, drag will be 0 anyway. … … 1683 1683 for(i=0;i<numdof;i++) { 1684 1684 /*If shelf: hydrostatic equilibrium*/ 1685 if (this->nodes[i]->Is OnSheet()){1685 if (this->nodes[i]->IsGrounded()){ 1686 1686 newsurface[i]=oldbed[i]+newthickness[i]; //surface = oldbed + newthickness 1687 1687 newbed[i]=oldbed[i]; //same bed: do nothing … … 1895 1895 /*}}}*/ 1896 1896 /*FUNCTION Tria::IsOnShelf {{{1*/ 1897 bool Tria::Is OnShelf(){1897 bool Tria::IsFloating(){ 1898 1898 1899 1899 bool shelf; … … 1909 1909 1910 1910 for(i=0;i<3;i++){ 1911 if (nodes[i]->Is OnShelf()){1911 if (nodes[i]->IsFloating()){ 1912 1912 shelf=true; 1913 1913 break; … … 1991 1991 GetInputListOnVertices(&ba[0],BathymetryEnum); 1992 1992 for(i=0;i<3;i++){ 1993 isonshelf[i]=nodes[i]->Is OnShelf();1993 isonshelf[i]=nodes[i]->IsFloating(); 1994 1994 if((nodes[i]->Sid()+1)==36)printf("MigrateGroundingLine: El %i Node %i shelf status %i\n",this->Id(),nodes[i]->Sid()+1,isonshelf[i]); 1995 1995 } … … 2032 2032 this->inputs->AddInput(new TriaVertexInput(BedEnum,&b[0])); 2033 2033 2034 for(i=0;i<3;i++) isonshelf[i]=nodes[i]->Is OnShelf();2034 for(i=0;i<3;i++) isonshelf[i]=nodes[i]->IsFloating(); 2035 2035 } 2036 2036 /*}}}*/ … … 2120 2120 /*go through vertices, and figure out which ones are on the ice sheet, and want to unground: */ 2121 2121 for(i=0;i<3;i++){ 2122 if (!nodes[i]->Is OnShelf()){2122 if (!nodes[i]->IsFloating()){ 2123 2123 2124 2124 /*This node is on the sheet, near the grounding line. See if wants to unground. To … … 2230 2230 elementonshelf=false; 2231 2231 for(i=0;i<NUMVERTICES;i++){ 2232 if(nodes[i]->Is OnShelf()){2232 if(nodes[i]->IsFloating()){ 2233 2233 elementonshelf=true; 2234 2234 break; 2235 2235 } 2236 2236 } 2237 if(!this->Is OnShelf() && elementonshelf==true)swap=1;2237 if(!this->IsFloating() && elementonshelf==true)swap=1; 2238 2238 this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf)); 2239 2239 … … 2268 2268 /*go through vertices, and update inputs, considering them to be TriaVertex type: */ 2269 2269 for(i=0;i<3;i++){ 2270 if (nodes[i]->Is OnShelf()){2270 if (nodes[i]->IsFloating()){ 2271 2271 /*This node is on the shelf. See if its bed is going under the bathymetry: */ 2272 2272 if(b[i]<=ba[i]){ //<= because Neff being 0 when b=ba, drag will be 0 anyway. … … 2544 2544 /*Initialize current status of nodes: */ 2545 2545 for(i=0;i<3;i++){ 2546 shelfstatus[i]=nodes[i]->Is OnShelf();2546 shelfstatus[i]=nodes[i]->IsFloating(); 2547 2547 if((nodes[i]->Sid()+1)==36) printf("UpdateShelfStatus: El %i Node %i shelf status %i\n",this->Id(),nodes[i]->Sid()+1,shelfstatus[i]); 2548 2548 } … … 2574 2574 elementonshelf=false; 2575 2575 for(i=0;i<3;i++){ 2576 if(nodes[i]->Is OnShelf()){2576 if(nodes[i]->IsFloating()){ 2577 2577 elementonshelf=true; 2578 2578 break; … … 2999 2999 3000 3000 /*Initialize Element matrix and return if necessary*/ 3001 if(Is OnShelf()) return NULL;3001 if(IsFloating()) return NULL; 3002 3002 ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum); 3003 3003 … … 3632 3632 GaussTria *gauss=NULL; 3633 3633 3634 if(Is OnShelf())return;3634 if(IsFloating())return; 3635 3635 3636 3636 /*retrive parameters: */ … … 3715 3715 3716 3716 /*Retrieve all inputs we will be needing: */ 3717 if(Is OnShelf())return;3717 if(IsFloating())return; 3718 3718 GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES); 3719 3719 GetDofList1(&doflist1[0]); … … 5153 5153 5154 5154 /*build new bed and surface: */ 5155 if (this->Is OnShelf()){5155 if (this->IsFloating()){ 5156 5156 /*hydrostatic equilibrium: */ 5157 5157 double rho_ice,rho_water,di; -
issm/trunk/src/c/objects/Elements/Tria.h
r10135 r10143 85 85 int Sid(); 86 86 bool IsOnBed(); 87 bool Is OnShelf();87 bool IsFloating(); 88 88 bool IsNodeOnShelf(); 89 89 bool IsNodeOnShelfFromFlags(double* flags); -
issm/trunk/src/c/objects/Node.cpp
r10135 r10143 745 745 } 746 746 /*}}}*/ 747 /*FUNCTION Node::Is OnSheet{{{1*/748 int Node::Is OnSheet(){747 /*FUNCTION Node::IsGrounded {{{1*/ 748 int Node::IsGrounded(){ 749 749 750 750 bool onsheet; … … 756 756 } 757 757 /*}}}*/ 758 /*FUNCTION Node::Is OnShelf{{{1*/759 int Node::Is OnShelf(){758 /*FUNCTION Node::IsFloating {{{1*/ 759 int Node::IsFloating(){ 760 760 761 761 bool onshelf; -
issm/trunk/src/c/objects/Node.h
r9883 r10143 94 94 int IsOnSurface(); 95 95 void FreezeDof(int dof); 96 int Is OnShelf();97 int Is OnSheet();96 int IsFloating(); 97 int IsGrounded(); 98 98 void UpdateSpcs(double* ys); 99 99 void VecMerge(Vec ug, double* vector_serial,int setnum);
Note:
See TracChangeset
for help on using the changeset viewer.