From fd0a47c17b0fee27aa841cafd9b8e45582a87917 Mon Sep 17 00:00:00 2001 From: rideout Date: Fri, 14 Feb 2003 14:27:56 +0000 Subject: Modified to use new boundary interface. git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveToyCXX/trunk@53 50555cc7-fb31-491a-85db-9a2874240742 --- src/WaveToy.cc | 55 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 23 deletions(-) (limited to 'src') 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; - } - - - - - - -- cgit v1.2.3