diff options
Diffstat (limited to 'src/ScalarBoundary.c')
-rw-r--r-- | src/ScalarBoundary.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/ScalarBoundary.c b/src/ScalarBoundary.c index 81ee42f..d446f56 100644 --- a/src/ScalarBoundary.c +++ b/src/ScalarBoundary.c @@ -22,7 +22,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 */ @@ -1059,12 +1058,15 @@ static int ApplyBndScalar (const cGH *GH, int first_var, int num_vars) { + int ierr; int i, j, k; int gindex, gdim; int var, timelvl; int doBC[2*MAXDIM], dstag[MAXDIM], lsh[MAXDIM], lssh[MAXDIM]; CCTK_INT widths[2*MAXDIM]; - SymmetryGHex *sGHex; + CCTK_INT symtable; + CCTK_INT symbnd[2*MAXDIM]; + CCTK_INT is_physical[2*MAXDIM]; /* check the direction parameter */ if (abs (dir) > MAXDIM) @@ -1075,11 +1077,11 @@ static int ApplyBndScalar (const cGH *GH, return (-1); } - /* get the group index and dimensionality */ + /* get the group index and dimension */ gindex = CCTK_GroupIndexFromVarI (first_var); gdim = CCTK_GroupDimI (gindex); - /* check the dimensionality */ + /* check the dimension */ if (gdim > MAXDIM) { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, @@ -1119,25 +1121,27 @@ static int ApplyBndScalar (const cGH *GH, /* get the current timelevel */ timelvl = 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 (i = 0; i < 2 * gdim; i++) + { + is_physical[i] = symbnd[i] < 0; + } /* now loop over all variables */ 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 (i = 0; i < 2 * gdim; i++) { - for (i = 0; i < 2 * gdim; i++) - { - doBC[i] = sGHex->GFSym[var][i] == GFSYM_NOSYM || - sGHex->GFSym[var][i] == GFSYM_UNSET; - } + doBC[i] = is_physical[i]; } for (i = 0; i < gdim; i++) { @@ -1155,7 +1159,7 @@ static int ApplyBndScalar (const cGH *GH, switch (CCTK_VarTypeI (var)) { /* FIXME: can't pass an empty preprocessor constant as a macro argument - on some systems (eg. MacOS X), so we have to define it outside */ + on some systems (e.g. MacOS X), so we have to define it outside */ #define NUMBER_PART case CCTK_VARIABLE_CHAR: SCALAR_BOUNDARY (CCTK_CHAR, CCTK_CHAR); break; |