Changeset 24373
- Timestamp:
- 11/20/19 17:37:35 (5 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
r24335 r24373 1 1 #ifdef HAVE_CONFIG_H 2 2 #include <config.h> 3 3 #else 4 4 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" … … 435 435 436 436 case CalvingDev2Enum: 437 {438 lsf_slopex_input->GetInputValue(&dlsf[0],gauss);439 if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);440 calvingrate_input->GetInputValue(&calvingrate,gauss);441 meltingrate_input->GetInputValue(&meltingrate,gauss);442 gr_input->GetInputValue(&groundedice,gauss);443 444 //idea: no retreat on ice above critical calving height "calvinghaf" . Limit using regularized Heaviside function.445 vel=sqrt(v[0]*v[0] + v[1]*v[1]);446 haf_eps=10.;447 if(groundedice-calvinghaf<=-haf_eps){448 // ice floats freely below calvinghaf: calve freely449 // undercutting has no effect:450 meltingrate=0.;451 }452 else if(groundedice-calvinghaf>=haf_eps){453 // ice is well above calvinghaf -> no calving back, i.e. limit calving rate to ice velocity454 calvingrate=min(calvingrate,vel);455 // ice is almost grounded: frontal undercutting has maximum effect (do nothing).456 }457 else{ // ice is close to calvinghaf: smooth transition between limitation and free calving.458 //heaviside: 0 for floating, 1 for grounded459 heaviside=(groundedice-calvinghaf+haf_eps)/(2.*haf_eps) + sin(PI*(groundedice-calvinghaf)/haf_eps)/(2.*PI);460 calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate;461 meltingrate=heaviside*meltingrate+0.;462 }463 464 norm_dlsf=0.;465 for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);466 norm_dlsf=sqrt(norm_dlsf);467 468 if(norm_dlsf>1.e-10)469 for(i=0;i<dim;i++){470 c[i]=calvingrate*dlsf[i]/norm_dlsf;471 m[i]=meltingrate*dlsf[i]/norm_dlsf;472 }473 else474 for(i=0;i<dim;i++){475 c[i]=0.;476 m[i]=0.;477 }478 break;479 }437 { 438 lsf_slopex_input->GetInputValue(&dlsf[0],gauss); 439 if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss); 440 calvingrate_input->GetInputValue(&calvingrate,gauss); 441 meltingrate_input->GetInputValue(&meltingrate,gauss); 442 gr_input->GetInputValue(&groundedice,gauss); 443 444 //idea: no retreat on ice above critical calving height "calvinghaf" . Limit using regularized Heaviside function. 445 vel=sqrt(v[0]*v[0] + v[1]*v[1]); 446 haf_eps=10.; 447 if(groundedice-calvinghaf<=-haf_eps){ 448 // ice floats freely below calvinghaf: calve freely 449 // undercutting has no effect: 450 meltingrate=0.; 451 } 452 else if(groundedice-calvinghaf>=haf_eps){ 453 // ice is well above calvinghaf -> no calving back, i.e. limit calving rate to ice velocity 454 calvingrate=min(calvingrate,vel); 455 // ice is almost grounded: frontal undercutting has maximum effect (do nothing). 456 } 457 else{ // ice is close to calvinghaf: smooth transition between limitation and free calving. 458 //heaviside: 0 for floating, 1 for grounded 459 heaviside=(groundedice-calvinghaf+haf_eps)/(2.*haf_eps) + sin(PI*(groundedice-calvinghaf)/haf_eps)/(2.*PI); 460 calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate; 461 meltingrate=heaviside*meltingrate+0.; 462 } 463 464 norm_dlsf=0.; 465 for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2); 466 norm_dlsf=sqrt(norm_dlsf); 467 468 if(norm_dlsf>1.e-10) 469 for(i=0;i<dim;i++){ 470 c[i]=calvingrate*dlsf[i]/norm_dlsf; 471 m[i]=meltingrate*dlsf[i]/norm_dlsf; 472 } 473 else 474 for(i=0;i<dim;i++){ 475 c[i]=0.; 476 m[i]=0.; 477 } 478 break; 479 } 480 480 481 481 default: … … 518 518 case 2: 519 519 { 520 /* Streamline Upwinding */521 basalelement->ElementSizes(&hx,&hy,&hz);522 h=sqrt( pow(hx*w[0]/vel,2) + pow(hy*w[1]/vel,2) );523 IssmDouble D[9];524 for(row=0;row<dim;row++)525 for(col=0;col<dim;col++)526 527 GetBprime(Bprime,basalelement,xyz_list,gauss);528 529 TripleMultiply(Bprime,dim,numnodes,1,530 &D[0],dim,dim,0,531 Bprime,dim,numnodes,0,532 &Ke->values[0],1);520 /* Streamline Upwinding */ 521 basalelement->ElementSizes(&hx,&hy,&hz); 522 h=sqrt( pow(hx*w[0]/vel,2) + pow(hy*w[1]/vel,2) ); 523 IssmDouble D[9]; 524 for(row=0;row<dim;row++) 525 for(col=0;col<dim;col++) 526 D[row*dim+col] = D_scalar*h/(2.*vel)*w[row]*w[col]; 527 GetBprime(Bprime,basalelement,xyz_list,gauss); 528 529 TripleMultiply(Bprime,dim,numnodes,1, 530 &D[0],dim,dim,0, 531 Bprime,dim,numnodes,0, 532 &Ke->values[0],1); 533 533 } 534 534 break; … … 669 669 norm_b=0.; 670 670 for(i=0;i<dim;i++) 671 671 norm_b+=b[i]*b[i]; 672 672 norm_b=sqrt(norm_b); 673 673 _assert_(norm_b>0.); -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r24368 r24373 170 170 if(!IsOnBase()) return; 171 171 else{ 172 if(interpolation_enum==P1Enum ){172 if(interpolation_enum==P1Enum || interpolation_enum==P1DGEnum){ 173 173 IssmDouble extrudedvalues[NUMVERTICES]; 174 174 for(int i=0;i<NUMVERTICES2D;i++){ … … 178 178 Penta* penta=this; 179 179 for(;;){ 180 penta->AddInput2(input_enum,&extrudedvalues[0], P1Enum);180 penta->AddInput2(input_enum,&extrudedvalues[0],interpolation_enum); 181 181 if (penta->IsOnSurface()) break; 182 182 penta=penta->GetUpperPenta(); _assert_(penta->Id()!=this->id); … … 382 382 383 383 /*Add input*/ 384 this->Add Input2(CalvingratexEnum,&calvingratex[0],P1DGEnum);385 this->Add Input2(CalvingrateyEnum,&calvingratey[0],P1DGEnum);386 this->Add Input2(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum);387 this->Add Input2(SigmaVMEnum,&sigma_vm[0],P1DGEnum);384 this->AddBasalInput2(CalvingratexEnum,&calvingratex[0],P1DGEnum); 385 this->AddBasalInput2(CalvingrateyEnum,&calvingratey[0],P1DGEnum); 386 this->AddBasalInput2(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum); 387 this->AddBasalInput2(SigmaVMEnum,&sigma_vm[0],P1DGEnum); 388 388 389 389 this->InputExtrude(CalvingratexEnum,-1); … … 441 441 442 442 /*Add input*/ 443 this->Add Input2(CalvingratexEnum,&calvingratex[0],P1DGEnum);444 this->Add Input2(CalvingrateyEnum,&calvingratey[0],P1DGEnum);445 this->Add Input2(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum);443 this->AddBasalInput2(CalvingratexEnum,&calvingratex[0],P1DGEnum); 444 this->AddBasalInput2(CalvingrateyEnum,&calvingratey[0],P1DGEnum); 445 this->AddBasalInput2(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum); 446 446 447 447 /*Clean up and return*/ -
issm/trunk-jpl/src/c/classes/Inputs2/PentaInput2.cpp
r24335 r24373 110 110 if(isserved){ 111 111 _printf_(" current values: "); 112 _printf_("[ "); 113 for(int i=0;i<6;i++) _printf_(" "<<this->element_values[i]); 114 _printf_("] ("<<EnumToStringx(this->interpolation)<<")\n"); 112 if(isserved_collapsed){ 113 _printf_("[ "); 114 for(int i=0;i<6;i++) _printf_(" "<<this->element_values[i]); 115 _printf_("] ("<<EnumToStringx(this->interpolation)<<")\n"); 116 } 117 else{ 118 _printf_("[ "); 119 for(int i=0;i<3;i++) _printf_(" "<<this->element_values[i]); 120 _printf_("] ("<<EnumToStringx(this->interpolation)<<")\n"); 121 } 115 122 } 116 123 } … … 240 247 if(state==1){ 241 248 for(int i=0;i<3;i++) this->element_values[i] = this->values[row*this->N+i]; 249 for(int i=3;i<6;i++) this->element_values[i] = 0.; 242 250 } 243 251 else if(state==2){ 244 252 for(int i=0;i<3;i++) this->element_values[i] = this->values[row*this->N+3+i]; 253 for(int i=3;i<6;i++) this->element_values[i] = 0.; 245 254 } 246 255 else{
Note:
See TracChangeset
for help on using the changeset viewer.