aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README20
-rw-r--r--interface.ccl24
-rw-r--r--par/wavetoy.par16
-rw-r--r--par/wavetoy_flat.par42
-rw-r--r--par/wavetoy_none.par42
-rw-r--r--par/wavetoy_rad.par42
-rw-r--r--param.ccl59
-rw-r--r--schedule.ccl38
-rw-r--r--src/CheckParameters.F52
-rw-r--r--src/CheckParameters.F7752
-rw-r--r--src/InitSymBound.F7747
-rw-r--r--src/Initial.F7751
-rw-r--r--src/InitialData.F126
-rw-r--r--src/InitialData.F77126
-rw-r--r--src/Startup.c18
-rw-r--r--src/WaveToy.F77151
-rw-r--r--src/make.code.defn9
17 files changed, 915 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..f15842b
--- /dev/null
+++ b/README
@@ -0,0 +1,20 @@
+Cactus Code Thorn WaveToyF77
+Authors : ...
+Managed by : ... <...@...........>
+Version : ...
+CVS info : $Header$
+--------------------------------------------------------------------------
+
+1. Purpose of the thorn
+
+This thorn does ...
+
+2. Dependencies of the thorn
+
+This thorn additionally requires implementations and thorns ...
+
+3. Thorn distribution
+
+This thorn is available to ...
+
+4. Additional information
diff --git a/interface.ccl b/interface.ccl
new file mode 100644
index 0000000..33166f6
--- /dev/null
+++ b/interface.ccl
@@ -0,0 +1,24 @@
+# Interface definition for thorn WaveToyF77
+# $Header$
+
+implements: wavetoy
+friend: driver
+inherits: grid
+
+# All wavetoy variables are private
+
+private:
+
+cctk_real scalarfields type = GF
+{
+ phi,
+ phi_old
+} "Scalar fields for WaveToy"
+
+cctk_real scalartmps type = GF
+{
+ phi_tmp
+} "Temporary GFs for WaveToy"
+
+
+
diff --git a/par/wavetoy.par b/par/wavetoy.par
new file mode 100644
index 0000000..bd0d487
--- /dev/null
+++ b/par/wavetoy.par
@@ -0,0 +1,16 @@
+# wavetoyf77.par - minimal wavetoy evolution
+# $Id$
+#
+# /*@@
+# @file wavetoyf77.par
+# @date Sunday 24th July
+# @author Gabrielle Allen
+# @desc
+# Wavetoy parameter file demonstrating minimal evolution
+# @enddesc
+# @@*/
+
+ActiveThorns = "wavetoyf77 pugh cartgrid3d ioutil ioascii"
+
+IOASCII::output1D = "wavetoy::phi"
+
diff --git a/par/wavetoy_flat.par b/par/wavetoy_flat.par
new file mode 100644
index 0000000..e783bdf
--- /dev/null
+++ b/par/wavetoy_flat.par
@@ -0,0 +1,42 @@
+# wavetoy_flat.par - wavetoy evolution with flat boundaries
+# $Id$
+#
+# /*@@
+# @file wavetoy_rad.par
+# @date Sunday 24th July
+# @author Gabrielle Allen
+# @desc
+# Wavetoy parameter file demonstrating flat boundaries in Octant
+# @enddesc
+# @@*/
+
+ActiveThorns = "wavetoy pugh cartgrid3d ioutil ioascii"
+
+wavetoy::initial_data = "gaussian"
+wavetoy::sigma = 2.8
+wavetoy::radius = 0
+wavetoy::bound = "flat"
+
+grid::type = "BySpacing"
+grid::symmetry = "octant"
+grid::dxyx = 0.01
+
+driver::global_nx = 30
+driver::global_ny = 30
+driver::global_nz = 30
+
+cctk_itlast = 500
+
+IO::output0d_every = 10
+IOASCII::output0D = "wavetoy::phi"
+
+IO::output1d_every = 10
+IO::Doz_1D = "no"
+IO::Doy_1D = "no"
+IOASCII::output1D = "wavetoy::phi "
+
+IO::outputinfo_every = 50
+IOASCII::output_info = "wavetoy::phi"
+
+IO::outdir = "wavetoy_flat"
+
diff --git a/par/wavetoy_none.par b/par/wavetoy_none.par
new file mode 100644
index 0000000..a07806a
--- /dev/null
+++ b/par/wavetoy_none.par
@@ -0,0 +1,42 @@
+# wavetoy_flat.par - wavetoy evolution with flat boundaries
+# $Id$
+#
+# /*@@
+# @file wavetoy_rad.par
+# @date Sunday 24th July
+# @author Gabrielle Allen
+# @desc
+# Wavetoy parameter file demonstrating flat boundaries in Octant
+# @enddesc
+# @@*/
+
+ActiveThorns = "wavetoy pugh cartgrid3d ioutil ioascii"
+
+wavetoy::initial_data = "gaussian"
+wavetoy::sigma = 2.8
+wavetoy::radius = 0
+wavetoy::bound = "none"
+
+grid::type = "BySpacing"
+grid::symmetry = "octant"
+grid::dxyx = 0.01
+
+driver::global_nx = 30
+driver::global_ny = 30
+driver::global_nz = 30
+
+cctk_itlast = 500
+
+IO::output0d_every = 10
+IOASCII::output0D = "wavetoy::phi"
+
+IO::output1d_every = 10
+IO::Doz_1D = "no"
+IO::Doy_1D = "no"
+IOASCII::output1D = "wavetoy::phi "
+
+IO::outputinfo_every = 50
+IOASCII::output_info = "wavetoy::phi"
+
+IO::outdir = "wavetoy_none"
+
diff --git a/par/wavetoy_rad.par b/par/wavetoy_rad.par
new file mode 100644
index 0000000..2840066
--- /dev/null
+++ b/par/wavetoy_rad.par
@@ -0,0 +1,42 @@
+# wavetoyf77_rad.par - wavetoy evolution with radiation boundaries
+# $Id$
+#
+# /*@@
+# @file wavetoyf77_rad.par
+# @date Sunday 24th July
+# @author Gabrielle Allen
+# @desc
+# Wavetoy parameter file demonstrating radiation boundaries in Octant
+# @enddesc
+# @@*/
+
+ActiveThorns = "wavetoyf77 pugh cartgrid3d ioutil ioascii"
+
+wavetoy::initial_data = "gaussian"
+wavetoy::sigma = 2.8
+wavetoy::radius = 0
+wavetoy::bound = "radiation"
+
+grid::type = "BySpacing"
+grid::symmetry = "octant"
+grid::dxyx = 0.01
+
+driver::global_nx = 30
+driver::global_ny = 30
+driver::global_nz = 30
+
+cctk_itlast = 120
+
+IO::output0d_every = 2
+IOASCII::output0D = "wavetoy::phi"
+
+IO::output1d_every = 2
+IO::Doz_1D = "no"
+IO::Doy_1D = "no"
+IOASCII::output1D = "wavetoy::phi "
+
+IO::outputinfo_every = 10
+IOASCII::output_info = "wavetoy::phi"
+
+IO::outdir = "wavetoy_rad"
+
diff --git a/param.ccl b/param.ccl
new file mode 100644
index 0000000..fa82a15
--- /dev/null
+++ b/param.ccl
@@ -0,0 +1,59 @@
+# Parameter definitions for thorn WaveToyF77
+# $Header$
+
+shares: grid
+
+EXTENDS KEYWORD type ""
+{
+}
+
+private:
+
+REAL dtfac "The timestep condition dt = dtfac*dx"
+{
+ 0:* :: "Should probably be bigger than zero"
+} 0.5
+
+REAL radius "The radius of the gaussian wave"
+{
+ 0:* ::
+} 0.0
+
+REAL sigma "The sigma for the gaussian wave"
+{
+ 0:* ::
+} 0.1
+
+REAL kx "The wave number in the x-direction"
+{
+ *:* :: "No restriction"
+} 4.0
+REAL ky "The wave number in the y-direction"
+{
+ *:* :: "No restriction"
+} 0.0
+REAL kz "The wave number in the z-direction"
+{
+ *:* :: "No restriction"
+} 0.0
+
+REAL amplitude "The amplitude of the waves"
+{
+ *:* :: "No restriction"
+} 1.0
+
+KEYWORD initial_data "Type of initial data"
+{
+ "plane" :: "Plane wave"
+ "gaussian" :: "Gaussian wave"
+ "box" :: "Box wave"
+} "gaussian"
+
+KEYWORD bound "Type of boundary condition to use"
+{
+ "none" :: "No boundary condition"
+ "flat" :: "Flat boundary condition"
+ "radiation" :: "Radiation boundary condition"
+} "none"
+
+
diff --git a/schedule.ccl b/schedule.ccl
new file mode 100644
index 0000000..80e7e7d
--- /dev/null
+++ b/schedule.ccl
@@ -0,0 +1,38 @@
+# Schedule definitions for thorn WaveToyF77
+# $Header$
+
+schedule WaveToyF77_Startup at CCTK_STARTUP
+{
+ LANG: C
+} "Register the Wave Toy (F77) banner"
+
+schedule WaveToyF77_InitSymBound at CCTK_BASEGRID
+{
+ LANG: Fortran
+} "Schedule symmetries for Wave Toy (F77)"
+
+schedule WaveToyF77_CheckParameters at CCTK_PARAMCHECK
+{
+ LANG: Fortran
+} "Check parameters for Wave Toy (F77)"
+
+
+# The basic fields always need memory and communication
+# -----------------------------------------------------
+STORAGE: scalarfields
+COMMUNICATION: scalarfields
+
+schedule WaveToyF77_InitialData at CCTK_INITIAL
+{
+ LANG: Fortran
+} "Initialisation of example 3D wave equation"
+
+# Scalartmps are needed, without communication, during evolution
+# --------------------------------------------------------------
+schedule WaveToyF77_evolution at CCTK_EVOL
+{
+ LANG: Fortran
+ STORAGE: scalartmps
+} "Evolution of example 3D wave equation"
+
+
diff --git a/src/CheckParameters.F b/src/CheckParameters.F
new file mode 100644
index 0000000..c2dec7e
--- /dev/null
+++ b/src/CheckParameters.F
@@ -0,0 +1,52 @@
+ /*@@
+ @file CheckParameters.F
+ @date
+ @author Gabrielle Allen
+ @desc
+ Check parameters for the wave equation evolver
+ @enddesc
+ @@*/
+
+#include "cctk.h"
+#include "cctk_parameters.h"
+#include "cctk_arguments.h"
+
+
+ /*@@
+ @routine WaveToy_CheckParameters
+ @date
+ @author Gabrielle Allen
+ @desc
+ Check parameters for the wave equation evolver
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+ subroutine WaveToy_CheckParameters(CCTK_FARGUMENTS)
+
+ implicit none
+
+ DECLARE_CCTK_FARGUMENTS
+ DECLARE_CCTK_PARAMETERS
+
+ INTEGER CCTK_Equals
+
+ if (CCTK_Equals(initial_data,"box").eq.1) then
+
+ if (CCTK_Equals(type, "box").eq.0) then
+ call CCTK_PARAMWARN("Must have a box grid with box initial data")
+ end if
+
+ if (kx.eq.0 .or. ky.eq.0 .or. kz.eq.0) then
+ call CCTK_PARAMWARN("Cannot have zero kx,ky,kz for box initial data")
+ end if
+
+ end if
+
+ return
+ end
diff --git a/src/CheckParameters.F77 b/src/CheckParameters.F77
new file mode 100644
index 0000000..ccf9fbb
--- /dev/null
+++ b/src/CheckParameters.F77
@@ -0,0 +1,52 @@
+ /*@@
+ @file CheckParameters.F77
+ @date
+ @author Gabrielle Allen
+ @desc
+ Check parameters for the wave equation evolver
+ @enddesc
+ @@*/
+
+#include "cctk.h"
+#include "cctk_parameters.h"
+#include "cctk_arguments.h"
+
+
+ /*@@
+ @routine WaveToyF77_CheckParameters
+ @date
+ @author Gabrielle Allen
+ @desc
+ Check parameters for the wave equation evolver
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+ subroutine WaveToyF77_CheckParameters(CCTK_FARGUMENTS)
+
+ implicit none
+
+ DECLARE_CCTK_FARGUMENTS
+ DECLARE_CCTK_PARAMETERS
+
+ INTEGER CCTK_Equals
+
+ if (CCTK_Equals(initial_data,"box").eq.1) then
+
+ if (CCTK_Equals(type, "box").eq.0) then
+ call CCTK_PARAMWARN("Must have a box grid with box initial data")
+ end if
+
+ if (kx.eq.0 .or. ky.eq.0 .or. kz.eq.0) then
+ call CCTK_PARAMWARN("Cannot have zero kx,ky,kz for box initial data")
+ end if
+
+ end if
+
+ return
+ end
diff --git a/src/InitSymBound.F77 b/src/InitSymBound.F77
new file mode 100644
index 0000000..3ca909e
--- /dev/null
+++ b/src/InitSymBound.F77
@@ -0,0 +1,47 @@
+ /*@@
+ @file InitSymBound.F77
+ @date
+ @author Gabrielle Allen
+ @desc
+ Sets the symmetries for Wave Toy
+ @enddesc
+ @@*/
+
+#include "cctk.h"
+#include "cctk_arguments.h"
+
+ /*@@
+ @routine WaveToyF77_InitSymBound
+ @date
+ @author Gabrielle Allen
+ @desc
+ Sets the symmetries for Wave Toy
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+ subroutine WaveToyF77_InitSymBound(CCTK_FARGUMENTS)
+
+ implicit none
+
+ DECLARE_CCTK_FARGUMENTS
+
+ INTEGER one
+ PARAMETER (one = 1)
+ INTEGER sym(3)
+
+ sym(1) = one
+ sym(2) = one
+ sym(3) = one
+
+ call SetCartSymmetry(cctkGH, sym,'wavetoy::phi')
+ call SetCartSymmetry(cctkGH, sym,'wavetoy::phi_old')
+
+ return
+ end
+
diff --git a/src/Initial.F77 b/src/Initial.F77
new file mode 100644
index 0000000..dca2e8b
--- /dev/null
+++ b/src/Initial.F77
@@ -0,0 +1,51 @@
+ /*@@
+ @file WaveToy.F
+ @date
+ @author Tom Goodale
+ @desc
+ Solve the 3D Wave Equation
+ @enddesc
+ @@*/
+
+#include "cctk.h"
+#include "cctk_parameters.h"
+#include "cctk_arguments.h"
+
+
+
+ /*@@
+ @routine WaveToy_Initial
+ @date
+ @author Tom Goodale
+ @desc
+ Set up initial properties for Wave Toy evolver
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+ subroutine WaveToy_Initial(CCTK_FARGUMENTS)
+
+ implicit none
+
+ DECLARE_CCTK_FARGUMENTS
+ DECLARE_CCTK_PARAMETERS
+
+ CCTK_REAL :: min_delta,dx,dy,dz
+
+ dx = cctk_delta_space(1)
+ dy = cctk_delta_space(2)
+ dz = cctk_delta_space(3)
+
+c Calculate timestep
+c ------------------
+ min_delta = min(dx,dy,dz)
+ cctk_delta_time = dtfac*min_delta
+
+ end subroutine wavetoy_initial
+
+
diff --git a/src/InitialData.F b/src/InitialData.F
new file mode 100644
index 0000000..b7dfffd
--- /dev/null
+++ b/src/InitialData.F
@@ -0,0 +1,126 @@
+ /*@@
+ @file InitialData.F77
+ @date
+ @author Tom Goodale
+ @desc
+ Initial data for the 3D Wave Equation
+ @enddesc
+ @@*/
+
+#include "cctk.h"
+#include "cctk_parameters.h"
+#include "cctk_arguments.h"
+
+
+
+ /*@@
+ @routine WaveToyF77_InitialData
+ @date
+ @author Tom Goodale
+ @desc
+ Set up initial data for the wave equation
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+ subroutine WaveToy_InitialData(CCTK_FARGUMENTS)
+
+ implicit none
+
+ DECLARE_CCTK_FARGUMENTS
+ DECLARE_CCTK_PARAMETERS
+
+ INTEGER CCTK_Equals
+
+ INTEGER i,j,k
+ CCTK_REAL dt, omega, pi
+ CCTK_REAL min_delta, dx,dy,dz
+
+ pi = 4.0*atan(1.0)
+
+c Grid spacing shortcuts
+c ----------------------
+ dx = cctk_delta_space(1)
+ dy = cctk_delta_space(2)
+ dz = cctk_delta_space(3)
+
+c Calculate timestep
+c ------------------
+ min_delta = min(dx,dy,dz)
+ cctk_delta_time = dtfac*min_delta
+ dt = cctk_delta_time
+
+ omega = sqrt(kx**2+ky**2+kz**2)
+
+ if (CCTK_EQUALS(initial_data,"plane")) then
+
+ do k=1,cctk_lsh(3)
+ do j=1,cctk_lsh(2)
+ do i=1,cctk_lsh(1)
+
+ phi(i,j,k) = amplitude*cos(kx*x(i,j,k)+ky*y(i,j,k)
+ & +kz*z(i,j,k)+omega*cctk_time)
+ phi_old(i,j,k) = amplitude*cos(kx*x(i,j,k)+ky*y(i,j,k)
+ & +kz*z(i,j,k)+omega*(cctk_time-dt))
+
+ end do
+ end do
+ end do
+
+ else if (CCTK_Equals(initial_data,"gaussian").eq.1) then
+
+ do k=1,cctk_lsh(3)
+ do j=1,cctk_lsh(2)
+ do i=1,cctk_lsh(1)
+
+ phi(i,j,k) = amplitude*exp( -(sqrt(x(i,j,k)**2
+ & +y(i,j,k)**2+z(i,j,k)**2)-radius)**2/sigma**2)
+ phi_old(i,j,k) = amplitude*exp( -(sqrt(x(i,j,k)**2
+ & +y(i,j,k)**2+z(i,j,k)**2)-radius(i,j,k)-dt)**2/sigma**2)
+
+ end do
+ end do
+ end do
+
+ else if (CCTK_Equals(initial_data, "box").eq.1) then
+
+c Use kx,ky,kz as number of modes in each direction.
+
+ do k=1,cctk_lsh(3)
+ do j=1,cctk_lsh(2)
+ do i=1,cctk_lsh(1)
+
+ phi(i,j,k) = amplitude*sin(kx*(x(i,j,k)-0.5)*pi)*
+ $ sin(ky*(y(i,j,k)-0.5)*pi)*
+ $ sin(kz*(z(i,j,k)-0.5)*pi)*
+ $ cos(omega*cctk_time*pi)
+
+ phi_old(i,j,k)= amplitude*sin(kx*(x(i,j,k)-0.5)*pi)*
+ $ sin(ky*(y(i,j,k)-0.5)*pi)*
+ $ sin(kz*(z(i,j,k)-0.5)*pi)*
+ $ cos(omega*(cctk_time-dt)*pi)
+
+
+ end do
+ end do
+ end do
+
+ end if
+
+c Apply symmetry boundary conditions
+c ----------------------------------
+ call ApplySymmetry(cctkGH,"wavetoy::scalarfields")
+
+c Synchronise
+c -----------
+ call CCTK_SyncGroup(cctkGH,"wavetoy::scalarfields")
+
+ return
+ end
+
+
diff --git a/src/InitialData.F77 b/src/InitialData.F77
new file mode 100644
index 0000000..777a8ca
--- /dev/null
+++ b/src/InitialData.F77
@@ -0,0 +1,126 @@
+ /*@@
+ @file InitialData.F
+ @date
+ @author Tom Goodale
+ @desc
+ Initial data for the 3D Wave Equation
+ @enddesc
+ @@*/
+
+#include "cctk.h"
+#include "cctk_parameters.h"
+#include "cctk_arguments.h"
+
+
+
+ /*@@
+ @routine WaveToyF77_InitialData
+ @date
+ @author Tom Goodale
+ @desc
+ Set up initial data for the wave equation
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+ subroutine WaveToyF77_InitialData(CCTK_FARGUMENTS)
+
+ implicit none
+
+ DECLARE_CCTK_FARGUMENTS
+ DECLARE_CCTK_PARAMETERS
+
+ INTEGER CCTK_Equals
+
+ INTEGER i,j,k
+ CCTK_REAL dt,omega, pi
+ CCTK_REAL min_delta,dx,dy,dz
+
+ pi = 4.0*atan(1.0)
+
+c Grid spacing shortcuts
+c ----------------------
+ dx = cctk_delta_space(1)
+ dy = cctk_delta_space(2)
+ dz = cctk_delta_space(3)
+
+c Calculate timestep
+c ------------------
+ min_delta = min(dx,dy,dz)
+ cctk_delta_time = dtfac*min_delta
+ dt = cctk_delta_time
+
+ omega = sqrt(kx**2+ky**2+kz**2)
+
+ if (CCTK_Equals(initial_data,"plane").eq.1) then
+
+ do k=1,cctk_lsh(3)
+ do j=1,cctk_lsh(2)
+ do i=1,cctk_lsh(1)
+
+ phi(i,j,k) = amplitude*cos(kx*x(i,j,k)+ky*y(i,j,k)
+ & +kz*z(i,j,k)+omega*cctk_time)
+ phi_old(i,j,k) = amplitude*cos(kx*x(i,j,k)+ky*y(i,j,k)
+ & +kz*z(i,j,k)+omega*(cctk_time-dt))
+
+ end do
+ end do
+ end do
+
+ else if (CCTK_Equals(initial_data,"gaussian").eq.1) then
+
+ do k=1,cctk_lsh(3)
+ do j=1,cctk_lsh(2)
+ do i=1,cctk_lsh(1)
+
+ phi(i,j,k) = amplitude*exp( -(sqrt(x(i,j,k)**2
+ & +y(i,j,k)**2+z(i,j,k)**2)-radius)**2/sigma**2)
+ phi_old(i,j,k) = amplitude*exp( -(sqrt(x(i,j,k)**2
+ & +y(i,j,k)**2+z(i,j,k)**2)-radius-dt)**2/sigma**2)
+
+ end do
+ end do
+ end do
+
+ else if (CCTK_Equals(initial_data, "box").eq.1) then
+
+c Use kx,ky,kz as number of modes in each direction.
+
+ do k=1,cctk_lsh(3)
+ do j=1,cctk_lsh(2)
+ do i=1,cctk_lsh(1)
+
+ phi(i,j,k) = amplitude*sin(kx*(x(i,j,k)-0.5)*pi)*
+ $ sin(ky*(y(i,j,k)-0.5)*pi)*
+ $ sin(kz*(z(i,j,k)-0.5)*pi)*
+ $ cos(omega*cctk_time*pi)
+
+ phi_old(i,j,k)= amplitude*sin(kx*(x(i,j,k)-0.5)*pi)*
+ $ sin(ky*(y(i,j,k)-0.5)*pi)*
+ $ sin(kz*(z(i,j,k)-0.5)*pi)*
+ $ cos(omega*(cctk_time-dt)*pi)
+
+
+ end do
+ end do
+ end do
+
+ end if
+
+c Apply symmetry boundary conditions
+c ----------------------------------
+ call ApplySymmetry(cctkGH,"wavetoy::scalarfields")
+
+c Synchronise
+c -----------
+ call CCTK_SyncGroup(cctkGH,"wavetoy::scalarfields")
+
+ return
+ end
+
+
diff --git a/src/Startup.c b/src/Startup.c
new file mode 100644
index 0000000..c23386d
--- /dev/null
+++ b/src/Startup.c
@@ -0,0 +1,18 @@
+ /*@@
+ @file Startup.c
+ @date
+ @author Gabrielle Allen
+ @desc
+ Register banner
+ @enddesc
+ @@*/
+
+int WaveToyF77_Startup(void)
+{
+
+ const char *banner =
+"WaveToyF77: Evolutions of a Scalar Field\nWritten by: Tom Goodale";
+
+ CCTK_RegisterBanner(banner);
+
+}
diff --git a/src/WaveToy.F77 b/src/WaveToy.F77
new file mode 100644
index 0000000..9a116e4
--- /dev/null
+++ b/src/WaveToy.F77
@@ -0,0 +1,151 @@
+ /*@@
+ @file WaveToy.F77
+ @date
+ @author Tom Goodale
+ @desc
+ Evolution routines for the wave equation solver
+ @enddesc
+ @@*/
+
+#include "cctk.h"
+#include "cctk_parameters.h"
+#include "cctk_arguments.h"
+
+
+ /*@@
+ @routine WaveToyF77_Boundaries
+ @date
+ @author Tom Goodale
+ @desc
+ Boundary conditions for the wave equation
+ @enddesc
+ @calls ApplyFlatBC,ApplyRadiativeBC
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+ subroutine WaveToyF77_Boundaries(CCTK_FARGUMENTS)
+
+ implicit none
+
+ DECLARE_CCTK_FARGUMENTS
+ DECLARE_CCTK_PARAMETERS
+
+ integer sw(3)
+ integer CCTK_Equals
+
+c Set the stencil width
+ sw(1)=1
+ sw(2)=1
+ sw(3)=1
+
+ call ApplySymmetry(cctkGH,"wavetoy::scalarfields")
+
+ if (CCTK_EQUALS(bound,"flat")) then
+ call ApplyFlatBC(cctkGH,sw,"wavetoy::phi")
+ else if (CCTK_Equals(bound,"radiation").eq.1) then
+ call ApplyRadiativeBC(cctkGH,1.0,sw,"wavetoy::phi","wavetoy::phi_old")
+ end if
+
+ return
+ end
+
+c --------------------------------------------------------------
+
+ /*@@
+ @routine WaveToyF77_Evolution
+ @date
+ @author Tom Goodale
+ @desc
+ Evolution for the wave equation
+ @enddesc
+ @calls CCTK_SyncGroup, wavetoy_boundaries
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+ subroutine WaveToyF77_evolution(CCTK_FARGUMENTS)
+
+ implicit none
+
+ DECLARE_CCTK_FARGUMENTS
+ DECLARE_CCTK_PARAMETERS
+
+c Declare local variables
+ INTEGER i,j,k
+ INTEGER istart, jstart, kstart, iend, jend, kend
+ CCTK_REAL dx,dy,dz,dt
+
+c Set up shorthands
+c -----------------
+ dx = cctk_delta_space(1)
+ dy = cctk_delta_space(2)
+ dz = cctk_delta_space(3)
+ dt = cctk_delta_time
+
+ istart = 2
+ jstart = 2
+ kstart = 2
+
+ iend = cctk_lsh(1)-1
+ jend = cctk_lsh(2)-1
+ kend = cctk_lsh(3)-1
+
+c Do the evolution
+c ----------------
+ do k = kstart, kend
+ do j = jstart, jend
+ do i = istart, iend
+
+ phi_tmp(i,j,k) =
+ 1 2.0*(1.0 - (dt**2)*(1.0/dx**2 +
+ 2 1.0/dy**2 +1.0/dz**2))*phi(i,j,k) -
+ 3 phi_old(i,j,k) + (dt**2) *
+ 5 ((phi(i+1,j,k)+phi(i-1,j,k))/dx**2
+ 6 +(phi(i,j+1,k)+phi(i,j-1,k))/dy**2
+ 7 +(phi(i,j,k+1)+phi(i,j,k-1))/dz**2)
+
+ end do
+ end do
+ end do
+
+c Update timeslices
+c -----------------
+ do k = 1, cctk_lsh(3)
+ do j = 1, cctk_lsh(2)
+ do i = 1, cctk_lsh(1)
+
+ phi_old(i,j,k) = phi(i,j,k)
+ phi(i,j,k) = phi_tmp(i,j,k)
+
+ end do
+ end do
+ end do
+
+c Apply boundary conditions
+c -------------------------
+ call WaveToyF77_Boundaries(CCTK_FARGUMENTS)
+
+c Synchronize
+c -----------
+ call CCTK_SyncGroup(cctkGH,"wavetoy::scalarfields")
+
+ return
+ end
+
+
+c --------------------------------------------------------------
+
+
+
+
+
+
+
+
diff --git a/src/make.code.defn b/src/make.code.defn
new file mode 100644
index 0000000..9ae50a6
--- /dev/null
+++ b/src/make.code.defn
@@ -0,0 +1,9 @@
+# Main make.code.defn file for thorn WaveToyF77
+# $Header$
+
+# Source files in this directory
+SRCS = InitialData.F77 InitSymBound.F77 CheckParameters.F77 WaveToy.F77 Startup.c
+
+# Subdirectories containing source files
+SUBDIRS =
+