diff options
Diffstat (limited to 'src/RobinBoundary.c')
-rw-r--r-- | src/RobinBoundary.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/RobinBoundary.c b/src/RobinBoundary.c index c5a0171..0161d59 100644 --- a/src/RobinBoundary.c +++ b/src/RobinBoundary.c @@ -13,7 +13,6 @@ @version $Id$ @@*/ -#include <assert.h> #include <math.h> #include <stdlib.h> #include <string.h> @@ -24,7 +23,6 @@ #include "cctk_Parameters.h" #include "cctk_FortranString.h" -#include "Symmetry.h" #include "Boundary.h" /* the rcs ID and its dummy function to use it */ @@ -809,7 +807,10 @@ static int ApplyBndRobin (const cGH *GH, { int var, vtype, dim, gdim; int doBC[2*MAXDIM]; - SymmetryGHex *sGHex; + CCTK_INT symtable; + CCTK_INT symbnd[2*MAXDIM]; + CCTK_INT is_physical[2*MAXDIM]; + CCTK_INT ierr; char coord_system_name[20]; double decay; const CCTK_REAL *x, *y, *z, *r; @@ -869,8 +870,15 @@ static int ApplyBndRobin (const cGH *GH, } r = GH->data[CCTK_CoordIndex (-1, "r", coord_system_name)][0]; - /* see if we have a symmetry array */ - sGHex = (SymmetryGHex *) CCTK_GHExtension (GH, "Symmetry"); + /* see if we have a physical boundary */ + symtable = SymmetryTableHandleForGrid (GH); + if (symtable < 0) CCTK_WARN (0, "internal error"); + ierr = Util_TableGetIntArray (symtable, 2 * gdim, symbnd, "symmetry_handle"); + if (ierr != 2 * gdim) CCTK_WARN (0, "internal error"); + for (dim = 0; dim < 2 * gdim; dim++) + { + is_physical[dim] = symbnd[dim] < 0; + } /* get the decay rate as a double */ decay = (double) npow; @@ -889,18 +897,13 @@ static int ApplyBndRobin (const cGH *GH, for (var = first_var; var < first_var + num_vars; var++) { /* Apply condition if: - + boundary is not a symmetry boundary (no symmetry or unset(=unsed)) + boundary is a physical boundary + + boundary is an outer boundary + have enough grid points */ - memset (doBC, 1, sizeof (doBC)); - if (sGHex) + for (dim = 0; dim < 2 * gdim; dim++) { - for (dim = 0; dim < 2 * gdim; dim++) - { - doBC[dim] = sGHex->GFSym[var][dim] == GFSYM_NOSYM || - sGHex->GFSym[var][dim] == GFSYM_UNSET; - } + doBC[dim] = is_physical[dim]; } for (dim = 0; dim < gdim; dim++) { |