diff options
-rw-r--r-- | src/rotatingsymmetry180.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c index d37ca5b..ad2476a 100644 --- a/src/rotatingsymmetry180.c +++ b/src/rotatingsymmetry180.c @@ -73,6 +73,9 @@ int BndRot180VI (cGH const * restrict const cctkGH, } } + /* Return early if there is nothing to do */ + if (nvars == 0) return 0; + /* Get and check group info */ assert (nvars>0); gis = malloc (nvars * sizeof *gis); @@ -125,6 +128,21 @@ int BndRot180VI (cGH const * restrict const cctkGH, (table, sizeof tensortypealias, tensortypealias, "tensortypealias"); if (ierr == UTIL_ERROR_TABLE_NO_SUCH_KEY) { /* assume a scalar */ + if (numvars != 1) { + static int * restrict didwarn = 0; + if (! didwarn) { + didwarn = calloc (CCTK_NumGroups(), sizeof *didwarn); + } + if (! didwarn[gis[var]]) { + didwarn[gis[var]] = 1; + char * groupname = CCTK_GroupName(gis[var]); + assert (groupname); + CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, + "Group \"%s\" has no tensor type and contains more than one element -- treating these as \"scalar\"", + groupname); + free (groupname); + } + } strcpy (tensortypealias, "scalar"); } else if (ierr<0) { char * groupname = CCTK_GroupName(gis[var]); |