aboutsummaryrefslogtreecommitdiff
path: root/src/StaticBoundary.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/StaticBoundary.c')
-rw-r--r--src/StaticBoundary.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/StaticBoundary.c b/src/StaticBoundary.c
index a70ff69..f5d7b65 100644
--- a/src/StaticBoundary.c
+++ b/src/StaticBoundary.c
@@ -16,7 +16,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 */
@@ -931,13 +930,16 @@ static int ApplyBndStatic (const cGH *GH,
int first_var,
int num_vars)
{
+ int ierr;
int i, j, k;
int timelvl_to, timelvl_from;
int gindex, gdim;
int var, 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];
/* Only apply boundary condition if more than one timelevel */
if (CCTK_MaxTimeLevelsVI(first_var) == 1)
@@ -1001,8 +1003,15 @@ static int ApplyBndStatic (const cGH *GH,
timelvl_to = 0;
timelvl_from = 1;
- /* see if we have a symmetry array */
- sGHex = 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;
@@ -1010,18 +1019,12 @@ static int ApplyBndStatic (const cGH *GH,
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++)
{