aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@20f44201-0f4f-0410-9130-e5fc2714a787>2006-08-04 18:18:03 +0000
committerschnetter <schnetter@20f44201-0f4f-0410-9130-e5fc2714a787>2006-08-04 18:18:03 +0000
commit511e4907ed81990e0d03c79f47009f1f6cd8ac67 (patch)
treeff131116e2ec223c8a3c268b0aaf63844230342b
parentbef727eb66d163a6e795ba588a50f849a2732474 (diff)
Avoid array access out of bounds in the error messages stating that
there are not enough grid points. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry180/trunk@34 20f44201-0f4f-0410-9130-e5fc2714a787
-rw-r--r--src/rotatingsymmetry180.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c
index fdb69e9..d28b40e 100644
--- a/src/rotatingsymmetry180.c
+++ b/src/rotatingsymmetry180.c
@@ -334,6 +334,8 @@ int BndRot180VI (cGH const * restrict const cctkGH,
}
if (iorigin[dir] != data.nghostzones[dir]) {
+ assert (nvars > 0);
+ var = 0;
CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
"The group \"%s\" has in the %c-direction %d symmetry points (grid points outside of the symmetry boundary). "
"This is not equal to the number of ghost zones, which is %d. "
@@ -344,6 +346,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
if (data.gsh[dir] < 2*data.nghostzones[dir] + offset[dir]) {
assert (nvars > 0);
+ var = 0;
CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
"The group \"%s\" has in the %c-direction only %d grid points. "
"This is not large enough for a 180 degree rotating symmetry boundary that is %d grid points wide. "