From 7964bfddef9723adbbf7b10dd1163a806668127e Mon Sep 17 00:00:00 2001 From: rhaas Date: Thu, 28 Mar 2013 01:48:57 +0000 Subject: GRHydro_Init_Data: remove rho_guess from find_bondi_solution was used to call the newton solver twice with the very same arguments. Not sure what the idea was. From: Roland Haas git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/GRHydro_InitData/trunk@200 ac85fae7-cede-4708-beff-ae01c7fa1c26 --- src/GRHydro_BondiM.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/GRHydro_BondiM.c b/src/GRHydro_BondiM.c index 9dc4224..0b2e6f7 100644 --- a/src/GRHydro_BondiM.c +++ b/src/GRHydro_BondiM.c @@ -647,7 +647,7 @@ static int find_bondi_solution( CCTK_REAL r, CCTK_REAL *rho, CCTK_REAL *u, CCTK_ const int ntries = 10000; int itry; - CCTK_REAL rhotmp, rho_guess; + CCTK_REAL rhotmp; CCTK_REAL dr,ur; @@ -662,17 +662,12 @@ static int find_bondi_solution( CCTK_REAL r, CCTK_REAL *rho, CCTK_REAL *u, CCTK_ } else { // rhotmp = (sqrt(Qdot) - 1.) * (gamma_eos - 1.) / ( gamma_eos * K ); - // rho_guess = pow( rhotmp , (1./(gamma_eos - 1.)) ); if(r < rs) { ur = pow(r,-0.5) ; } else { ur = 0.5*pow(r,-1.5) ; } *rho = Mdot / (4.*M_PI * r * r * ur); } } - // safe guess value for multiple tries - rho_guess = *rho; - - // set global variables needed by residual function: r_sol = r ; @@ -681,12 +676,6 @@ static int find_bondi_solution( CCTK_REAL r, CCTK_REAL *rho, CCTK_REAL *u, CCTK_ retval = gnr_bondi( rho, NEWT_DIM_B, bondi_resid); - // first try guess if failure - if( retval ) { - *rho = rho_guess; - retval = gnr_bondi( rho, NEWT_DIM_B, bondi_resid); - } - // If we were unsure about the guess and solver fails, then creep from known solution to desired point: if( retval ) { -- cgit v1.2.3