From 205f49dc24257ee81085c514c63bcab20941c771 Mon Sep 17 00:00:00 2001 From: schnetter <> Date: Fri, 27 Jun 2003 13:54:00 +0000 Subject: Rename implementation to "FOWaveToy". Rename all variable names in strings. Rename implementation to "FOWaveToy". Rename all variable names in strings. Adapt to new boundary condition scheme. Change from Cart3d to CartGrid3D. darcs-hash:20030627135458-07bb3-f2096160de0784ebea9d799216d7eaead9d02879.gz --- CarpetExtra/FOWaveToyF77/interface.ccl | 10 +--- CarpetExtra/FOWaveToyF77/param.ccl | 14 ++--- CarpetExtra/FOWaveToyF77/schedule.ccl | 21 +++++-- CarpetExtra/FOWaveToyF77/src/FOWaveToy.F77 | 86 +++++++-------------------- CarpetExtra/FOWaveToyF77/src/InitSymBound.F77 | 24 ++++---- CarpetExtra/FOWaveToyF77/src/Startup.F77 | 8 +-- 6 files changed, 57 insertions(+), 106 deletions(-) (limited to 'CarpetExtra/FOWaveToyF77') diff --git a/CarpetExtra/FOWaveToyF77/interface.ccl b/CarpetExtra/FOWaveToyF77/interface.ccl index e812a4c30..0b5bdad9b 100644 --- a/CarpetExtra/FOWaveToyF77/interface.ccl +++ b/CarpetExtra/FOWaveToyF77/interface.ccl @@ -1,8 +1,8 @@ # Interface definition for thorn WaveToyF77 -# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/interface.ccl,v 1.5 2003/06/27 15:29:53 shawley Exp $ +# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/interface.ccl,v 1.6 2003/06/27 15:54:58 schnetter Exp $ implements: fowavetoy -inherits: boundary grid idFOscalarwave +inherits: boundary grid idfoscalarwave USES INCLUDE: Symmetry.h @@ -13,11 +13,6 @@ CCTK_REAL scalarevolve type=GF timelevels=3 phi } "The evolved scalar field phi" - -# Maybe these should be protected, but we could manage to get both -# scalarevolve and scalarevolve_derivs passed to IDFOScalarWave -public: - CCTK_REAL scalarevolve_derivs type=GF timelevels=3 { pi, @@ -30,4 +25,3 @@ CCTK_INT FUNCTION Boundary_SelectVarForBC(CCTK_POINTER IN GH, \ CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, \ CCTK_STRING IN var_name, CCTK_STRING IN bc_name) USES FUNCTION Boundary_SelectVarForBC - diff --git a/CarpetExtra/FOWaveToyF77/param.ccl b/CarpetExtra/FOWaveToyF77/param.ccl index f67fbe510..7b2263a38 100644 --- a/CarpetExtra/FOWaveToyF77/param.ccl +++ b/CarpetExtra/FOWaveToyF77/param.ccl @@ -1,17 +1,12 @@ # Parameter definitions for thorn WaveToyF77 -# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/param.ccl,v 1.3 2003/06/27 15:29:53 shawley Exp $ - +# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/param.ccl,v 1.4 2003/06/27 15:54:58 schnetter Exp $ private: -KEYWORD bound "Type of boundary condition to use" +STRING bound "Type of boundary condition to use" { - "none" :: "No boundary condition" - "flat" :: "Flat boundary condition" - "zero" :: "Zero boundary condition" - "radiation" :: "Radiation boundary condition" - "static" :: "Static boundary condition - copy from previous time level" -} "zero" + ".*" :: "Must be a registered boundary condition" +} "Zero" KEYWORD excision_bound "Type of excision boundary condition to use" { @@ -23,4 +18,3 @@ REAL excision_radius "Radius of excision region" { 0:* :: "must be nonnegative" } 1.0 - diff --git a/CarpetExtra/FOWaveToyF77/schedule.ccl b/CarpetExtra/FOWaveToyF77/schedule.ccl index 4352baa66..95a092aca 100644 --- a/CarpetExtra/FOWaveToyF77/schedule.ccl +++ b/CarpetExtra/FOWaveToyF77/schedule.ccl @@ -1,5 +1,5 @@ # Schedule definitions for thorn FOWaveToy77 -# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/schedule.ccl,v 1.3 2003/06/26 19:51:31 shawley Exp $ +# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/schedule.ccl,v 1.4 2003/06/27 15:54:58 schnetter Exp $ STORAGE: scalarevolve[3] scalarevolve_derivs[3] @@ -16,20 +16,29 @@ schedule FOWaveToyF77_InitSymBound at BASEGRID -schedule FOWaveToyF77_Boundaries as WaveToy_Boundaries at INITIAL after WaveToy_InitialData +schedule FOWaveToyF77_Boundaries as FOWaveToy_Boundaries at INITIAL after FOWaveToy_InitialData { LANG: Fortran -} "Boundaries of 3D wave equation" + SYNC: scalarevolve scalarevolve_derivs +} "Select boundary conditions of 3D wave equation" + +schedule group ApplyBCs as FOWaveToy_ApplyBCs at INITIAL after FOWaveToy_Boundaries +{ +} "Apply boundary conditions of 3D wave equation" schedule FOWaveToyF77_Evolution as WaveToy_Evolution at EVOL { LANG: Fortran - SYNC: scalarevolve } "Evolution of 3D wave equation" -schedule FOWaveToyF77_Boundaries as WaveToy_Boundaries at EVOL after WaveToy_Evolution +schedule FOWaveToyF77_Boundaries as FOWaveToy_Boundaries at INITIAL after FOWaveToy_InitialData { LANG: Fortran -} "Boundaries of 3D wave equation" + SYNC: scalarevolve scalarevolve_derivs +} "Select boundary conditions of 3D wave equation" + +schedule group ApplyBCs as FOWaveToy_ApplyBCs at EVOL after FOWaveToy_Boundaries +{ +} "Apply boundary conditions of 3D wave equation" diff --git a/CarpetExtra/FOWaveToyF77/src/FOWaveToy.F77 b/CarpetExtra/FOWaveToyF77/src/FOWaveToy.F77 index 857b226f3..b8cb5fe86 100644 --- a/CarpetExtra/FOWaveToyF77/src/FOWaveToy.F77 +++ b/CarpetExtra/FOWaveToyF77/src/FOWaveToy.F77 @@ -120,16 +120,16 @@ c ---------------- DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS DECLARE_CCTK_FUNCTIONS + + external Boundary_SelectVarForBC CCTK_INT Boundary_SelectVarForBC c Local declarations CCTK_REAL zero, one parameter (zero=0, one=1) - CCTK_REAL finf - integer npow - parameter (finf = 1) - parameter (npow = 1) + character fbound*100 + CCTK_INT fboundlen integer i,j,k CCTK_REAL spher3d_r @@ -172,69 +172,27 @@ c do nothing c Apply the symmetry boundary conditions on any coordinate axes c ------------------------------------------------------------- - call CartSymGN(ierr,cctkGH,"wavetoy::scalarevolve") - call CartSymGN(ierr,cctkGH,"wavetoy::scalarevolve_derivs") - + call CartSymGN(ierr,cctkGH,"fowavetoy::scalarevolve") + if (ierr.ne.0) call CCTK_WARN (0, "internal error") + call CartSymGN(ierr,cctkGH,"fowavetoy::scalarevolve_derivs") + if (ierr.ne.0) call CCTK_WARN (0, "internal error") c Apply the outer boundary conditions -c Only "flat" and "zero" and "none" are currently supported c ----------------------------------- - write(0,*) ' FOWaveToyF77: bound = ', bound - - call CCTK_PrintString(bound) - if (CCTK_EQUALS(bound, "flat")) then - write(0,*) ' FOWavetoy: bound is flat' - call BndFlatVN (ierr, cctkGH, sw, "wavetoy::pi") - call BndScalarVN (ierr, cctkGH, sw, zero, "wavetoy::phix") - call BndScalarVN (ierr, cctkGH, sw, zero, "wavetoy::phiy") - call BndScalarVN (ierr, cctkGH, sw, zero, "wavetoy::phiz") - call BndFlatVN (ierr, cctkGH, sw, "wavetoy::phi") - else if (CCTK_EQUALS(bound, "zero")) then - write(0,*) ' FOWavetoy: bound is zero' - call BndScalarVN (ierr, cctkGH, sw, zero, "wavetoy::pi") - call BndScalarVN (ierr, cctkGH, sw, zero, "wavetoy::phix") - call BndScalarVN (ierr, cctkGH, sw, zero, "wavetoy::phiy") - call BndScalarVN (ierr, cctkGH, sw, zero, "wavetoy::phiz") - call BndScalarVN (ierr, cctkGH, sw, zero, "wavetoy::phi") - else if (CCTK_EQUALS(bound, "static")) then - write(0,*) ' FOWavetoy: bound is static' - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - $ "wavetoy::phi", "Static"); - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - $ "wavetoy::pi", "Static"); - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - $ "wavetoy::phix", "Static"); - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - $ "wavetoy::phiy", "Static"); - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - $ "wavetoy::phiz", "Static"); - else if (CCTK_EQUALS(bound, "radiation")) then - write(0,*) ' FOWavetoy: bound is radiation' - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - $ "wavetoy::phi", "Radiation"); - else if (CCTK_EQUALS(bound, "robin")) then - write(0,*) ' FOWavetoy: bound is robin' - ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - $ "wavetoy::phi", "Robin"); - else if (CCTK_EQUALS(bound, "none")) then - ierr = 0 - else - call CCTK_WARN (0, "internal error") - end if - if (ierr .lt. 0) then - write(0,*) ' ierr = ',ierr - call CCTK_WARN (0, "Boundary conditions not applied - giving up!") - end if -c SHH: Taking these out on June 26, 2003. Presumably symmetry BCs are -c now handled by some other thorn? -c Apply the symmetry boundary conditions on any coordinate axes -c ------------------------------------------------------------- -c call Cart3dSymGN (ierr, cctkGH, "wavetoy::scalarevolve") -c call Cart3dSymGN (ierr, cctkGH, "wavetoy::scalarevolve_derivs") -c -c if (ierr .lt. 0) then -c call CCTK_WARN (0, "Symmetry conditions not applied - giving up!") -c end if + call CCTK_FortranString (fboundlen, bound, fbound) + if (fboundlen.lt.0) call CCTK_WARN (0, "internal error") + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + $ "fowavetoy::phi", fbound) + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + $ "fowavetoy::pi", fbound) + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + $ "fowavetoy::phix", fbound) + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + $ "fowavetoy::phiy", fbound) + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + $ "fowavetoy::phiz", fbound) + if (ierr.ne.0) call CCTK_WARN (0, "internal error") end diff --git a/CarpetExtra/FOWaveToyF77/src/InitSymBound.F77 b/CarpetExtra/FOWaveToyF77/src/InitSymBound.F77 index 875d5f06c..84a62f076 100644 --- a/CarpetExtra/FOWaveToyF77/src/InitSymBound.F77 +++ b/CarpetExtra/FOWaveToyF77/src/InitSymBound.F77 @@ -16,7 +16,7 @@ c -*-Fortran-*- /*@@ @routine FOWaveToyF77_InitSymBound @date - @author Gabrielle Allen, Erik Schnetter + @author Erik Schnetter @desc Sets the symmetries for Wave Toy @enddesc @@ -36,19 +36,17 @@ c -*-Fortran-*- DECLARE_CCTK_FUNCTIONS DECLARE_CCTK_PARAMETERS - INTEGER one - PARAMETER (one = 1) + INTEGER sym(3), symx(3), symy(3), symz(3) + DATA sym /+1, +1, +1/ + DATA symx /-1, +1, +1/ + DATA symy /+1, -1, +1/ + DATA symz /+1, +1, -1/ INTEGER ierr - INTEGER sym(3) - sym(1) = one - sym(2) = one - sym(3) = one - - call SetCartSymVN(ierr, cctkGH, sym,'wavetoy::pi') - call SetCartSymVN(ierr, cctkGH, sym,'wavetoy::phi') - call SetCartSymVN(ierr, cctkGH, sym,'wavetoy::phix') - call SetCartSymVN(ierr, cctkGH, sym,'wavetoy::phiy') - call SetCartSymVN(ierr, cctkGH, sym,'wavetoy::phiz') + call SetCartSymVN(ierr, cctkGH, sym ,'fowavetoy::pi') + call SetCartSymVN(ierr, cctkGH, sym ,'fowavetoy::phi') + call SetCartSymVN(ierr, cctkGH, symx,'fowavetoy::phix') + call SetCartSymVN(ierr, cctkGH, symy,'fowavetoy::phiy') + call SetCartSymVN(ierr, cctkGH, symz,'fowavetoy::phiz') end diff --git a/CarpetExtra/FOWaveToyF77/src/Startup.F77 b/CarpetExtra/FOWaveToyF77/src/Startup.F77 index 598a1e93d..99a2f000e 100644 --- a/CarpetExtra/FOWaveToyF77/src/Startup.F77 +++ b/CarpetExtra/FOWaveToyF77/src/Startup.F77 @@ -7,18 +7,16 @@ c -*-Fortran-*- @desc Register banner @enddesc - @version $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/src/Startup.F77,v 1.1 2002/02/18 11:25:34 shawley Exp $ + @version $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/src/Startup.F77,v 1.2 2003/06/27 15:54:58 schnetter Exp $ @@*/ #include "cctk.h" - integer function FOWaveToyF77_Startup() + subroutine FOWaveToyF77_Startup implicit none - integer ierr + call CCTK_RegisterBanner(ierr, "FOWaveToyF77: Evolutions of a Scalar Field") - FOWaveToyF77_Startup = 0 - end -- cgit v1.2.3