From 5d2f67b5537ddf630fc98c21763e3c2a670ac402 Mon Sep 17 00:00:00 2001 From: allen Date: Fri, 10 Sep 1999 09:36:27 +0000 Subject: Check that variable indices are >= 0 and not > 0, otherwise you can never apply boundary conditions to the variable with the first index ! git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@19 6a38eb6e-646e-4a02-a296-d141613ad6c4 --- src/FlatBoundary.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/FlatBoundary.c') diff --git a/src/FlatBoundary.c b/src/FlatBoundary.c index 0b8bcb8..b1a4fb3 100644 --- a/src/FlatBoundary.c +++ b/src/FlatBoundary.c @@ -67,20 +67,27 @@ void ApplyFlatBC(cGH *GH, int *stencil_size, char *name) { /* Decide if we have a group or a variable, and get the index */ /* type = 1 (group), type = 0 (var), type = -1 (neither) */ - + num = CCTK_GroupIndex(name); if (num < 0) { num = CCTK_VarIndex(name); - if (num > 0) + if (num >= 0) { type = 1; /* Variable */ } else { type = -1; - CCTK_WARN(0,"Name in ApplyFlatBC is neither a group nor a variable"); + { + char *message; + message = (char *)malloc( 1024*sizeof(char) ); + sprintf(message,"Name (%s) in ApplyFlatBC is not a group or variable", + name); + CCTK_WARN(1,message); + free(message); + } } } else -- cgit v1.2.3