Changeset 27271
- Timestamp:
- 09/08/22 13:36:36 (3 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r27102 r27271 334 334 void Penta::CalvingRateLevermann(){/*{{{*/ 335 335 336 IssmDouble vx,vy,vel;337 336 IssmDouble strainparallel; 338 337 IssmDouble propcoeff; 339 338 IssmDouble strainperpendicular; 340 IssmDouble calvingratex[NUMVERTICES];341 IssmDouble calvingratey[NUMVERTICES];342 339 IssmDouble calvingrate[NUMVERTICES]; 343 340 … … 355 352 356 353 /* Get the value we need*/ 357 vx_input->GetInputValue(&vx,&gauss);358 vy_input->GetInputValue(&vy,&gauss);359 vel=vx*vx+vy*vy;360 354 strainparallel_input->GetInputValue(&strainparallel,&gauss); 361 355 strainperpendicular_input->GetInputValue(&strainperpendicular,&gauss); … … 367 361 calvingrate[iv]=0; 368 362 } 369 calvingratex[iv]=calvingrate[iv]*vx/(sqrt(vel)+1.e-14);370 calvingratey[iv]=calvingrate[iv]*vy/(sqrt(vel)+1.e-14);371 363 } 372 364 373 365 /*Add input*/ 374 this->AddBasalInput(CalvingratexEnum,&calvingratex[0],P1DGEnum);375 this->AddBasalInput(CalvingrateyEnum,&calvingratey[0],P1DGEnum);376 366 this->AddBasalInput(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum); 367 this->CalvingFromRate(); 377 368 }/*}}}*/ 378 369 void Penta::CalvingFluxLevelset(){/*{{{*/ … … 2932 2923 /*Get calving speed*/ 2933 2924 switch(calvinglaw){ 2925 /*"Contiuous" calving*/ 2934 2926 case DefaultCalvingEnum: 2935 2927 case CalvingVonmisesEnum: … … 2943 2935 break; 2944 2936 2937 /*"Discrete" calving*/ 2945 2938 case CalvingMinthicknessEnum: 2946 2939 case CalvingHabEnum: -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r27253 r27271 526 526 void Tria::CalvingRateLevermann(){/*{{{*/ 527 527 528 IssmDouble vx,vy,vel;529 528 IssmDouble strainparallel; 530 529 IssmDouble propcoeff,bed; 531 530 IssmDouble strainperpendicular; 532 IssmDouble calvingratex[NUMVERTICES];533 IssmDouble calvingratey[NUMVERTICES];534 531 IssmDouble calvingrate[NUMVERTICES]; 535 532 536 533 /*Retrieve all inputs and parameters we will need*/ 537 Input *vx_input = this->GetInput(VxEnum); _assert_(vx_input);538 Input *vy_input = this->GetInput(VyEnum); _assert_(vy_input);539 534 Input *bs_input = this->GetInput(BaseEnum); _assert_(bs_input); 540 535 Input *strainparallel_input = this->GetInput(StrainRateparallelEnum); _assert_(strainparallel_input); … … 548 543 549 544 /* Get the value we need*/ 550 vx_input->GetInputValue(&vx,&gauss);551 vy_input->GetInputValue(&vy,&gauss);552 vel=vx*vx+vy*vy;553 545 strainparallel_input->GetInputValue(&strainparallel,&gauss); 554 546 strainperpendicular_input->GetInputValue(&strainperpendicular,&gauss); … … 562 554 else 563 555 calvingrate[iv]=0.; 564 565 calvingratex[iv]=calvingrate[iv]*vx/(sqrt(vel)+1.e-14);566 calvingratey[iv]=calvingrate[iv]*vy/(sqrt(vel)+1.e-14);567 556 } 568 557 569 558 /*Add input*/ 570 this->AddInput(CalvingratexEnum,&calvingratex[0],P1DGEnum);571 this->AddInput(CalvingrateyEnum,&calvingratey[0],P1DGEnum);572 559 this->AddInput(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum); 560 this->CalvingFromRate(); 573 561 }/*}}}*/ 574 562 void Tria::CalvingFluxLevelset(){/*{{{*/ … … 4358 4346 /*Get calving speed*/ 4359 4347 switch(calvinglaw){ 4348 4349 /*RATE calving laws*/ 4360 4350 case DefaultCalvingEnum: 4361 4351 case CalvingVonmisesEnum: 4362 4352 case CalvingTestEnum: 4363 4353 case CalvingParameterizationEnum: 4354 case CalvingLevermannEnum: 4364 4355 calvingratex_input->GetInputValue(&c[0],&gauss); 4365 4356 calvingratey_input->GetInputValue(&c[1],&gauss); … … 4376 4367 break; 4377 4368 4378 case CalvingLevermannEnum: 4379 calvingratex_input->GetInputValue(&c[0],&gauss); 4380 if(dim==2) calvingratey_input->GetInputValue(&c[1],&gauss); 4381 meltingrate_input->GetInputValue(&meltingrate,&gauss); 4382 norm_calving=0.; 4383 for(i=0;i<dim;i++) norm_calving+=pow(c[i],2); 4384 norm_calving=sqrt(norm_calving)+1.e-14; 4385 for(i=0;i<dim;i++) m[i]=meltingrate*c[i]/norm_calving; 4386 break; 4387 4369 /*Discrete calving laws*/ 4388 4370 case CalvingMinthicknessEnum: 4389 4371 case CalvingHabEnum:
Note:
See TracChangeset
for help on using the changeset viewer.