diff options
author | allen <allen@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 2003-07-07 14:30:59 +0000 |
---|---|---|
committer | allen <allen@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 2003-07-07 14:30:59 +0000 |
commit | 9c96ad2308dc2ec42e6726e2be6bf4e0ba0b14c3 (patch) | |
tree | be017bc21da45f78e3e706ca717dd9e565e4f6af | |
parent | 294746db1a2b5e6d25dfa243d7ad5cef49800d59 (diff) |
Fixed bug in checking against group index for applying boundary conditions
Fixes Cactus/1557
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@238 6a38eb6e-646e-4a02-a296-d141613ad6c4
-rw-r--r-- | src/Boundary.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/Boundary.c b/src/Boundary.c index 3c73a03..3006faf 100644 --- a/src/Boundary.c +++ b/src/Boundary.c @@ -192,7 +192,8 @@ CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER GH, if (!theGH) /* This is the first valid GH passed to a Boundary routine */ { theGH = GH; - } else if (GH != theGH) + } + else if (GH != theGH) { CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING, "New GH passed to Boundary_RegisterPhysicalBC. " @@ -236,7 +237,8 @@ CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER GH, "There already exists a physical boundary condition " "registered under the name \"%s\"", bc_name); retval = -2; - } else + } + else { /* Add boundary condition to table */ if (Util_TableSetFnPointer(physbc_table_handle, fn_pointer, bc_name)<0) @@ -322,7 +324,8 @@ CCTK_INT Bdry_Boundary_SelectVarForBC(CCTK_POINTER GH, CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING, "Invalid variable name"); retval = -11; - } else + } + else { retval = Bdry_Boundary_SelectVarForBCI(GH, faces, width, table_handle, var_index, bc_name); @@ -413,7 +416,8 @@ CCTK_INT Bdry_Boundary_SelectVarForBCI(CCTK_POINTER GH, if (!theGH) /* This is the first valid GH passed to a Boundary routine */ { theGH = GH; - } else if (GH != theGH) + } + else if (GH != theGH) { CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING, "New GH passed to Boundary_SelectVarForBCI. " @@ -707,12 +711,13 @@ CCTK_INT Bdry_Boundary_SelectGroupForBC(CCTK_POINTER GH, /* get group index */ gi = CCTK_GroupIndex(group_name); - if (!gi) + if (gi<0) { CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING, "Invalid group name %s\n", group_name); retval = -6; - } else + } + else { /* call Bdry_Boundary_SelectGroupForBCI() */ retval = Bdry_Boundary_SelectGroupForBCI(GH, faces, width, table_handle, gi, @@ -884,7 +889,8 @@ CCTK_INT Bdry_Boundary_SelectedGVs(CCTK_POINTER GH, if (!theGH) /* This is the first valid GH passed to a Boundary routine */ { theGH = GH; - } else if (GH != theGH) + } + else if (GH != theGH) { CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING, "New GH passed to Boundary_SelectedGVs. " @@ -1168,16 +1174,20 @@ static int entry_greater_than(struct BCVAR *new, struct BCVAR *current) if (new->table > current->table) { retval = 1; - } else if (new->table < current->table) + } + else if (new->table < current->table) { retval = 0; - } else if (new->var > current->var) + } + else if (new->var > current->var) { retval = 2; - } else if (new->var < current->var) + } + else if (new->var < current->var) { retval = 0; - } else + } + else { CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING, "%s has already been selected for this boundary condition!", |