aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface.ccl6
-rw-r--r--param.ccl8
-rw-r--r--schedule.ccl20
-rw-r--r--src/CheckParameters.F52
-rw-r--r--src/InitSymBound.F773
-rw-r--r--src/InitialData.F126
-rw-r--r--src/InitialData.F774
-rw-r--r--src/WaveToy.F778
8 files changed, 27 insertions, 200 deletions
diff --git a/interface.ccl b/interface.ccl
index 62c4309..be37f9a 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -1,16 +1,18 @@
# Interface definition for thorn WaveToyF77
# $Header$
-implements: wavetoyf77
+implements: wavetoy
inherits: grid
-private:
+protected:
cctk_real scalarevolve type = GF
{
phi
} "The evolved scalar field"
+private:
+
cctk_real scalarold type = GF
{
phi_old
diff --git a/param.ccl b/param.ccl
index 6316dd2..32d50ef 100644
--- a/param.ccl
+++ b/param.ccl
@@ -7,13 +7,17 @@ USES KEYWORD type ""
{
}
-private:
-
+
+restricted:
+
REAL dtfac "The timestep condition dt = dtfac*dx"
{
0:* :: "Should probably be bigger than zero"
} 0.5
+
+private:
+
REAL radius "The radius of the gaussian wave"
{
0:* ::
diff --git a/schedule.ccl b/schedule.ccl
index 80e7e7d..8e22789 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -1,38 +1,38 @@
-# Schedule definitions for thorn WaveToyF77
+# Schedule definitions for thorn WaveToy77
# $Header$
schedule WaveToyF77_Startup at CCTK_STARTUP
{
LANG: C
-} "Register the Wave Toy (F77) banner"
+} "Register banner"
schedule WaveToyF77_InitSymBound at CCTK_BASEGRID
{
LANG: Fortran
-} "Schedule symmetries for Wave Toy (F77)"
+} "Schedule symmetries"
schedule WaveToyF77_CheckParameters at CCTK_PARAMCHECK
{
LANG: Fortran
-} "Check parameters for Wave Toy (F77)"
+} "Check parameters"
# The basic fields always need memory and communication
# -----------------------------------------------------
-STORAGE: scalarfields
-COMMUNICATION: scalarfields
+STORAGE: scalarevolve,scalarold
+COMMUNICATION: scalarevolve
-schedule WaveToyF77_InitialData at CCTK_INITIAL
+schedule WaveToyF77_InitialData at CCTK_INITIAL AFTER test
{
LANG: Fortran
-} "Initialisation of example 3D wave equation"
+} "Initial data for 3D wave equation"
# Scalartmps are needed, without communication, during evolution
# --------------------------------------------------------------
-schedule WaveToyF77_evolution at CCTK_EVOL
+schedule WaveToyF77_Evolution at CCTK_EVOL
{
LANG: Fortran
STORAGE: scalartmps
-} "Evolution of example 3D wave equation"
+} "Evolution of 3D wave equation"
diff --git a/src/CheckParameters.F b/src/CheckParameters.F
deleted file mode 100644
index c2dec7e..0000000
--- a/src/CheckParameters.F
+++ /dev/null
@@ -1,52 +0,0 @@
- /*@@
- @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/InitSymBound.F77 b/src/InitSymBound.F77
index 680323b..9ea3fd4 100644
--- a/src/InitSymBound.F77
+++ b/src/InitSymBound.F77
@@ -39,8 +39,7 @@
sym(2) = one
sym(3) = one
- call SetCartSymmetry(cctkGH, sym,'wavetoyf77::phi')
- call SetCartSymmetry(cctkGH, sym,'wavetoyf77::phi_old')
+ call SetCartSymmetry(cctkGH, sym,'wavetoy::phi')
return
end
diff --git a/src/InitialData.F b/src/InitialData.F
deleted file mode 100644
index b7dfffd..0000000
--- a/src/InitialData.F
+++ /dev/null
@@ -1,126 +0,0 @@
- /*@@
- @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
index 6a3a61e..c435187 100644
--- a/src/InitialData.F77
+++ b/src/InitialData.F77
@@ -114,11 +114,11 @@ c Use kx,ky,kz as number of modes in each direction.
c Apply symmetry boundary conditions
c ----------------------------------
- call ApplySymmetry(cctkGH,"wavetoy::scalarfields")
+ call ApplySymmetry(cctkGH,"wavetoy::scalarevolve")
c Synchronise
c -----------
- call CCTK_SyncGroup(cctkGH,"wavetoy::scalarfields")
+ call CCTK_SyncGroup(cctkGH,"wavetoy::scalarevolve")
return
end
diff --git a/src/WaveToy.F77 b/src/WaveToy.F77
index 330fec0..c4ac4cb 100644
--- a/src/WaveToy.F77
+++ b/src/WaveToy.F77
@@ -42,12 +42,12 @@ c Set the stencil width
sw(2)=1
sw(3)=1
- call ApplySymmetry(cctkGH,"wavetoyf77::scalarfields")
+ call ApplySymmetry(cctkGH,"wavetoy::scalarevolve")
if (CCTK_EQUALS(bound,"flat")) then
- call ApplyFlatBC(cctkGH,sw,"wavetoyf77::phi")
+ call ApplyFlatBC(cctkGH,sw,"wavetoy::phi")
else if (CCTK_Equals(bound,"radiation").eq.1) then
- call ApplyRadiativeBC(cctkGH,1.0,sw,"wavetoyf77::phi","wavetoyf77::phi_old")
+ call ApplyRadiativeBC(cctkGH,1.0,sw,"wavetoy::phi","wavetoyf77::phi_old")
end if
return
@@ -134,7 +134,7 @@ c -------------------------
c Synchronize
c -----------
- call CCTK_SyncGroup(cctkGH,"wavetoyf77::scalarfields")
+ call CCTK_SyncGroup(cctkGH,"wavetoy::scalarevolve")
return
end