aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallen <allen@4451c3c6-1034-4891-99ea-21147727ccdf>1999-09-04 11:05:58 +0000
committerallen <allen@4451c3c6-1034-4891-99ea-21147727ccdf>1999-09-04 11:05:58 +0000
commit4ef140c2df7c77fefeb6927b5bf882d855562165 (patch)
tree90c13f861736ca5708aa49ec5bea5b3bb18de9cd
parenta12904e2eb63db11e01f9baa35aca7190c4e3239 (diff)
Removing initial data and setting of timestep from WaveToy, these
jobs go to different thorns now git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveToyF77/trunk@19 4451c3c6-1034-4891-99ea-21147727ccdf
-rw-r--r--interface.ccl7
-rw-r--r--par/wavetoy.par4
-rw-r--r--par/wavetoy_flat.par11
-rw-r--r--par/wavetoy_none.par11
-rw-r--r--par/wavetoy_rad.par11
-rw-r--r--param.ccl50
-rw-r--r--schedule.ccl13
-rw-r--r--src/CheckParameters.F7752
-rw-r--r--src/InitialData.F77126
-rw-r--r--src/WaveToy.F772
-rw-r--r--src/make.code.defn2
-rw-r--r--test/test_wavetoyf77.par12
12 files changed, 38 insertions, 263 deletions
diff --git a/interface.ccl b/interface.ccl
index cfe74cc..f8be420 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -2,22 +2,23 @@
# $Header$
implements: wavetoy
-inherits: grid
-protected:
+public:
cctk_real scalarevolve type = GF
{
phi
} "The evolved scalar field"
-private:
+protected:
cctk_real scalarold type = GF
{
phi_old
} "The scalar field at the last timestep"
+private:
+
cctk_real scalartmps type = GF
{
tmp
diff --git a/par/wavetoy.par b/par/wavetoy.par
index 6a622d5..310762e 100644
--- a/par/wavetoy.par
+++ b/par/wavetoy.par
@@ -10,7 +10,9 @@
# @enddesc
# @@*/
-ActiveThorns = "wavetoyf77 pugh cartgrid3d ioutil ioascii"
+ActiveThorns = "idscalarwave time wavetoyf77 pugh cartgrid3d ioutil ioascii"
+
+time::dtfac = 0.5
IOASCII::out1D_vars = "wavetoy::phi"
diff --git a/par/wavetoy_flat.par b/par/wavetoy_flat.par
index d4e5a4e..707b79e 100644
--- a/par/wavetoy_flat.par
+++ b/par/wavetoy_flat.par
@@ -10,11 +10,14 @@
# @enddesc
# @@*/
-ActiveThorns = "wavetoyf77 pugh cartgrid3d ioutil ioascii"
+ActiveThorns = "idscalarwave time wavetoyf77 pugh cartgrid3d ioutil ioascii"
-wavetoy::initial_data = "gaussian"
-wavetoy::sigma = 2.8
-wavetoy::radius = 0
+time::dtfac = 0.5
+
+idscalarwave::initial_data = "gaussian"
+idscalarwave::sigma = 2.8
+idscalarwave::radius = 0
+
wavetoy::bound = "flat"
grid::type = "BySpacing"
diff --git a/par/wavetoy_none.par b/par/wavetoy_none.par
index 03ff241..fe06349 100644
--- a/par/wavetoy_none.par
+++ b/par/wavetoy_none.par
@@ -10,11 +10,14 @@
# @enddesc
# @@*/
-ActiveThorns = "wavetoyf77 pugh cartgrid3d ioutil ioascii"
+ActiveThorns = "idscalarwave time wavetoyf77 pugh cartgrid3d ioutil ioascii"
-wavetoyf77::initial_data = "gaussian"
-wavetoyf77::sigma = 2.8
-wavetoyf77::radius = 0
+time::dtfac = 0.5
+
+idscalarwave::initial_data = "gaussian"
+idscalarwave::sigma = 2.8
+idscalarwave::radius = 0
+
wavetoyf77::bound = "none"
grid::type = "BySpacing"
diff --git a/par/wavetoy_rad.par b/par/wavetoy_rad.par
index 6d30e7c..3698699 100644
--- a/par/wavetoy_rad.par
+++ b/par/wavetoy_rad.par
@@ -10,11 +10,14 @@
# @enddesc
# @@*/
-ActiveThorns = "wavetoyf77 pugh cartgrid3d ioutil ioascii"
+ActiveThorns = "idscalarwave time wavetoyf77 pugh cartgrid3d ioutil ioascii"
-wavetoyf77::initial_data = "gaussian"
-wavetoyf77::sigma = 2.8
-wavetoyf77::radius = 0
+time::dtfac = 0.5
+
+idscalarwave::initial_data = "gaussian"
+idscalarwave::sigma = 2.8
+idscalarwave::radius = 0
+
wavetoyf77::bound = "radiation"
grid::type = "BySpacing"
diff --git a/param.ccl b/param.ccl
index 32d50ef..fc1009c 100644
--- a/param.ccl
+++ b/param.ccl
@@ -1,58 +1,8 @@
# Parameter definitions for thorn WaveToyF77
# $Header$
-shares: grid
-
-USES KEYWORD type ""
-{
-}
-
-
-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:* ::
-} 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"
diff --git a/schedule.ccl b/schedule.ccl
index 8e22789..416d4c8 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -11,22 +11,11 @@ schedule WaveToyF77_InitSymBound at CCTK_BASEGRID
LANG: Fortran
} "Schedule symmetries"
-schedule WaveToyF77_CheckParameters at CCTK_PARAMCHECK
-{
- LANG: Fortran
-} "Check parameters"
-
-
# The basic fields always need memory and communication
# -----------------------------------------------------
-STORAGE: scalarevolve,scalarold
+STORAGE: scalarevolve,scalarold
COMMUNICATION: scalarevolve
-schedule WaveToyF77_InitialData at CCTK_INITIAL AFTER test
-{
- LANG: Fortran
-} "Initial data for 3D wave equation"
-
# Scalartmps are needed, without communication, during evolution
# --------------------------------------------------------------
schedule WaveToyF77_Evolution at CCTK_EVOL
diff --git a/src/CheckParameters.F77 b/src/CheckParameters.F77
deleted file mode 100644
index ccf9fbb..0000000
--- a/src/CheckParameters.F77
+++ /dev/null
@@ -1,52 +0,0 @@
- /*@@
- @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/InitialData.F77 b/src/InitialData.F77
deleted file mode 100644
index c435187..0000000
--- a/src/InitialData.F77
+++ /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 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::scalarevolve")
-
-c Synchronise
-c -----------
- call CCTK_SyncGroup(cctkGH,"wavetoy::scalarevolve")
-
- return
- end
-
-
diff --git a/src/WaveToy.F77 b/src/WaveToy.F77
index 82f45b4..40636bb 100644
--- a/src/WaveToy.F77
+++ b/src/WaveToy.F77
@@ -47,7 +47,7 @@ c Set the stencil width
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","wavetoyf77::phi_old")
+ call ApplyRadiativeBC(cctkGH,1.0,sw,"wavetoy::phi","wavetoy::phi_old")
end if
return
diff --git a/src/make.code.defn b/src/make.code.defn
index 9ae50a6..c0dcc01 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -2,7 +2,7 @@
# $Header$
# Source files in this directory
-SRCS = InitialData.F77 InitSymBound.F77 CheckParameters.F77 WaveToy.F77 Startup.c
+SRCS = InitSymBound.F77 WaveToy.F77 Startup.c
# Subdirectories containing source files
SUBDIRS =
diff --git a/test/test_wavetoyf77.par b/test/test_wavetoyf77.par
index 54462f3..8e26463 100644
--- a/test/test_wavetoyf77.par
+++ b/test/test_wavetoyf77.par
@@ -1,12 +1,14 @@
# test_wavetoyf77.par : WaveToyF77
-ActiveThorns = "wavetoyf77 pugh cartgrid3d ioutil ioascii"
+ActiveThorns = "time wavetoyf77 idscalarwave pugh cartgrid3d ioutil ioascii"
-grid::type = "box"
+grid::type = "box"
-wavetoyf77::initial_data = "gaussian"
-wavetoyf77::sigma = 0.1
-wavetoyf77::radius = 0
+time::dtfac = 0.5
+
+idscalarwave::initial_data = "gaussian"
+idscalarwave::sigma = 0.1
+idscalarwave::radius = 0
driver::global_nx = 20
driver::global_ny = 20