diff options
author | knarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2010-10-27 14:26:31 +0000 |
---|---|---|
committer | knarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2010-10-27 14:26:31 +0000 |
commit | b713dc18e04c1aa36e1b19ead120c9b643d7eb67 (patch) | |
tree | 4755021e99549399d3f571cf162e0e4a9889c43d /src/main | |
parent | 373bfa92bdc2ebceef041e70915bd0776b8d78cc (diff) |
detect error in dimension size settings of grid arrays, and produce a meaningful error message
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4644 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/Groups.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/Groups.c b/src/main/Groups.c index 40d80a29..cf501a53 100644 --- a/src/main/Groups.c +++ b/src/main/Groups.c @@ -222,7 +222,8 @@ static cGroupDefinition *CCTKi_SetupGroup (const char *implementation, int vectorlength); static CCTK_INT **CCTKi_ExtractSize (int dimension, const char *thorn, - const char *sizestring); + const char *sizestring, + const char *gname); static int CCTKi_ParamExpressionToInt(const char *expression, const char *thorn); @@ -2494,8 +2495,8 @@ int CCTKi_CreateGroup (const char *gname, { staggered = 1; } - group->size = CCTKi_ExtractSize (dimension, thorn, size); - group->ghostsize = CCTKi_ExtractSize (dimension, thorn, ghostsize); + group->size = CCTKi_ExtractSize (dimension, thorn, size, gname); + group->ghostsize = CCTKi_ExtractSize (dimension, thorn, ghostsize, gname); /* Only typically have GFs in a single dimension */ if (group->gtype == CCTK_GF) @@ -2700,14 +2701,14 @@ static cGroupDefinition *CCTKi_SetupGroup (const char *implementation, @@*/ static CCTK_INT **CCTKi_ExtractSize (int dimension, const char *this_thorn, - const char *sizestring) + const char *sizestring, + const char *gname) { int dim; char *tmp; const char *last_comma, *next_comma; CCTK_INT **size_array; - if (dimension < 0) { CCTK_Warn (0, __LINE__, __FILE__, "Cactus","Illegal dimension specified"); @@ -2732,6 +2733,10 @@ static CCTK_INT **CCTKi_ExtractSize (int dimension, for (dim = 0; dim < dimension; dim++) { + if (!next_comma) + { + CCTK_VWarn (0, __LINE__, __FILE__, "Cactus","Insufficient dimension size specified in %s::%s -> %s", this_thorn, gname, sizestring); + } /* find the comma as a delimiter for different dimension sizes */ last_comma = next_comma[0] == ',' ? next_comma+1 : next_comma; next_comma = strstr (last_comma, ","); |