[Commits] [svn:einsteintoolkit] ADMBase/trunk/ (Rev. 59)

knarf at cct.lsu.edu knarf at cct.lsu.edu
Thu Apr 14 09:46:32 CDT 2011


User: knarf
Date: 2011/04/14 09:46 AM

Modified:
 /trunk/
  configuration.ccl, interface.ccl, schedule.ccl
 /trunk/src/
  InitSymBound.c

Log:
 Ian Hawke: The point is that no BCs are applied to ADMBase variables, so they're never SYNC'd, so never initialized on refined grids.
 
 Ian sent a patch which I extended at bit.

File Changes:

Directory: /trunk/src/
======================

File [modified]: InitSymBound.c
Delta lines: +36 -0
===================================================================
--- trunk/src/InitSymBound.c	2010-11-21 03:29:06 UTC (rev 58)
+++ trunk/src/InitSymBound.c	2011-04-14 14:46:32 UTC (rev 59)
@@ -9,6 +9,8 @@
 
 #include "cctk.h"
 #include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+#include "cctk_Functions.h"
 
 #include "Symmetry.h"
 
@@ -119,3 +121,37 @@
 
   return;
 }
+
+/* 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) \
+        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;
+  
+  if (CCTK_EQUALS(evolution_method, "none"  ) ||
+      CCTK_EQUALS(evolution_method, "static")) 
+  {
+    ADMBASE_BC("ADMBase::metric");
+    ADMBASE_BC("ADMBase::curv");
+  }
+
+  if (CCTK_EQUALS(lapse_evolution_method, "static"))
+    ADMBASE_BC("ADMBase::lapse");
+
+  if (!CCTK_EQUALS(initial_dtlapse, "none") &&
+       CCTK_EQUALS(dtlapse_evolution_method, "static"))
+    ADMBASE_BC("ADMBase::dtlapse");
+
+  if (!CCTK_EQUALS(initial_shift, "none") &&
+       CCTK_EQUALS(shift_evolution_method, "static"))
+    ADMBASE_BC("ADMBase::shift");
+
+  if (!CCTK_EQUALS(initial_dtshift, "none") &&
+       CCTK_EQUALS(dtshift_evolution_method, "static"))
+    ADMBASE_BC("ADMBase::dtshift");
+}
+#undef ADMBase_BC

Directory: /trunk/
==================

File [modified]: configuration.ccl
Delta lines: +1 -1
===================================================================
--- trunk/configuration.ccl	2010-11-21 03:29:06 UTC (rev 58)
+++ trunk/configuration.ccl	2011-04-14 14:46:32 UTC (rev 59)
@@ -1,4 +1,4 @@
 # Configuration definition for thorn CactusEinstein/ADMBase
 # $Header$
 
-REQUIRES CartGrid3D
+REQUIRES CartGrid3D Boundary

File [modified]: interface.ccl
Delta lines: +6 -0
===================================================================
--- trunk/interface.ccl	2010-11-21 03:29:06 UTC (rev 58)
+++ trunk/interface.ccl	2011-04-14 14:46:32 UTC (rev 59)
@@ -40,3 +40,9 @@
 {
   dtbetax,dtbetay,dtbetaz
 } "Time derivative of ADM shift function beta^i"
+
+#  Aliased function from thorn Boundary
+CCTK_INT FUNCTION Boundary_SelectGroupForBC(CCTK_POINTER_TO_CONST IN GH,   \
+  CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, \
+  CCTK_STRING IN group_name, CCTK_STRING IN bc_name)
+USES FUNCTION Boundary_SelectGroupForBC

File [modified]: schedule.ccl
Delta lines: +15 -1
===================================================================
--- trunk/schedule.ccl	2010-11-21 03:29:06 UTC (rev 58)
+++ trunk/schedule.ccl	2011-04-14 14:46:32 UTC (rev 59)
@@ -227,8 +227,22 @@
   OPTIONS: global
 } "Set up GF symmetries"
 
+# For Mesh Refinement it is possible (eg Cowling approximation) that ADMBase variables will need synchronization even when not evolved (eg when a new refined grid appears)
+if (CCTK_Equals(evolution_method, "static") || CCTK_Equals(evolution_method, "none") || CCTK_Equals(lapse_evolution_method, "static") || CCTK_Equals(shift_evolution_method, "static") || CCTK_Equals(dtlapse_evolution_method, "static") || CCTK_Equals(dtshift_evolution_method, "static") )
+{
+  SCHEDULE ADMBase_Boundaries IN MoL_PostStep BEFORE ADMBase_SetADMVars
+  {
+    LANG: C
+    OPTIONS: LEVEL
+    SYNC: lapse
+    SYNC: dtlapse
+    SYNC: shift
+    SYNC: dtshift
+    SYNC: metric
+    SYNC: curv
+  } "Select ADMBase boundary conditions - may be required for mesh refinement"
+}
 
-
 # TODO: Rename this group to "ADMBase_HaveBeenSet"?
 SCHEDULE GROUP ADMBase_SetADMVars IN MoL_PostStep
 {



More information about the Commits mailing list