aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjthorn <jthorn@6a3ddf76-46e1-4315-99d9-bc56cac1ef84>2003-05-02 18:54:28 +0000
committerjthorn <jthorn@6a3ddf76-46e1-4315-99d9-bc56cac1ef84>2003-05-02 18:54:28 +0000
commit5ec98007b99725ad730f536d7db8c9a89630eea8 (patch)
tree196c97f8104f41e465b966837b2d00a62aa4735a
parentcb6d5b1e2cfd358471f5a3df47cc98b437eb49bb (diff)
This patch fixes a bug in
void Misner_standard(CCTK_ARGUMENTS) 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@127 6a3ddf76-46e1-4315-99d9-bc56cac1ef84
-rw-r--r--src/Misner_standard.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/Misner_standard.c b/src/Misner_standard.c
index cb14618..f5d8417 100644
--- a/src/Misner_standard.c
+++ b/src/Misner_standard.c
@@ -86,18 +86,27 @@ void Misner_standard(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,
+"Misner_Standard(): impossible value for conformal_storage=\"%s\"!");
+ /*NOTREACHED*/
+ }
}
else
{