diff options
Diffstat (limited to 'src/SetSymmetry.c')
-rw-r--r-- | src/SetSymmetry.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/SetSymmetry.c b/src/SetSymmetry.c index 263af8d..c0742fc 100644 --- a/src/SetSymmetry.c +++ b/src/SetSymmetry.c @@ -59,6 +59,13 @@ int SetCartSymVI (const cGH *GH, const int *sym, int vi) DECLARE_CCTK_PARAMETERS + if (vi < 0 || vi >= CCTK_NumVars ()) + { + CCTK_VWarn(1,__LINE__,__FILE__,CCTK_THORNSTRING, + "Invalid variable index %d in SetCartSymVI", vi); + return(-1); + } + /* Pointer to the SymmetryGHextension */ sGHex = (SymmetryGHex *) CCTK_GHExtension (GH, "Symmetry"); |