diff options
author | schnetter <schnetter@082bdb00-0f4f-0410-b49e-b1835e5f2039> | 2005-05-27 12:26:20 +0000 |
---|---|---|
committer | schnetter <schnetter@082bdb00-0f4f-0410-b49e-b1835e5f2039> | 2005-05-27 12:26:20 +0000 |
commit | 596fbf2a8878176d05f768eefcc7ff461a2f8b74 (patch) | |
tree | 74a6ac7fd7443125c4476cc6da209cd16792011a | |
parent | 3b507dc39a18e151bd6ed040664ac93a8fbe7c85 (diff) |
Output fewer warnings.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/ReflectionSymmetry/trunk@9 082bdb00-0f4f-0410-b49e-b1835e5f2039
-rw-r--r-- | src/apply.c | 32 |
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; } |