Changeset 17629
- Timestamp:
- 04/02/14 16:46:22 (11 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
r17628 r17629 3552 3552 xDelete<IssmDouble>(xyz_list); 3553 3553 xDelete<IssmDouble>(Dstar); 3554 3554 xDelete<IssmDouble>(d); 3555 3555 xDelete<IssmDouble>(D); 3556 3556 xDelete<IssmDouble>(tau); … … 4244 4244 int dim,tausize,meshtype; 4245 4245 IssmDouble epsxx,epsyy,epszz,epsxy,epsxz,epsyz,D_scalar; 4246 IssmDouble epsxx_old,epsyy_old,epszz_old,epsxy_old,epsxz_old,epsyz_old; 4246 4247 IssmDouble sigmapxx,sigmapyy,sigmapzz,sigmapxy,sigmapxz,sigmapyz; 4247 4248 IssmDouble dvx[3],dvy[3],dvz[3],B,n; … … 4287 4288 } 4288 4289 4290 /*Get previous d*/ 4291 Input* epsxx_input=element->GetInput(StrainRatexxEnum); _assert_(epsxx_input); 4292 Input* epsyy_input=element->GetInput(StrainRateyyEnum); _assert_(epsyy_input); 4293 Input* epsxy_input=element->GetInput(StrainRatexyEnum); _assert_(epsxy_input); 4294 Input* epszz_input=NULL; Input* epsxz_input=NULL; Input* epsyz_input=NULL; 4295 if(dim==3){ 4296 epszz_input=element->GetInput(StrainRatezzEnum); _assert_(epszz_input); 4297 epsxz_input=element->GetInput(StrainRatexzEnum); _assert_(epsxz_input); 4298 epsyz_input=element->GetInput(StrainRateyzEnum); _assert_(epsyz_input); 4299 } 4300 4289 4301 /*Get tau*/ 4290 4302 Input* sigmapxx_input=element->GetInput(DeviatoricStressxxEnum); _assert_(sigmapxx_input); … … 4312 4324 sigmapxz_input->GetInputValue(&sigmapxz,gauss); 4313 4325 sigmapyz_input->GetInputValue(&sigmapyz,gauss); 4326 } 4327 4328 /*Get previous d*/ 4329 epsxx_input->GetInputValue(&epsxx_old,gauss); 4330 epsyy_input->GetInputValue(&epsyy_old,gauss); 4331 epsxy_input->GetInputValue(&epsxy_old,gauss); 4332 if(dim==3){ 4333 epszz_input->GetInputValue(&epszz_old,gauss); 4334 epsxz_input->GetInputValue(&epsxz_old,gauss); 4335 epsyz_input->GetInputValue(&epsyz_old,gauss); 4314 4336 } 4315 4337 … … 4333 4355 B_input->GetInputValue(&B,gauss); 4334 4356 n_input->GetInputValue(&n,gauss); 4335 coef1 = (B/2.)*pow(1./sqrt(2.),(1.-n)/n); //2 eta_04357 coef1 = B*pow(1./sqrt(2.),(1.-n)/n); //2 eta_0 = 2 * B/(2* (1/sqrt(2) )^(n-1)/n ) 4336 4358 coef2 = r; 4337 4359 if(dim==2){ … … 4353 4375 } 4354 4376 IssmDouble dnorm; 4355 NewtonSolveDnorm(&dnorm,coef1,coef2,coef3,n); 4377 if(dim==2){ 4378 dnorm = sqrt( epsxx_old*epsxx_old + epsyy_old*epsyy_old + 2.*epsxy_old*epsxy_old ); 4379 } 4380 else{ 4381 dnorm = sqrt( epsxx_old*epsxx_old + epsyy_old*epsyy_old + epszz_old*epszz_old 4382 +2.*(epsxy_old*epsxy_old + epsxz_old*epsxz_old + epsyz_old*epsyz_old)); 4383 } 4384 NewtonSolveDnorm(&dnorm,coef1,coef2,coef3,n,dnorm); 4356 4385 4357 4386 /*Create Ke*/ … … 4412 4441 IssmDouble* tau_xz = NULL; 4413 4442 IssmDouble* tau_yz = NULL; 4414 Input* epsxx_input=element->GetInput(StrainRatexxEnum); _assert_(epsxx_input);4415 Input* epsyy_input=element->GetInput(StrainRateyyEnum); _assert_(epsyy_input);4416 Input* epsxy_input=element->GetInput(StrainRatexyEnum); _assert_(epsxy_input);4417 Input* epszz_input=NULL; Input* epsxz_input=NULL; Input* epsyz_input=NULL;4418 if(dim==3){4419 epszz_input=element->GetInput(StrainRatezzEnum); _assert_(epszz_input);4420 epsxz_input=element->GetInput(StrainRatexzEnum); _assert_(epsxz_input);4421 epsyz_input=element->GetInput(StrainRateyzEnum); _assert_(epsyz_input);4422 }4423 4443 delete gauss; 4424 4444 gauss = element->NewGauss(); -
issm/trunk-jpl/src/c/shared/Numerics/NewtonSolveDnorm.cpp
r17553 r17629 3 3 #include "../Exceptions/exceptions.h" 4 4 5 int NewtonSolveDnorm(IssmDouble* pdnorm,IssmDouble c1,IssmDouble c2,IssmDouble c3,IssmDouble n ){5 int NewtonSolveDnorm(IssmDouble* pdnorm,IssmDouble c1,IssmDouble c2,IssmDouble c3,IssmDouble n,IssmDouble dnorm){ 6 6 /* solve the following equation using Newton-Raphson 7 7 * … … 26 26 27 27 /*Initial guess*/ 28 IssmDouble y1 = 0.;28 IssmDouble y1 = log10(dnorm); 29 29 30 30 while(true){ -
issm/trunk-jpl/src/c/shared/Numerics/numerics.h
r17546 r17629 38 38 int cubic(IssmDouble a, IssmDouble b, IssmDouble c, IssmDouble d, double X[3], int *num); 39 39 40 int NewtonSolveDnorm(IssmDouble* pdnorm,IssmDouble c1,IssmDouble c2,IssmDouble c3,IssmDouble n );40 int NewtonSolveDnorm(IssmDouble* pdnorm,IssmDouble c1,IssmDouble c2,IssmDouble c3,IssmDouble n,IssmDouble dnorm); 41 41 42 42 #endif //ifndef _NUMERICS_H_
Note:
See TracChangeset
for help on using the changeset viewer.