aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrideout <rideout@50555cc7-fb31-491a-85db-9a2874240742>2003-02-14 14:27:56 +0000
committerrideout <rideout@50555cc7-fb31-491a-85db-9a2874240742>2003-02-14 14:27:56 +0000
commitfd0a47c17b0fee27aa841cafd9b8e45582a87917 (patch)
tree0af6eaad5babeaa3a9618094c0dc3bacf9689594
parentbf7fae40eda2e92100a682aa0397314fe45f5da6 (diff)
Modified to use new boundary interface.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveToyCXX/trunk@53 50555cc7-fb31-491a-85db-9a2874240742
-rw-r--r--interface.ccl5
-rw-r--r--schedule.ccl6
-rw-r--r--src/WaveToy.cc55
3 files changed, 41 insertions, 25 deletions
diff --git a/interface.ccl b/interface.ccl
index eeb5a3b..23809f0 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -4,7 +4,6 @@
implements: wavetoy
inherits: Grid Boundary
-USES INCLUDE: Boundary.h
USES INCLUDE: Symmetry.h
public:
@@ -13,3 +12,7 @@ cctk_real scalarevolve type = GF Timelevels=3
{
phi
} "The evolved scalar field"
+
+CCTK_INT FUNCTION Boundary_SelectVarForBC CCTK_POINTER GH, CCTK_INT faces, \
+ CCTK_INT table_handle, CCTK_STRING var_name, CCTK_STRING bc_name
+USES FUNCTION Boundary_SelectVarForBC
diff --git a/schedule.ccl b/schedule.ccl
index 1e78dd4..25b918c 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -1,4 +1,4 @@
-# Schedule definitions for thorn WaveToyC
+# Schedule definitions for thorn WaveToyCXX
# $Header$
STORAGE: scalarevolve[3]
@@ -23,3 +23,7 @@ schedule WaveToyCXX_Boundaries as WaveToy_Boundaries at EVOL AFTER WaveToy_Evolu
{
LANG: C
} "Boundaries of 3D wave equation"
+
+schedule GROUP ApplyBCs at EVOL after WaveToy_Evolution
+{
+} "Apply boundary conditions"
diff --git a/src/WaveToy.cc b/src/WaveToy.cc
index bd2237d..e727965 100644
--- a/src/WaveToy.cc
+++ b/src/WaveToy.cc
@@ -1,5 +1,5 @@
/*@@
- @file WaveToy.c
+ @file WaveToy.cc
@date
@author Tom Goodale
@desc
@@ -9,9 +9,10 @@
@@*/
#include "cctk.h"
+#include "cctk_Faces.h"
#include "cctk_Parameters.h"
#include "cctk_Arguments.h"
-#include "Boundary.h"
+
#include "Symmetry.h"
static char *rcsid = "$Header$";
@@ -109,15 +110,16 @@ extern "C" void WaveToyCXX_Evolution(CCTK_ARGUMENTS)
extern "C" void WaveToyCXX_Boundaries(CCTK_ARGUMENTS)
{
- DECLARE_CCTK_ARGUMENTS
- DECLARE_CCTK_PARAMETERS
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
int ierr=-1;
int sw[3];
- CCTK_REAL finf = 1.0;
-
- int npow = 1;
+ /* Default arguments for Robin boundary condition
+ * CCTK_REAL finf = 1.0;
+ * int npow = 1;
+ */
/* Set the stencil width */
sw[0]=1;
@@ -126,28 +128,42 @@ extern "C" void WaveToyCXX_Boundaries(CCTK_ARGUMENTS)
ierr = CartSymGN(cctkGH,"wavetoy::scalarevolve");
- if (CCTK_EQUALS(bound,"flat"))
+ if (CCTK_EQUALS(bound,"flat"))
{
- ierr = BndFlatVN(cctkGH,sw,"wavetoy::phi");
+ /* Uses all default arguments, so invalid table handle -1 can be passed */
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, -1, "wavetoy::phi",
+ "Flat");
}
else if (CCTK_Equals(bound,"static"))
{
- ierr = BndStaticVN(cctkGH,sw,"wavetoy::phi");
+ /* Uses all default arguments, so invalid table handle -1 can be passed */
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, -1, "wavetoy::phi",
+ "Static");
}
- else if (CCTK_Equals(bound,"radiation"))
+ else if (CCTK_Equals(bound,"radiation"))
{
- ierr = BndRadiativeVN(cctkGH,sw,0.0,1.0,"wavetoy::phi",
- "wavetoy::phi");
+ /* Uses all default arguments, so invalid table handle -1 can be passed */
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, -1, "wavetoy::phi",
+ "Radiative");
}
else if (CCTK_Equals(bound,"robin"))
{
- ierr = BndRobinVN(cctkGH,sw,finf,npow,"wavetoy::phi");
+ /* Uses all default arguments, so invalid table handle -1 can be passed */
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, -1, "wavetoy::phi",
+ "Robin");
}
else if (CCTK_Equals(bound,"zero"))
{
- ierr = BndScalarVN(cctkGH,sw,0.0,"wavetoy::phi");
+ /* Uses all default arguments, so invalid table handle -1 can be passed */
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, -1, "wavetoy::phi",
+ "Scalar");
}
- else if (! CCTK_Equals(bound,"none"))
+ else if (CCTK_Equals(bound,"none"))
+ {
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, -1, "wavetoy::phi",
+ "None");
+ }
+ else
{
CCTK_WARN(0,"Boundary condition not recognized");
}
@@ -158,11 +174,4 @@ extern "C" void WaveToyCXX_Boundaries(CCTK_ARGUMENTS)
}
return;
-
}
-
-
-
-
-
-