Changeset 15972 for issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
- Timestamp:
- 08/27/13 13:23:25 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.