aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallen <allen@f80f6fb6-8356-4fd4-90bc-d84ad503c100>1999-09-04 11:07:02 +0000
committerallen <allen@f80f6fb6-8356-4fd4-90bc-d84ad503c100>1999-09-04 11:07:02 +0000
commit6fdb31f4fa147be1067f8c43e365a638ccedda2f (patch)
tree18e85ef15179f2dbb556523ef6031f23445c1874
parent53f1e5d0e5ab6597791bcea513f29bcb75787547 (diff)
Removing initial data and setting timestep, these jobs are in their
own thorns now. git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveToyF90/trunk@12 f80f6fb6-8356-4fd4-90bc-d84ad503c100
-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.par13
-rw-r--r--param.ccl50
-rw-r--r--schedule.ccl11
-rw-r--r--src/CheckParameters.F51
-rw-r--r--src/InitialData.F96
-rw-r--r--src/WaveToy.F2
-rw-r--r--src/make.code.defn2
-rw-r--r--test/test_wavetoyf90.par10
12 files changed, 37 insertions, 231 deletions
diff --git a/interface.ccl b/interface.ccl
index 906b862..d3e8fda 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
{
phi_tmp
diff --git a/par/wavetoy.par b/par/wavetoy.par
index 3f25992..3de82b2 100644
--- a/par/wavetoy.par
+++ b/par/wavetoy.par
@@ -10,7 +10,9 @@
# @enddesc
# @@*/
-ActiveThorns = "wavetoyf90 pugh cartgrid3d ioutil ioascii"
+ActiveThorns = "idscalarwave time wavetoyf90 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 738719d..c5e4047 100644
--- a/par/wavetoy_flat.par
+++ b/par/wavetoy_flat.par
@@ -10,11 +10,14 @@
# @enddesc
# @@*/
-ActiveThorns = "wavetoyf90 pugh cartgrid3d ioutil ioascii"
+ActiveThorns = "idscalarwave time wavetoyf90 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 61970c1..b571f7f 100644
--- a/par/wavetoy_none.par
+++ b/par/wavetoy_none.par
@@ -10,11 +10,14 @@
# @enddesc
# @@*/
-ActiveThorns = "wavetoyf90 pugh cartgrid3d ioutil ioascii"
+ActiveThorns = "idscalarwave time wavetoyf90 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 = "none"
grid::type = "BySpacing"
diff --git a/par/wavetoy_rad.par b/par/wavetoy_rad.par
index 59fc448..713cea7 100644
--- a/par/wavetoy_rad.par
+++ b/par/wavetoy_rad.par
@@ -10,12 +10,15 @@
# @enddesc
# @@*/
-ActiveThorns = "wavetoyf90 pugh cartgrid3d ioutil ioascii"
+ActiveThorns = "idscalarwave time wavetoyf90 pugh cartgrid3d ioutil ioascii"
-wavetoyf90::initial_data = "gaussian"
-wavetoyf90::sigma = 2.8
-wavetoyf90::radius = 0
-wavetoyf90::bound = "radiation"
+time::dtfac = 0.5
+
+IDScalarWave::initial_data = "gaussian"
+IDScalarWave::sigma = 2.8
+IDScalarWave::radius = 0
+
+wavetoyf90::bound = "radiation"
grid::type = "BySpacing"
grid::domain = "octant"
diff --git a/param.ccl b/param.ccl
index 5d0361b..14f9294 100644
--- a/param.ccl
+++ b/param.ccl
@@ -1,58 +1,8 @@
# Parameter definitions for thorn WaveToyF90
# $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 7d33d09..2b443e2 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -11,22 +11,11 @@ schedule WaveToyF90_InitSymBound at CCTK_BASEGRID
LANG: Fortran
} "Schedule symmetries"
-schedule WaveToyF90_CheckParameters at CCTK_PARAMCHECK
-{
- LANG: Fortran
-} "Check parameters"
-
-
# The basic fields always need memory and communication
# -----------------------------------------------------
STORAGE: scalarevolve,scalarold
COMMUNICATION: scalarevolve
-schedule WaveToyF90_InitialData at CCTK_INITIAL AFTER test
-{
- LANG: Fortran
-} "Initial data for 3D wave equation"
-
# Scalartmps are needed, without communication, during evolution
# --------------------------------------------------------------
schedule WaveToyF90_Evolution at CCTK_EVOL
diff --git a/src/CheckParameters.F b/src/CheckParameters.F
deleted file mode 100644
index e02897e..0000000
--- a/src/CheckParameters.F
+++ /dev/null
@@ -1,51 +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 WaveToyF90_CheckParameters(CCTK_FARGUMENTS)
-
- implicit none
-
- DECLARE_CCTK_FARGUMENTS
- DECLARE_CCTK_PARAMETERS
-
- INTEGER CCTK_Equals
-
- if (CCTK_Equals(initial_data,"box")==1) then
-
- if (CCTK_Equals(type, "box")==0) then
- call CCTK_PARAMWARN("Must have a box grid with box initial data")
- end if
-
- if (kx==0 .or. ky==0 .or. kz==0) then
- call CCTK_PARAMWARN("Cannot have zero kx,ky,kz for box initial data")
- end if
-
- end if
-
- end subroutine WaveToyF90_CheckParameters
diff --git a/src/InitialData.F b/src/InitialData.F
deleted file mode 100644
index 1f12a5f..0000000
--- a/src/InitialData.F
+++ /dev/null
@@ -1,96 +0,0 @@
- /*@@
- @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 WaveToyF90_InitialData
- @date
- @author Tom Goodale
- @desc
- Set up initial data for the wave equation
- @enddesc
- @calls
- @calledby
- @history
-
- @endhistory
-
-@@*/
-
- subroutine WaveToyF90_InitialData(CCTK_FARGUMENTS)
-
- implicit none
-
- DECLARE_CCTK_FARGUMENTS
- DECLARE_CCTK_PARAMETERS
-
- INTEGER CCTK_Equals
-
- INTEGER :: i
- 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")==1) then
-
- phi = amplitude*cos(kx*x+ky*y+kz*z+omega*cctk_time)
- phi_old = amplitude*cos(kx*x+ky*y+kz*z+omega*(cctk_time-dt))
-
- else if (CCTK_Equals(initial_data,"gaussian")==1) then
-
- call CCTK_INFO("Gaussian initial data for Wave Equation");
- phi = amplitude*exp( -(sqrt(x**2+y**2+z**2)-radius)**2/sigma**2)
- phi_old = amplitude*exp( -(sqrt(x**2+y**2+z**2)-radius-dt)**2/sigma**2)
-
- else if (CCTK_Equals(initial_data, "box")==1) then
-
-c Use kx,ky,kz as number of modes in each direction.
-
- phi = amplitude*sin(kx*(x-0.5)*pi)*
- $ sin(ky*(y-0.5)*pi)*
- $ sin(kz*(z-0.5)*pi)*
- $ cos(omega*cctk_time*pi)
-
- phi_old = amplitude*sin(kx*(x-0.5)*pi)*
- $ sin(ky*(y-0.5)*pi)*
- $ sin(kz*(z-0.5)*pi)*
- $ cos(omega*(cctk_time-dt)*pi)
-
- end if
-
-c Apply symmetry boundary conditions
-c ----------------------------------
- call ApplySymmetry(cctkGH,"wavetoy::scalarevolve")
-
-c Synchronise
-c -----------
- call CCTK_SyncGroup(cctkGH,"wavetoy::scalarevolve")
-
- end subroutine WaveToyF90_InitialData
-
-
diff --git a/src/WaveToy.F b/src/WaveToy.F
index f800edf..7d93465 100644
--- a/src/WaveToy.F
+++ b/src/WaveToy.F
@@ -43,7 +43,7 @@
if (CCTK_Equals(bound,"flat")==1) then
call ApplyFlatBC(cctkGH,sw,"wavetoy::phi")
else if (CCTK_Equals(bound,"radiation")==1) then
- call ApplyRadiativeBC(cctkGH,zero,sw,"wavetoy::phi","wavetoyf90::phi_old")
+ call ApplyRadiativeBC(cctkGH,zero,sw,"wavetoy::phi","wavetoy::phi_old")
end if
end subroutine wavetoyf90_boundaries
diff --git a/src/make.code.defn b/src/make.code.defn
index 6797754..94b12c3 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -2,7 +2,7 @@
# $Header$
# Source files in this directory
-SRCS = InitialData.F InitSymBound.F CheckParameters.F WaveToy.F Startup.c
+SRCS = InitSymBound.F WaveToy.F Startup.c
# Subdirectories containing source files
SUBDIRS =
diff --git a/test/test_wavetoyf90.par b/test/test_wavetoyf90.par
index b7acaef..ac2a323 100644
--- a/test/test_wavetoyf90.par
+++ b/test/test_wavetoyf90.par
@@ -1,12 +1,14 @@
# test_wavetoyf90.par : WaveToyF90
-ActiveThorns = "wavetoyf90 pugh cartgrid3d ioutil ioascii"
+ActiveThorns = "time idscalarwave wavetoyf90 pugh cartgrid3d ioutil ioascii"
+
+time::dtfac = 0.5
grid::type = "box"
-wavetoyf90::initial_data = "gaussian"
-wavetoyf90::sigma = 0.1
-wavetoyf90::radius = 0
+idscalarwave::initial_data = "gaussian"
+idscalarwave::sigma = 0.1
+idscalarwave::radius = 0
driver::global_nx = 20
driver::global_ny = 20