From d8e0960b453e6038484f3e1f9c9acd6294c9b3e9 Mon Sep 17 00:00:00 2001 From: allen Date: Fri, 18 Jul 2003 17:11:09 +0000 Subject: Changes to use of new boundary infrastructure git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveToyCXX/trunk@61 50555cc7-fb31-491a-85db-9a2874240742 --- param.ccl | 2 +- src/WaveToy.cc | 55 +++++++------------------------------------------------ 2 files changed, 8 insertions(+), 49 deletions(-) diff --git a/param.ccl b/param.ccl index 6a1fdf6..9bf734a 100644 --- a/param.ccl +++ b/param.ccl @@ -1,7 +1,7 @@ # Parameter definitions for thorn WaveToyCXX # $Header$ -private: +restricted: KEYWORD bound "Type of boundary condition to use" { diff --git a/src/WaveToy.cc b/src/WaveToy.cc index 8acf599..5f076d6 100644 --- a/src/WaveToy.cc +++ b/src/WaveToy.cc @@ -113,63 +113,22 @@ extern "C" void WaveToyCXX_Boundaries(CCTK_ARGUMENTS) DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; - int ierr=-1; - int sw[3]; - - /* Default arguments for Robin boundary condition - * CCTK_REAL finf = 1.0; - * int npow = 1; - */ - - /* Set the stencil width */ - sw[0]=1; - sw[1]=1; - sw[2]=1; + int ierr=-0; ierr = CartSymGN(cctkGH,"wavetoy::scalarevolve"); - if (CCTK_EQUALS(bound,"flat")) - { - /* Uses all default arguments, so invalid table handle -1 can be passed */ - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, "wavetoy::phi", - "Flat"); - } - else if (CCTK_Equals(bound,"static")) - { - /* Uses all default arguments, so invalid table handle -1 can be passed */ - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, "wavetoy::phi", - "Static"); - } - else if (CCTK_Equals(bound,"radiation")) - { - /* Uses all default arguments, so invalid table handle -1 can be passed */ - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, "wavetoy::phi", - "Radiation"); - } - else if (CCTK_Equals(bound,"robin")) - { - /* Uses all default arguments, so invalid table handle -1 can be passed */ - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, "wavetoy::phi", - "Robin"); - } - else if (CCTK_Equals(bound,"zero")) + if (CCTK_EQUALS(bound,"flat") || CCTK_EQUALS(bound,"static") || + CCTK_EQUALS(bound,"radiation") || CCTK_EQUALS(bound,"robin") || + CCTK_EQUALS(bound,"zero") || CCTK_EQUALS(bound,"none")) { /* Uses all default arguments, so invalid table handle -1 can be passed */ - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, "wavetoy::phi", - "Scalar"); - } - else if (CCTK_Equals(bound,"none")) - { - /* Do nothing */ - } - else - { - CCTK_WARN(0,"Boundary condition not recognized"); + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "wavetoy::phi", bound); } if (ierr < 0) { - CCTK_WARN(0,"Boundary conditions not applied - giving up!"); + CCTK_WARN(0,"WaveToyCXX_Boundaries: Error selecting boundary condition"); } return; -- cgit v1.2.3