diff options
Diffstat (limited to 'src/CopyBoundary.c')
-rw-r--r-- | src/CopyBoundary.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/CopyBoundary.c b/src/CopyBoundary.c index d26f099..d4d7bde 100644 --- a/src/CopyBoundary.c +++ b/src/CopyBoundary.c @@ -21,7 +21,6 @@ #include "util_ErrorCodes.h" #include "cctk_FortranString.h" -#include "Symmetry.h" #include "Boundary.h" /* the rcs ID and its dummy function to use it */ @@ -1097,7 +1096,10 @@ static int ApplyBndCopy (const cGH *GH, int var_to, var_from, vtypesize; 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]; + CCTK_INT ierr; /* get the group index of the target variable */ @@ -1156,27 +1158,29 @@ static int ApplyBndCopy (const cGH *GH, timelvl_to = 0; timelvl_from = 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_to = first_var_to, var_from = first_var_from; var_to < first_var_to + num_vars; var_to++, var_from++) { /* 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_to][i] == GFSYM_NOSYM || - sGHex->GFSym[var_to][i] == GFSYM_UNSET; - } + doBC[i] = is_physical[i]; } for (i = 0; i < gdim; i++) { |