From 9ff88a06cc593f10ddaaf706df80d1070fd425e6 Mon Sep 17 00:00:00 2001 From: cott Date: Wed, 18 May 2011 02:53:28 +0000 Subject: * set up consistent values of press and eps in the atmosphere. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/TOVSolver/trunk@128 1bdb13ef-5d69-4035-bb54-08abeb3aa7f1 --- src/tov.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tov.c b/src/tov.c index 68e3171..5ec6f1b 100644 --- a/src/tov.c +++ b/src/tov.c @@ -773,11 +773,14 @@ void TOV_C_Exact(CCTK_ARGUMENTS) my_psi4); rho[i3D] = max_rho; - /* Set atmosphere according to chosen star */ - if(rho[i3D] <= TOV_Atmosphere[star]) - rho[i3D] = TOV_Atmosphere[star]; eps[i3D] = eps_point[star]; press[i3D] = press_point[star]; + /* Set atmosphere according to chosen star */ + if(rho[i3D] <= TOV_Atmosphere[star]) { + rho[i3D] = TOV_Atmosphere[star]; + press[i3D] = TOV_K[star] * pow(rho[i3D],TOV_Gamma[star]); + eps[i3D] = press[i3D]/(TOV_Gamma[star]-1.0)/rho[i3D]; + } } else if (CCTK_EQUALS(TOV_Combine_Method, "average")) @@ -823,8 +826,11 @@ void TOV_C_Exact(CCTK_ARGUMENTS) } /* Reset atmosphere according to chosen star */ - if(rho[i3D] <= TOV_Atmosphere[star_i]) + if(rho[i3D] <= TOV_Atmosphere[star_i]) { rho[i3D] = TOV_Atmosphere[star_i]; + press[i3D] = TOV_K[star_i] * pow(rho[i3D],TOV_Gamma[star_i]); + eps[i3D] = press[i3D]/(TOV_Gamma[star_i]-1.0)/rho[i3D]; + } } if (TOV_Conformal_Flat_Three_Metric) -- cgit v1.2.3