From 596fbf2a8878176d05f768eefcc7ff461a2f8b74 Mon Sep 17 00:00:00 2001 From: schnetter Date: Fri, 27 May 2005 12:26:20 +0000 Subject: Output fewer warnings. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/ReflectionSymmetry/trunk@9 082bdb00-0f4f-0410-b49e-b1835e5f2039 --- src/apply.c | 32 ++++++++++++++++---------------- 1 file 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; } -- cgit v1.2.3