Changeset 15972
- Timestamp:
- 08/27/13 13:23:25 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.h
r15962 r15972 48 48 virtual int Sid()=0; 49 49 virtual bool IsFloating()=0; 50 virtual bool IsNodeOnShelf()=0;51 50 virtual bool IsNodeOnShelfFromFlags(IssmDouble* flags)=0; 52 51 virtual bool IsOnBed()=0; -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r15971 r15972 2368 2368 IssmDouble oldsurface[NUMVERTICES]; 2369 2369 IssmDouble oldthickness[NUMVERTICES]; 2370 IssmDouble phi[NUMVERTICES]; 2370 2371 Penta *penta = NULL; 2371 2372 … … 2390 2391 GetInputListOnVertices(&oldsurface[0],SurfaceEnum); 2391 2392 GetInputListOnVertices(&oldthickness[0],ThicknessEnum); 2393 GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum); 2392 2394 2393 2395 /*Fing MasstransportHydrostaticAdjustment to figure out how to update the geometry:*/ … … 2400 2402 for(i=0;i<numdof;i++) { 2401 2403 /*If shelf: hydrostatic equilibrium*/ 2402 if ( this->nodes[i]->IsGrounded()){2404 if (phi[i]>0.){ 2403 2405 newsurface[i]=oldbed[i]+newthickness[i]; //surface = oldbed + newthickness 2404 2406 newbed[i]=oldbed[i]; //same bed: do nothing … … 2755 2757 inputs->GetInputValue(&onshelf,MaskElementonfloatingiceEnum); 2756 2758 return onshelf; 2757 }2758 /*}}}*/2759 /*FUNCTION Penta::IsNodeOnShelf {{{*/2760 bool Penta::IsNodeOnShelf(){2761 2762 int i;2763 bool shelf=false;2764 2765 for(i=0;i<6;i++){2766 if (nodes[i]->IsFloating()){2767 shelf=true;2768 break;2769 }2770 }2771 return shelf;2772 2759 } 2773 2760 /*}}}*/ … … 11235 11222 floating[i] = false; 11236 11223 grounded[i] = true; 11237 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false));11238 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true));11239 11224 } 11240 11225 } … … 11250 11235 floating[i] = true; 11251 11236 grounded[i] = false; 11252 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));11253 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));11254 11237 } 11255 11238 else if(migration_style==SoftMigrationEnum && phi_ungrounding[vertices[i]->Pid()]<0.){ … … 11258 11241 floating[i] = true; 11259 11242 grounded[i] = false; 11260 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));11261 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));11262 11243 } 11263 11244 else{ … … 11267 11248 } 11268 11249 } 11269 11270 /*SubelementMigrationEnum: if one grounded, all grounded*/11271 if(migration_style==SubelementMigrationEnum){11272 for(i=0;i<NUMVERTICES;i++){11273 if(nodes[i]->IsGrounded()){11274 groundedelement=true;11275 break;11276 }11277 }11278 floatingelement=!groundedelement;11279 }11280 else{11281 for(i=0;i<NUMVERTICES;i++){11282 if(nodes[i]->IsFloating()){11283 floatingelement=true;11284 break;11285 }11286 }11287 }11288 11289 /*Add basal melting rate if element just ungrounded*/11290 if(!this->IsFloating() && floatingelement==true){11291 for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;11292 this->inputs->AddInput(new PentaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum));11293 }11294 11295 /*Update inputs*/11296 this->inputs->AddInput(new PentaInput(SurfaceEnum,&s[0],P1Enum));11297 this->inputs->AddInput(new PentaInput(BedEnum,&b[0],P1Enum));11298 this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,floatingelement));11299 11250 11300 11251 /*Recalculate phi*/ … … 11311 11262 this->InputExtrude(MaskGroundediceLevelsetEnum,ElementEnum); 11312 11263 11264 /*SubelementMigrationEnum: if one grounded, all grounded*/ 11265 if(migration_style==SubelementMigrationEnum){ 11266 for(i=0;i<NUMVERTICES;i++){ 11267 if(phi[i]>0.){ 11268 groundedelement=true; 11269 break; 11270 } 11271 } 11272 floatingelement=!groundedelement; 11273 } 11274 else{ 11275 for(i=0;i<NUMVERTICES;i++){ 11276 if(phi[i]<=0.){ 11277 floatingelement=true; 11278 break; 11279 } 11280 } 11281 } 11282 11283 /*Add basal melting rate if element just ungrounded*/ 11284 if(!this->IsFloating() && floatingelement==true){ 11285 for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts; 11286 this->inputs->AddInput(new PentaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum)); 11287 } 11288 11289 /*Update inputs*/ 11290 this->inputs->AddInput(new PentaInput(SurfaceEnum,&s[0],P1Enum)); 11291 this->inputs->AddInput(new PentaInput(BedEnum,&b[0],P1Enum)); 11292 this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,floatingelement)); 11293 11313 11294 /*Extrude inputs*/ 11314 11295 this->InputExtrude(SurfaceEnum,ElementEnum); 11315 11296 this->InputExtrude(BedEnum,ElementEnum); 11316 11297 this->InputExtrude(MaskElementonfloatingiceEnum,ElementEnum); 11317 this->InputExtrude(MaskVertexonfloatingiceEnum,NodeEnum);11318 this->InputExtrude(MaskVertexongroundediceEnum,NodeEnum);11319 11298 } 11320 11299 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r15962 r15972 223 223 bool IsOnBed(void); 224 224 bool IsFloating(void); 225 bool IsNodeOnShelf();226 225 bool IsNodeOnShelfFromFlags(IssmDouble* flags); 227 226 bool NoIceInElement(void); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15970 r15972 1667 1667 IssmDouble* oldbed = xNew<IssmDouble>(numnodes); 1668 1668 IssmDouble* oldsurface = xNew<IssmDouble>(numnodes); 1669 IssmDouble* phi = xNew<IssmDouble>(numnodes); 1669 1670 1670 1671 /*Use the dof list to index into the solution vector: */ … … 1681 1682 GetInputListOnNodes(&oldsurface[0],SurfaceEnum); 1682 1683 GetInputListOnNodes(&oldthickness[0],ThicknessEnum); 1683 1684 /*Fing MasstransportHydrostaticAdjustment to figure out how to update the geometry:*/ 1684 GetInputListOnNodes(&phi[0],MaskGroundediceLevelsetEnum); 1685 1686 /*Find MasstransportHydrostaticAdjustment to figure out how to update the geometry:*/ 1685 1687 this->parameters->FindParam(&hydroadjustment,MasstransportHydrostaticAdjustmentEnum); 1686 1688 rho_ice=matpar->GetRhoIce(); … … 1689 1691 for(i=0;i<numnodes;i++) { 1690 1692 /*If shelf: hydrostatic equilibrium*/ 1691 if ( this->nodes[i]->IsGrounded()){1693 if (phi[i]>0.){ 1692 1694 newsurface[i] = oldbed[i]+newthickness[i]; //surface = oldbed + newthickness 1693 1695 newbed[i] = oldbed[i]; //same bed: do nothing … … 1718 1720 xDelete<IssmDouble>(oldbed); 1719 1721 xDelete<IssmDouble>(oldsurface); 1722 xDelete<IssmDouble>(phi); 1720 1723 xDelete<int>(doflist); 1721 1724 } … … 1956 1959 bool shelf; 1957 1960 inputs->GetInputValue(&shelf,MaskElementonfloatingiceEnum); 1958 return shelf;1959 }1960 /*}}}*/1961 /*FUNCTION Tria::IsNodeOnShelf {{{*/1962 bool Tria::IsNodeOnShelf(){1963 1964 int i;1965 bool shelf=false;1966 1967 for(i=0;i<3;i++){1968 if (nodes[i]->IsFloating()){1969 shelf=true;1970 break;1971 }1972 }1973 1961 return shelf; 1974 1962 } … … 7345 7333 floating[i] = false; 7346 7334 grounded[i] = true; 7347 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false));7348 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true));7349 7335 } 7350 7336 } … … 7360 7346 floating[i] = true; 7361 7347 grounded[i] = false; 7362 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));7363 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));7364 7348 } 7365 7349 else if(migration_style==SoftMigrationEnum && phi_ungrounding[vertices[i]->Pid()]<0.){ … … 7368 7352 floating[i] = true; 7369 7353 grounded[i] = false; 7370 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));7371 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));7372 7354 } 7373 7355 else{ … … 7377 7359 } 7378 7360 } 7379 7380 /*SubelementMigrationEnum: if one grounded, all grounded*/7381 if(migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum){7382 for(i=0;i<NUMVERTICES;i++){7383 if(nodes[i]->IsGrounded()){7384 groundedelement=true;7385 break;7386 }7387 }7388 floatingelement=!groundedelement;7389 }7390 else{7391 /*Otherwise: if one floating, all floating*/7392 for(i=0;i<NUMVERTICES;i++){7393 if(nodes[i]->IsFloating()){7394 floatingelement=true;7395 break;7396 }7397 }7398 }7399 7400 /*Add basal melting rate if element just ungrounded*/7401 if(!this->IsFloating() && floatingelement==true){7402 for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;7403 this->inputs->AddInput(new TriaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum));7404 }7405 7406 /*Update inputs*/7407 this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,floatingelement));7408 this->inputs->AddInput(new TriaInput(SurfaceEnum,&s[0],P1Enum));7409 this->inputs->AddInput(new TriaInput(BedEnum,&b[0],P1Enum));7410 7361 7411 7362 /*Recalculate phi*/ … … 7420 7371 } 7421 7372 this->inputs->AddInput(new TriaInput(MaskGroundediceLevelsetEnum,&phi[0],P1Enum)); 7373 7374 /*SubelementMigrationEnum: if one grounded, all grounded*/ 7375 if(migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum){ 7376 for(i=0;i<NUMVERTICES;i++){ 7377 if(phi[i]>0.){ 7378 groundedelement=true; 7379 break; 7380 } 7381 } 7382 floatingelement=!groundedelement; 7383 } 7384 else{ 7385 /*Otherwise: if one floating, all floating*/ 7386 for(i=0;i<NUMVERTICES;i++){ 7387 if(phi[i]<=0.){ 7388 floatingelement=true; 7389 break; 7390 } 7391 } 7392 } 7393 7394 /*Add basal melting rate if element just ungrounded*/ 7395 if(!this->IsFloating() && floatingelement==true){ 7396 for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts; 7397 this->inputs->AddInput(new TriaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum)); 7398 } 7399 7400 /*Update inputs*/ 7401 this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,floatingelement)); 7402 this->inputs->AddInput(new TriaInput(SurfaceEnum,&s[0],P1Enum)); 7403 this->inputs->AddInput(new TriaInput(BedEnum,&b[0],P1Enum)); 7404 7422 7405 } 7423 7406 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r15962 r15972 88 88 bool IsOnBed(); 89 89 bool IsFloating(); 90 bool IsNodeOnShelf();91 90 bool IsNodeOnShelfFromFlags(IssmDouble* flags); 92 91 bool NoIceInElement();
Note:
See TracChangeset
for help on using the changeset viewer.