diff options
author | jthorn <jthorn@6a3ddf76-46e1-4315-99d9-bc56cac1ef84> | 2003-05-06 10:26:16 +0000 |
---|---|---|
committer | jthorn <jthorn@6a3ddf76-46e1-4315-99d9-bc56cac1ef84> | 2003-05-06 10:26:16 +0000 |
commit | 093134b1e65456a387b9edad8cad7921ac533957 (patch) | |
tree | a6dbe47b112ef5a9347826d77dab06d424f5459a /src/BrillLindquist.c | |
parent | 5ec98007b99725ad730f536d7db8c9a89630eea8 (diff) |
fix a bug where setting
ADMBase::metric_type = "static conformal"
StaticConformal::conformal_storage = "factor"
led to the local flag make_conformal_derivs never being initialized.
Alas, later code then tested this flag, and if the random garbage that's
in uninitialized memory happened to be nonzero, the later code would then
proceed to try to initialize the 1st derivatives of the conformal factor.
Since these don't have storage allocated, this core-dumps. :( :(
The bug is fixed by changing the logic to always set make_conformal_derivs .
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/IDAnalyticBH/trunk@128 6a3ddf76-46e1-4315-99d9-bc56cac1ef84
Diffstat (limited to 'src/BrillLindquist.c')
-rw-r--r-- | src/BrillLindquist.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/BrillLindquist.c b/src/BrillLindquist.c index 74b56e6..6793fb3 100644 --- a/src/BrillLindquist.c +++ b/src/BrillLindquist.c @@ -57,18 +57,27 @@ void BrillLindquist(CCTK_ARGUMENTS) /* Check if we should create and store conformal factor stuff */ if(CCTK_EQUALS(metric_type, "static conformal")) { - *conformal_state = 1; - - if(CCTK_EQUALS(conformal_storage,"factor+derivs")) + if (CCTK_EQUALS(conformal_storage,"factor")) + { + *conformal_state = 1; + make_conformal_derivs = 0; + } + else if (CCTK_EQUALS(conformal_storage,"factor+derivs")) { *conformal_state = 2; make_conformal_derivs = 1; } - else if(CCTK_EQUALS(conformal_storage,"factor+derivs+2nd derivs")) + else if (CCTK_EQUALS(conformal_storage,"factor+derivs+2nd derivs")) { *conformal_state = 3; make_conformal_derivs = 1; } + else + { + CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING, +"BrillLindquist(): impossible value for conformal_storage=\"%s\"!"); + /*NOTREACHED*/ + } } else { |