Changeset 26601
- Timestamp:
- 11/10/21 18:30:41 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Loads/Friction.cpp
r26585 r26601 197 197 IssmDouble vmag = VelMag(gauss); 198 198 199 /*Check to prevent dividing by zero if vmag==0*/ 200 if(vmag==0. && (s-1.)<=0.) alpha_complement=0.; 201 else alpha_complement=pow(Neff,r)*pow(vmag,(s-1)); 199 if(s==1.){ 200 /*This is to make AD happy and avoid 0^0*/ 201 alpha_complement=pow(Neff,r); 202 } 203 else{ 204 /*Check to prevent dividing by zero if vmag==0*/ 205 if(vmag==0. && (s-1.)<0.) alpha_complement=0.; 206 else alpha_complement=pow(Neff,r)*pow(vmag,(s-1.)); 207 } 202 208 203 209 /*Assign output pointers:*/ … … 344 350 IssmDouble vmag = VelMag(gauss); 345 351 346 /*Check to prevent dividing by zero if vmag==0*/347 if(vmag==0. && (s-1.)<=0.){348 alpha2= 0.;352 if(s==1.){ 353 /*This is to make AD happy and avoid 0^0*/ 354 alpha2=drag_coefficient*drag_coefficient*pow(Neff,r); 349 355 } 350 356 else{ 351 alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.)); 357 /*Check to prevent dividing by zero if vmag==0*/ 358 if(vmag==0. && (s-1.)<0.) alpha2=0.; 359 else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.)); 352 360 } 353 361 … … 541 549 542 550 /*Check to prevent dividing by zero if vmag==0*/ 543 if(vmag==0. && (s-1.)<=0.) alpha2=0.; 544 else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.)); 551 if(s==1.){ 552 /*This is to make AD happy and avoid 0^0*/ 553 alpha2=drag_coefficient*drag_coefficient*pow(Neff,r); 554 } 555 else{ 556 if(vmag==0. && (s-1.)<0.) alpha2=0.; 557 else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.)); 558 } 545 559 546 560 /*Assign output pointers:*/ … … 586 600 IssmDouble vmag = VelMag(gauss); 587 601 588 /*Check to prevent dividing by zero if vmag==0*/ 589 if(vmag==0. && (s-1.)<=0.) alpha2=0.; 590 else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.)); 602 if(s==1.){ 603 /*This is to make AD happy and avoid 0^0*/ 604 alpha2=drag_coefficient*drag_coefficient*pow(Neff,r); 605 } 606 else{ 607 /*Check to prevent dividing by zero if vmag==0*/ 608 if(vmag==0. && (s-1.)<0.) alpha2=0.; 609 else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.)); 610 } 591 611 592 612 /*Assign output pointers:*/
Note:
See TracChangeset
for help on using the changeset viewer.