Changeset 10321
- Timestamp:
- 10/26/11 11:22:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Tria.cpp
r10320 r10321 285 285 double bed_hydro; 286 286 double rho_water,rho_ice,density; 287 double h[ 3],s[3],b[3],ba[3];287 double h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES]; 288 288 289 289 /*vertices and material parameters: */ … … 297 297 298 298 /*go through vertices, and update inputs, considering them to be TriaVertex type: */ 299 for(i=0;i<3;i++){ 299 for(i=0;i<NUMVERTICES;i++){ 300 /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */ 300 301 if (nodes[i]->IsFloating()){ 301 /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */302 302 if(b[i]<=ba[i]){ 303 303 b[i]=ba[i]; … … 305 305 } 306 306 } 307 /*Ice sheet: if hydrostatic bed above bathymetry, the ice sheet start to unground, elso do nothing */ 307 308 else{ 308 /*Ice sheet: if hydrostatic bed above bathymetry, the ice sheet start to unground, elso do nothing */309 309 bed_hydro=-density*h[i]; 310 310 if (bed_hydro>ba[i]){ … … 315 315 } 316 316 317 /* Surface and bed are updated. Update inputs:*/317 /*Update inputs*/ 318 318 this->inputs->AddInput(new TriaVertexInput(SurfaceEnum,&s[0])); 319 319 this->inputs->AddInput(new TriaVertexInput(BedEnum,&b[0])); … … 2241 2241 GetInputListOnVertices(&b[0],BedEnum); 2242 2242 GetInputListOnVertices(&ba[0],BathymetryEnum); 2243 2244 /*material parameters: */2245 2243 rho_water=matpar->GetRhoWater(); 2246 2244 rho_ice=matpar->GetRhoIce(); … … 2249 2247 /*go through vertices, and update inputs, considering them to be TriaVertex type: */ 2250 2248 for(i=0;i<NUMVERTICES;i++){ 2249 /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */ 2251 2250 if (nodes[i]->IsFloating()){ 2252 /*This node is on the shelf. See if its bed is going under the bathymetry: */ 2253 if(b[i]<=ba[i]){ //<= because Neff being 0 when b=ba, drag will be 0 anyway. 2254 /*The ice shelf is getting grounded, the thickness is the same, so just update the bed to stick to the bathymetry and elevate the surface accordingly: */ 2251 if(b[i]<=ba[i]){ 2255 2252 b[i]=ba[i]; 2256 2253 s[i]=b[i]+h[i]; 2257 2254 } 2258 else{2259 /*do nothing, we are still floating.*/2260 }2261 2255 } 2256 /*Ice sheet: if hydrostatic bed above bathymetry, the ice sheet starts to unground if it is connected to the ice shelf, elso do nothing */ 2262 2257 else{ 2263 /*This node is on the sheet, near the grounding line. See if wants to unground. To2264 * do so, we compute the hydrostatic bed, and if it is > bathymetry, then we unground: */2265 2258 bed_hydro=-density*h[i]; 2266 2259 if (bed_hydro>ba[i]){ 2267 2268 /*Now, are we connected to the grounding line, if so, go forward, otherwise, bail out: */ 2260 /*Unground only if the element is connected to the ice shelf*/ 2269 2261 if(sheet_ungrounding[nodes[i]->Sid()]){ 2270 /*We are now floating, bed and surface are determined from hydrostatic equilibrium: */2271 2262 s[i]=(1-density)*h[i]; 2272 2263 b[i]=-density*h[i]; 2273 2264 } 2274 2265 } 2275 else{2276 /*do nothing, we are still grounded.*/2277 }2278 2266 } 2279 2267 } 2280 2268 2281 /* Surface and bed are updated. Update inputs:*/2269 /*Update inputs*/ 2282 2270 this->inputs->AddInput(new TriaVertexInput(SurfaceEnum,&s[0])); 2283 2271 this->inputs->AddInput(new TriaVertexInput(BedEnum,&b[0]));
Note:
See TracChangeset
for help on using the changeset viewer.