Changeset 19154
- Timestamp:
- 02/25/15 09:27:11 (10 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r19094 r19154 1367 1367 IssmDouble Element::PureIceEnthalpy(IssmDouble pressure){/*{{{*/ 1368 1368 return this->matpar->PureIceEnthalpy(pressure); 1369 }/*}}}*/ 1370 void Element::ResetIceLevelset(void){/*{{{*/ 1371 1372 /*Get Ice Levelset on vertices*/ 1373 int numvertices = this->GetNumberOfVertices(); 1374 IssmDouble *values = xNew<IssmDouble>(numvertices); 1375 this->GetInputListOnVertices(values,MaskIceLevelsetEnum); 1376 1377 /*Project on {-1,+1}*/ 1378 for(int i=0;i<numvertices;i++){ 1379 if(values[i]>0) values[i]=+1.; 1380 else values[i]=-1.; 1381 } 1382 this->AddInput(MaskIceLevelsetEnum,values,P1Enum); 1383 1384 /*Cleanup and return*/ 1385 xDelete<IssmDouble>(values); 1386 1369 1387 }/*}}}*/ 1370 1388 void Element::ResultInterpolation(int* pinterpolation,int* pnodesperelement,int output_enum){/*{{{*/ -
issm/trunk-jpl/src/c/classes/Elements/Element.h
r19094 r19154 123 123 ElementVector* NewElementVector(int approximation_enum=NoneApproximationEnum); 124 124 IssmDouble PureIceEnthalpy(IssmDouble pressure); 125 void ResetIceLevelset(void); 125 126 void ResultInterpolation(int* pinterpolation,int*nodesperelement,int output_enum); 126 127 void ResultToPatch(IssmDouble* values,int nodesperelement,int output_enum); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r19137 r19154 336 336 IssmDouble calvingrate[NUMVERTICES]; 337 337 IssmDouble lambda1,lambda2,ex,ey,vx,vy,vel; 338 IssmDouble sigma_vm,sigma_max; 338 339 339 340 /* Get node coordinates and dof list: */ … … 341 342 342 343 /*Retrieve all inputs and parameters we will need*/ 343 Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input); 344 Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input); 344 Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input); 345 Input* vy_input = inputs->GetInput(VyEnum); _assert_(vy_input); 346 IssmDouble B = this->GetMaterialParameter(MaterialsRheologyBbarEnum); 347 IssmDouble n = this->GetMaterialParameter(MaterialsRheologyNEnum); 345 348 346 349 /* Start looping on the number of vertices: */ … … 366 369 lambda2 = max(lambda2,0.); 367 370 371 /*Calculate sigma_vm*/ 372 sigma_vm = sqrt(3./2.) * B * pow(lambda1*lambda1 + lambda2*lambda2,1./(2.*n)); 373 sigma_max = 350.e+3; 374 368 375 /*Assign values*/ 369 calvingratex[iv]=vx* pow(lambda1 + lambda2,1./3.)*3.e+2;370 calvingratey[iv]=vy* pow(lambda1 + lambda2,1./3.)*3.e+2;376 calvingratex[iv]=vx*sigma_vm/sigma_max; 377 calvingratey[iv]=vy*sigma_vm/sigma_max; 371 378 calvingrate[iv]=sqrt(calvingratex[iv]*calvingratex[iv] + calvingratey[iv]*calvingratey[iv]); 372 379 }
Note:
See TracChangeset
for help on using the changeset viewer.