aboutsummaryrefslogtreecommitdiff
path: root/src/FlatBoundary.c
diff options
context:
space:
mode:
authorallen <allen@6a38eb6e-646e-4a02-a296-d141613ad6c4>1999-09-10 09:36:27 +0000
committerallen <allen@6a38eb6e-646e-4a02-a296-d141613ad6c4>1999-09-10 09:36:27 +0000
commit5d2f67b5537ddf630fc98c21763e3c2a670ac402 (patch)
tree2c5cedc67df9cb4cc02ced668371f0a2de3d6526 /src/FlatBoundary.c
parentdf82845b8f6075a1dca7801d8a0f692f9724cfe7 (diff)
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
Diffstat (limited to 'src/FlatBoundary.c')
-rw-r--r--src/FlatBoundary.c13
1 files changed, 10 insertions, 3 deletions
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