From f3af8764fac614153bb90de8c99257fda51ea094 Mon Sep 17 00:00:00 2001 From: hinder Date: Wed, 17 Aug 2011 22:07:20 +0000 Subject: Apply "flat" boundary condition instead of "none" to ADMBase variables In the development version of Carpet, only the interior of the newly created grid is initialized by interpolation, so non-trivial boundary conditions need to be applied. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/ADMBase/trunk@62 d576a68a-b34a-40ae-82fc-004fa1a9d16f --- interface.ccl | 8 ++++++++ src/InitSymBound.c | 34 ++++++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/interface.ccl b/interface.ccl index b657aac..4debd5c 100644 --- a/interface.ccl +++ b/interface.ccl @@ -5,6 +5,14 @@ implements: ADMBase inherits: grid USES INCLUDE HEADER: Symmetry.h +CCTK_INT FUNCTION GetBoundarySpecification \ + (CCTK_INT IN size, \ + CCTK_INT OUT ARRAY nboundaryzones, \ + CCTK_INT OUT ARRAY is_internal, \ + CCTK_INT OUT ARRAY is_staggered, \ + CCTK_INT OUT ARRAY shiftout) +REQUIRES FUNCTION GetBoundarySpecification + public: INT shift_state TYPE = SCALAR "state of storage for shift" diff --git a/src/InitSymBound.c b/src/InitSymBound.c index b8f7386..cf20057 100644 --- a/src/InitSymBound.c +++ b/src/InitSymBound.c @@ -123,35 +123,53 @@ void Einstein_InitSymBound(CCTK_ARGUMENTS) } /* A macro for selecting boundary conditions and checking for errors */ -#define ADMBASE_BC(NAME) \ - {if (Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, NAME, "none") < 0) \ +#define ADMBASE_BC(NAME, STENCIL) \ + {if (Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, STENCIL, -1, NAME, "flat") < 0) \ CCTK_WARN(0, "Failed to register BC for "NAME"!");} /* Select boundary conditions on ADMBase variables */ void ADMBase_Boundaries(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; + + CCTK_INT width[6]; + CCTK_INT ierr; + CCTK_INT is_internal[6]; + CCTK_INT is_staggered[6]; + CCTK_INT shiftout[6]; + CCTK_INT stencil = 0, i; + + ierr = GetBoundarySpecification + (6, width, is_internal, is_staggered, shiftout); + if (ierr < 0) + { + CCTK_WARN (0, "Could not get the boundary specification"); + } + for (i = 0; i < 6; i++) + { + stencil = stencil > width[i] ? stencil : width[i]; + } if (CCTK_EQUALS(evolution_method, "none" ) || CCTK_EQUALS(evolution_method, "static")) { - ADMBASE_BC("ADMBase::metric"); - ADMBASE_BC("ADMBase::curv"); + ADMBASE_BC("ADMBase::metric", stencil); + ADMBASE_BC("ADMBase::curv", stencil); } if (CCTK_EQUALS(lapse_evolution_method, "static")) - ADMBASE_BC("ADMBase::lapse"); + ADMBASE_BC("ADMBase::lapse", stencil); if (!CCTK_EQUALS(initial_dtlapse, "none") && CCTK_EQUALS(dtlapse_evolution_method, "static")) - ADMBASE_BC("ADMBase::dtlapse"); + ADMBASE_BC("ADMBase::dtlapse", stencil); if (!CCTK_EQUALS(initial_shift, "none") && CCTK_EQUALS(shift_evolution_method, "static")) - ADMBASE_BC("ADMBase::shift"); + ADMBASE_BC("ADMBase::shift", stencil); if (!CCTK_EQUALS(initial_dtshift, "none") && CCTK_EQUALS(dtshift_evolution_method, "static")) - ADMBASE_BC("ADMBase::dtshift"); + ADMBASE_BC("ADMBase::dtshift", stencil); } #undef ADMBase_BC -- cgit v1.2.3