aboutsummaryrefslogtreecommitdiff
path: root/CarpetExtra/FOWaveToyF77
diff options
context:
space:
mode:
authorshawley <>2002-02-18 10:25:00 +0000
committershawley <>2002-02-18 10:25:00 +0000
commit5d46c36ee29be57928d2920f03974460f30f9b26 (patch)
tree7ff96aa4bfc96131532b3b8b252aa24e100ed67d /CarpetExtra/FOWaveToyF77
parentd59ea53e75cb485a1e8104659570c1a309d1ea1f (diff)
Initial revision
darcs-hash:20020218102534-e415b-377a960557b608d7eb50fff5c49084975ec77d30.gz
Diffstat (limited to 'CarpetExtra/FOWaveToyF77')
-rw-r--r--CarpetExtra/FOWaveToyF77/interface.ccl20
-rw-r--r--CarpetExtra/FOWaveToyF77/param.ccl15
-rw-r--r--CarpetExtra/FOWaveToyF77/schedule.ccl37
-rw-r--r--CarpetExtra/FOWaveToyF77/src/FOWaveToy.F77118
-rw-r--r--CarpetExtra/FOWaveToyF77/src/InitSymBound.F7720
-rw-r--r--CarpetExtra/FOWaveToyF77/src/Startup.F778
6 files changed, 93 insertions, 125 deletions
diff --git a/CarpetExtra/FOWaveToyF77/interface.ccl b/CarpetExtra/FOWaveToyF77/interface.ccl
index 6439786d2..b20e60924 100644
--- a/CarpetExtra/FOWaveToyF77/interface.ccl
+++ b/CarpetExtra/FOWaveToyF77/interface.ccl
@@ -1,27 +1,17 @@
# Interface definition for thorn WaveToyF77
-# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/interface.ccl,v 1.10 2004/05/21 17:43:57 schnetter Exp $
+# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/interface.ccl,v 1.1 2002/02/18 11:25:34 shawley Exp $
-implements: FOwavetoy
-inherits: grid idfoscalarwave
-
-USES INCLUDE: Symmetry.h
+implements: wavetoy
+inherits: boundary grid
public:
CCTK_REAL scalarevolve type=GF timelevels=3
{
- phi
-} "The evolved scalar field phi"
-
-CCTK_REAL scalarevolve_derivs type=GF timelevels=3
-{
pi,
phix,
phiy,
phiz,
-} "Time and space derivatives of phi"
+ phi
+} "The evolved scalar field phi, and time and space derivatives of phi"
-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)
-REQUIRES FUNCTION Boundary_SelectGroupForBC
diff --git a/CarpetExtra/FOWaveToyF77/param.ccl b/CarpetExtra/FOWaveToyF77/param.ccl
index 9204f6329..a78110871 100644
--- a/CarpetExtra/FOWaveToyF77/param.ccl
+++ b/CarpetExtra/FOWaveToyF77/param.ccl
@@ -1,17 +1,14 @@
# Parameter definitions for thorn WaveToyF77
-# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/param.ccl,v 1.5 2003/07/08 23:12:45 schnetter Exp $
+# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/param.ccl,v 1.1 2002/02/18 11:25:34 shawley Exp $
private:
-STRING bound "Type of boundary condition to use"
+KEYWORD bound "Type of boundary condition to use"
{
- ".*" :: "Must be a registered boundary condition"
-} "Zero"
-
-INT bound_width "Number of boundary points"
-{
- 1:* :: ""
-} 1
+ "none" :: "No boundary condition"
+ "flat" :: "Flat boundary condition"
+ "zero" :: "Zero boundary condition"
+} "zero"
KEYWORD excision_bound "Type of excision boundary condition to use"
{
diff --git a/CarpetExtra/FOWaveToyF77/schedule.ccl b/CarpetExtra/FOWaveToyF77/schedule.ccl
index a3cd168c0..f0980dddd 100644
--- a/CarpetExtra/FOWaveToyF77/schedule.ccl
+++ b/CarpetExtra/FOWaveToyF77/schedule.ccl
@@ -1,7 +1,7 @@
# Schedule definitions for thorn FOWaveToy77
-# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/schedule.ccl,v 1.10 2003/11/05 16:18:39 schnetter Exp $
+# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/schedule.ccl,v 1.1 2002/02/18 11:25:34 shawley Exp $
-STORAGE: scalarevolve[3] scalarevolve_derivs[3]
+STORAGE: scalarevolve
schedule FOWaveToyF77_Startup at STARTUP
{
@@ -16,41 +16,20 @@ schedule FOWaveToyF77_InitSymBound at BASEGRID
-schedule FOWaveToyF77_Boundaries as FOWaveToy_Boundaries at INITIAL after FOWaveToy_InitialData
+schedule FOWaveToyF77_Boundaries as WaveToy_Boundaries at INITIAL after WaveToy_InitialData
{
LANG: Fortran
- 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"
+} "Boundaries of 3D wave equation"
-schedule FOWaveToyF77_Evolution as FOWaveToy_Evolution at EVOL
+schedule FOWaveToyF77_Evolution as WaveToy_Evolution at EVOL
{
LANG: Fortran
+ SYNC: scalarevolve
} "Evolution of 3D wave equation"
-schedule FOWaveToyF77_Boundaries as FOWaveToy_Boundaries at EVOL after FOWaveToy_Evolution
+schedule FOWaveToyF77_Boundaries as WaveToy_Boundaries at EVOL after WaveToy_Evolution
{
LANG: Fortran
- 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"
-
-
-
-schedule FOWaveToyF77_Boundaries as FOWaveToy_Boundaries at POSTRESTRICT
-{
- LANG: Fortran
- SYNC: scalarevolve scalarevolve_derivs
-} "Select boundary conditions of 3D wave equation"
-
-schedule group ApplyBCs as FOWaveToy_ApplyBCs at POSTRESTRICT after FOWaveToy_Boundaries
-{
-} "Apply boundary conditions of 3D wave equation"
+} "Boundaries of 3D wave equation"
diff --git a/CarpetExtra/FOWaveToyF77/src/FOWaveToy.F77 b/CarpetExtra/FOWaveToyF77/src/FOWaveToy.F77
index bc2a17549..74d9ca6f5 100644
--- a/CarpetExtra/FOWaveToyF77/src/FOWaveToy.F77
+++ b/CarpetExtra/FOWaveToyF77/src/FOWaveToy.F77
@@ -13,9 +13,8 @@ c -*-Fortran-*-
@@*/
#include "cctk.h"
-#include "cctk_Arguments.h"
-#include "cctk_Functions.h"
#include "cctk_Parameters.h"
+#include "cctk_Arguments.h"
@@ -42,10 +41,9 @@ c Declare variables in argument list
DECLARE_CCTK_ARGUMENTS
DECLARE_CCTK_FUNCTIONS
DECLARE_CCTK_PARAMETERS
-
+
INTEGER i,j,k
- INTEGER istart(3), iend(3)
- INTEGER d
+ INTEGER istart, jstart, kstart, iend, jend, kend
CCTK_REAL dx,dy,dz,dt
CCTK_REAL dxi,dyi,dzi
@@ -62,24 +60,19 @@ c -----------------
dyi = 1/dy
dzi = 1/dz
- do d = 1, 3
- if (cctk_bbox(2*d-1).eq.0) then
- istart(d) = 1+cctk_nghostzones(d)
- else
- istart(d) = 1+bound_width
- end if
- if (cctk_bbox(2*d).eq.0) then
- iend(d) = cctk_lsh(d)-cctk_nghostzones(d)
- else
- iend(d) = cctk_lsh(d)-bound_width
- end if
- end do
+ istart = 1+cctk_nghostzones(1)
+ jstart = 1+cctk_nghostzones(2)
+ kstart = 1+cctk_nghostzones(3)
+
+ iend = cctk_lsh(1)-cctk_nghostzones(1)
+ jend = cctk_lsh(2)-cctk_nghostzones(2)
+ kend = cctk_lsh(3)-cctk_nghostzones(3)
c Do the evolution
c ----------------
- do k = istart(3), iend(3)
- do j = istart(2), iend(2)
- do i = istart(1), iend(1)
+ do k = kstart, kend
+ do j = jstart, jend
+ do i = istart, iend
pi(i,j,k) = pi_p_p(i,j,k) + dt * (
$ (phix_p(i+1,j,k) - phix_p(i-1,j,k))*dxi
@@ -96,7 +89,7 @@ c ----------------
phiz(i,j,k) = phiz_p_p(i,j,k) + dt * dzi * (
$ pi_p(i,j,k+1) - pi_p(i,j,k-1) )
- phi(i,j,k) = phi_p_p(i,j,k) + 2*dt * pi_p(i,j,i)
+ phi(i,j,k) = phiz_p_p(i,j,k) + 2*dt * pi_p(i,j,i)
end do
end do
@@ -124,24 +117,32 @@ c ----------------
implicit none
DECLARE_CCTK_ARGUMENTS
- DECLARE_CCTK_PARAMETERS
DECLARE_CCTK_FUNCTIONS
+ DECLARE_CCTK_PARAMETERS
c Local declarations
- integer table
- data table /-1/
+ CCTK_REAL zero, one
+ parameter (zero=0, one=1)
- character fbound*100
- CCTK_INT fboundlen
+ CCTK_REAL finf
+ integer npow
+ parameter (finf = 1)
+ parameter (npow = 1)
integer i,j,k
- CCTK_REAL spher3d_r
integer ierr
+ integer sw(3)
CCTK_REAL ri3
c call CCTK_INFO ("FOWaveToyF77_Boundaries")
+c Set the stencil width
+c ---------------------
+ sw(1) = cctk_nghostzones(1)
+ sw(2) = cctk_nghostzones(2)
+ sw(3) = cctk_nghostzones(3)
+
c Apply the excision boundary condition
c -------------------------------------
if (CCTK_EQUALS(excision_bound, "none")) then
@@ -150,14 +151,13 @@ c do nothing
do k=1,cctk_lsh(3)
do j=1,cctk_lsh(2)
do i=1,cctk_lsh(1)
- spher3d_r = sqrt(x(i,j,k)**2 + y(i,j,k)**2 + z(i,j,k)**2)
- if (spher3d_r .le. excision_radius) then
+ if (spher3d_r(i,j,k) .le. excision_radius) then
pi(i,j,k) = 0.0
- phi(i,j,k) = 1.0 / spher3d_r
+ phi(i,j,k) = 1 / spher3d_r(i,j,k)
ri3 = phi(i,j,k)**3
- phix(i,j,k) = - x(i,j,k) * ri3
- phiy(i,j,k) = - y(i,j,k) * ri3
- phiz(i,j,k) = - z(i,j,k) * ri3
+ phix(i,j,k) = - cart3d_x(i,j,k) * ri3
+ phiy(i,j,k) = - cart3d_y(i,j,k) * ri3
+ phiz(i,j,k) = - cart3d_z(i,j,k) * ri3
end if
end do
end do
@@ -165,32 +165,42 @@ c do nothing
else
call CCTK_WARN (0, "internal error")
end if
-
-c Apply the symmetry boundary conditions on any coordinate axes
-c -------------------------------------------------------------
- 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 -----------------------------------
-
- if (table.eq.-1) then
-
- call Util_TableCreateFromString (table, "LIMIT=0.0 SPEED=1.0")
- if (table.lt.0) call CCTK_WARN (0, "internal error")
-
+ if (CCTK_EQUALS(bound, "flat")) then
+ 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
+ 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, "radiation")) then
+ call BndRadiativeVN (ierr, cctkGH, sw, zero, one,
+ $ "wavetoy::phi", "wavetoy::phi")
+ else if (CCTK_EQUALS(bound, "robin")) then
+ call BndRobinVN (ierr, cctkGH, sw, finf, npow, "wavetoy::phi")
+ else if (CCTK_EQUALS(bound, "none")) then
+ ierr = 0
+ else
+ call CCTK_WARN (0, "internal error")
+ end if
+ if (ierr .lt. 0) then
+ call CCTK_WARN (0, "Boundary conditions not applied - giving up!")
end if
- call CCTK_FortranString (fboundlen, bound, fbound)
- if (fboundlen.lt.0) call CCTK_WARN (0, "internal error")
+c Apply the symmetry boundary conditions on any coordinate axes
+c -------------------------------------------------------------
+ call Cart3dSymGN (ierr, cctkGH, "wavetoy::scalarevolve")
- ierr = Boundary_SelectGroupForBC (cctkGH, CCTK_ALL_FACES, bound_width,
- $ table, "fowavetoy::scalarevolve", fbound)
- if (ierr.ne.0) call CCTK_WARN (0, "internal error")
- ierr = Boundary_SelectGroupForBC (cctkGH, CCTK_ALL_FACES, bound_width,
- $ table, "fowavetoy::scalarevolve_derivs", fbound)
- if (ierr.ne.0) call CCTK_WARN (0, "internal error")
+ if (ierr .lt. 0) then
+ call CCTK_WARN (0, "Symmetry conditions not applied - giving up!")
+ end if
end
diff --git a/CarpetExtra/FOWaveToyF77/src/InitSymBound.F77 b/CarpetExtra/FOWaveToyF77/src/InitSymBound.F77
index a64c3463c..d707e9d16 100644
--- a/CarpetExtra/FOWaveToyF77/src/InitSymBound.F77
+++ b/CarpetExtra/FOWaveToyF77/src/InitSymBound.F77
@@ -11,13 +11,12 @@ c -*-Fortran-*-
#include "cctk.h"
#include "cctk_Arguments.h"
-#include "cctk_Functions.h"
#include "cctk_Parameters.h"
/*@@
@routine FOWaveToyF77_InitSymBound
@date
- @author Erik Schnetter
+ @author Gabrielle Allen, Erik Schnetter
@desc
Sets the symmetries for Wave Toy
@enddesc
@@ -36,18 +35,9 @@ c -*-Fortran-*-
DECLARE_CCTK_ARGUMENTS
DECLARE_CCTK_FUNCTIONS
DECLARE_CCTK_PARAMETERS
-
- 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
-
- 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')
+
+ integer ierr
+
+ call Cart3dSetTensorTypeVN (ierr, cctkGH, 'wavetoy::phi', 'SCALAR')
end
diff --git a/CarpetExtra/FOWaveToyF77/src/Startup.F77 b/CarpetExtra/FOWaveToyF77/src/Startup.F77
index 99a2f000e..598a1e93d 100644
--- a/CarpetExtra/FOWaveToyF77/src/Startup.F77
+++ b/CarpetExtra/FOWaveToyF77/src/Startup.F77
@@ -7,16 +7,18 @@ c -*-Fortran-*-
@desc
Register banner
@enddesc
- @version $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/src/Startup.F77,v 1.2 2003/06/27 15:54:58 schnetter Exp $
+ @version $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/FOWaveToyF77/src/Startup.F77,v 1.1 2002/02/18 11:25:34 shawley Exp $
@@*/
#include "cctk.h"
- subroutine FOWaveToyF77_Startup
+ integer function FOWaveToyF77_Startup()
implicit none
- integer ierr
+ integer ierr
call CCTK_RegisterBanner(ierr, "FOWaveToyF77: Evolutions of a Scalar Field")
+ FOWaveToyF77_Startup = 0
+
end