aboutsummaryrefslogtreecommitdiff
path: root/src/apply.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/apply.c')
-rw-r--r--src/apply.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/apply.c b/src/apply.c
index 4492579..be20dee 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -227,16 +227,24 @@ BndReflectVI (cGH const * restrict const cctkGH,
/* Get and check tensor type information */
ierr = Util_TableGetString
(table, sizeof tensortypealias, tensortypealias, "tensortypealias");
- int tensortype_is_explicit = 1;
if (ierr == UTIL_ERROR_TABLE_NO_SUCH_KEY) {
- groupname = CCTK_GroupName(gi);
- assert (groupname);
- CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Tensor type alias not declared for group \"%s\" -- assuming a scalar",
- groupname);
- free (groupname);
+ /* assume a scalar */
+ if (numvars != 1) {
+ static int * restrict didwarn = 0;
+ if (! didwarn) {
+ didwarn = calloc (CCTK_NumGroups(), sizeof *didwarn);
+ }
+ if (! didwarn[gi]) {
+ didwarn[gi] = 1;
+ groupname = CCTK_GroupName(gi);
+ 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");
- tensortype_is_explicit = 0;
} else if (ierr<0) {
groupname = CCTK_GroupName(gi);
assert (groupname);
@@ -251,14 +259,6 @@ BndReflectVI (cGH const * restrict const cctkGH,
if (CCTK_EQUALS (tensortypealias, "scalar"))
{
/* scalar */
- if (numvars != 1 && ! tensortype_is_explicit) {
- groupname = CCTK_GroupName(gi);
- assert (groupname);
- CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Group \"%s\" has the tensor type alias \"scalar\", but contains more than 1 element",
- groupname);
- free (groupname);
- }
ttype = SCALAR;
tcomponent = 0;
}