Changeset 17633
- Timestamp:
- 04/03/14 13:51:57 (11 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r17615 r17633 670 670 else shelf=false; 671 671 } 672 else if(migration_style==NoneEnum || migration_style==AgressiveMigrationEnum || migration_style==SoftMigrationEnum ){ //Floating if all nodes are floating672 else if(migration_style==NoneEnum || migration_style==AgressiveMigrationEnum || migration_style==SoftMigrationEnum || migration_style==ContactEnum){ //Floating if all nodes are floating 673 673 if(this->inputs->Min(MaskGroundediceLevelsetEnum) > 0.) shelf=false; 674 674 else shelf=true; -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r17610 r17633 1323 1323 /*Intermediaries*/ 1324 1324 IssmDouble* xyz_list = NULL; 1325 1326 /*Figure out wether element is grounded or floating*/ 1327 bool grounded = true; 1325 IssmDouble pressure,water_pressure,sigma_nn,viscosity,bed,base; 1326 IssmDouble bed_normal[2]; 1327 IssmDouble epsilon[3]; /* epsilon=[exx,eyy,exy];*/ 1328 IssmDouble surface=0,value=0; 1329 bool grounded; 1330 1331 IssmDouble* basis = xNew<IssmDouble>(NUMVERTICES); 1332 1328 1333 1329 1334 /* Get node coordinates and dof list: */ 1330 ::GetVerticesCoordinates(xyz_list,vertices,NUMVERTICES);1335 GetVerticesCoordinates(&xyz_list); 1331 1336 1332 1337 /*Retrieve all inputs we will be needing: */ 1333 Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input); 1334 Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input); 1335 Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input); 1336 1337 _error_("STOP"); 1338 1338 Input* pressure_input = inputs->GetInput(PressureEnum); _assert_(pressure_input); 1339 Input* base_input = inputs->GetInput(BaseEnum); _assert_(base_input); 1340 Input* bed_input = inputs->GetInput(BedEnum); _assert_(bed_input); 1341 Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input); 1342 Input* vy_input = inputs->GetInput(VyEnum); _assert_(vy_input); 1343 1344 Gauss* gauss=NewGaussBase(1); 1345 gauss->GaussPoint(0); 1346 1347 if(!IsFloating()){ 1348 1349 this->StrainRateSSA(&epsilon[0],xyz_list,gauss,vx_input,vy_input); 1350 this->ViscosityFS(&viscosity,2,xyz_list,gauss,vx_input,vy_input,NULL); 1351 pressure_input->GetInputValue(&pressure, gauss); 1352 base_input->GetInputValue(&base, gauss); _assert_(base<0.); 1353 1354 /*Compute Stress*/ 1355 IssmDouble sigma_xx=2.*viscosity*epsilon[0]-pressure; 1356 IssmDouble sigma_yy=2.*viscosity*epsilon[1]-pressure; 1357 IssmDouble sigma_xy=2.*viscosity*epsilon[2]; 1358 1359 /*Get normal vector to the bed */ 1360 NormalBase(&bed_normal[0],xyz_list); 1361 1362 /*basalforce*/ 1363 sigma_nn = sigma_xx*bed_normal[0]*bed_normal[0] + sigma_yy*bed_normal[1]*bed_normal[1] + 2.*sigma_xy*bed_normal[0]*bed_normal[1]; 1364 1365 /*Compute water pressure*/ 1366 IssmDouble rho_ice = matpar->GetRhoIce(); 1367 IssmDouble rho_water = matpar->GetRhoWater(); 1368 IssmDouble gravity = matpar->GetG(); 1369 water_pressure=gravity*rho_water*base; 1370 1371 /*Compare basal stress to water pressure and determine whether it should ground*/ 1372 if (sigma_nn<water_pressure) grounded=true; 1373 else grounded=false; 1374 } 1375 else{ 1376 base_input->GetInputValue(&base, gauss); 1377 bed_input->GetInputValue(&bed, gauss); 1378 if (base<bed) grounded=true; 1379 else grounded=false; 1380 } 1339 1381 for(int i=0;i<NUMVERTICES;i++){ 1340 1382 if(grounded) vertexgrounded->SetValue(vertices[i]->Pid(),+1.,INS_VAL); … … 1343 1385 1344 1386 /*clean up*/ 1387 delete gauss; 1345 1388 xDelete<IssmDouble>(xyz_list); 1346 1347 1389 } 1348 1390 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.