aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@daab82bb-f315-4ad1-b6d0-9353ff8b6e27>2000-03-29 07:42:26 +0000
committergoodale <goodale@daab82bb-f315-4ad1-b6d0-9353ff8b6e27>2000-03-29 07:42:26 +0000
commit466765830e3ee8e6b4fb4b9a9c232171f7b55bf3 (patch)
treedfb5eed3b1766f6e4751f408012bbafa85dddc51
parente07ae62012ec2ccb3d283670a90252ea6d4bf6cd (diff)
Changed to use timelevels - thanks for putting the rotation in PUGH Ed.
Note that the no-boundary condition tests assumed that phi_new had zero at its boundaries. This is, or course, no longer true with timelevel rotation. Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveToyFreeF90/trunk@16 daab82bb-f315-4ad1-b6d0-9353ff8b6e27
-rw-r--r--interface.ccl13
-rw-r--r--schedule.ccl1
-rw-r--r--src/InitSymBound.F901
-rw-r--r--src/WaveToy.F9023
-rw-r--r--test/test_wavetoyfreef90/phi.dl4
-rw-r--r--test/test_wavetoyfreef90/phi.xl92
-rw-r--r--test/test_wavetoyfreef90/phi.yl92
-rw-r--r--test/test_wavetoyfreef90/phi_max.tl6
-rw-r--r--test/test_wavetoyfreef90/phi_min.tl2
-rw-r--r--test/test_wavetoyfreef90/phi_nm1.tl10
-rw-r--r--test/test_wavetoyfreef90/phi_nm2.tl4
11 files changed, 119 insertions, 129 deletions
diff --git a/interface.ccl b/interface.ccl
index 99223b6..cf6960f 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -3,20 +3,15 @@
implements: wavetoy
+USES INCLUDE: Boundary.h
+USES INCLUDE: Symmetry.h
+
public:
-cctk_real scalarevolve type = GF
+cctk_real scalarevolve type = GF Timelevels=3
{
phi
- phi_old
} "The evolved scalar field"
-private:
-
-cctk_real temps type = GF
-{
- phi_tmp
-} "Temporary grid functions"
-
diff --git a/schedule.ccl b/schedule.ccl
index 29d35af..9686bca 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -16,5 +16,4 @@ schedule WaveToyFreeF90_InitSymBound at BASEGRID
schedule WaveToyFreeF90_Evolution as WaveToy_Evolution at EVOL
{
LANG: Fortran
- STORAGE: temps
} "Evolution of 3D wave equation"
diff --git a/src/InitSymBound.F90 b/src/InitSymBound.F90
index 958aafa..2e8be89 100644
--- a/src/InitSymBound.F90
+++ b/src/InitSymBound.F90
@@ -34,6 +34,5 @@ subroutine WaveToyFreeF90_InitSymBound(CCTK_ARGUMENTS)
INTEGER, DIMENSION(3) :: sym = 1
call SetCartSymmetry(cctkGH, sym, 'wavetoy::phi')
- call SetCartSymmetry(cctkGH, sym, 'wavetoyfreef90::phi_tmp')
end subroutine WaveToyFreeF90_InitSymbound
diff --git a/src/WaveToy.F90 b/src/WaveToy.F90
index 1a02912..6ba1074 100644
--- a/src/WaveToy.F90
+++ b/src/WaveToy.F90
@@ -46,6 +46,8 @@ subroutine WaveToyFreeF90_Evolution(CCTK_ARGUMENTS)
CCTK_REAL :: dx,dy,dz,dt
CCTK_REAL :: dx2,dy2,dz2,dt2
CCTK_REAL :: dx2i,dy2i,dz2i
+
+ CCTK_REAL :: factor
! Set up shorthands
! -----------------
@@ -70,6 +72,8 @@ subroutine WaveToyFreeF90_Evolution(CCTK_ARGUMENTS)
iend = cctk_lsh(1)-1
jend = cctk_lsh(2)-1
kend = cctk_lsh(3)-1
+
+ factor = 2*(1 - (dt2)*(dx2i + dy2i + dz2i))
! Do the evolution
! ----------------
@@ -77,10 +81,8 @@ subroutine WaveToyFreeF90_Evolution(CCTK_ARGUMENTS)
do j = jstart, jend
do i = istart, iend
- phi_tmp(i,j,k) = &
- 2.0*(1.0 - (dt2)*(dx2i + &
- dy2i + dz2i))*phi(i,j,k) - &
- phi_old(i,j,k) + (dt2) * &
+ phi_n(i,j,k) = factor*phi(i,j,k) - &
+ phi_p(i,j,k) + (dt2) * &
((phi(i+1,j,k)+phi(i-1,j,k))*dx2i &
+(phi(i,j+1,k)+phi(i,j-1,k))*dy2i &
+(phi(i,j,k+1)+phi(i,j,k-1))*dz2i)
@@ -91,17 +93,12 @@ subroutine WaveToyFreeF90_Evolution(CCTK_ARGUMENTS)
! Synchronize
! -----------
- call CCTK_SyncGroup(cctkGH,"wavetoyFreeF90::temps")
+ call CCTK_SyncGroup(cctkGH,"wavetoy::scalarevolve")
! Apply boundary conditions
! -------------------------
call WaveToyFreeF90_Boundaries(CCTK_PASS_FTOF)
- ! Update timeslices
- ! -----------------
- phi_old = phi
- phi = phi_tmp
-
end subroutine WaveToyFreeF90_Evolution
@@ -134,13 +131,13 @@ subroutine WaveToyFreeF90_Boundaries(CCTK_ARGUMENTS)
CCTK_REAL, parameter :: zero = 0.0
CCTK_REAL, parameter :: one = 1.0
- call CartSymBCGroup(ierr,cctkGH,"wavetoyfreef90::temps")
+ call CartSymBCGroup(ierr,cctkGH,"wavetoy::scalarevolve")
if (CCTK_EQUALS(bound,"flat")) then
- call FlatBCVar(ierr,cctkGH,sw,"wavetoyfreef90::phi_tmp")
+ call FlatBCVar(ierr,cctkGH,sw,"wavetoy::phi")
else if (CCTK_EQUALS(bound,"radiation")) then
call RadiativeBCVar(ierr,cctkGH,zero,one,sw, &
- "wavetoyfreef90::phi_tmp","wavetoy::phi")
+ "wavetoy::phi","wavetoy::phi")
end if
if (ierr < 0) then
diff --git a/test/test_wavetoyfreef90/phi.dl b/test/test_wavetoyfreef90/phi.dl
index 16493b0..12f574d 100644
--- a/test/test_wavetoyfreef90/phi.dl
+++ b/test/test_wavetoyfreef90/phi.dl
@@ -121,7 +121,7 @@
-0.683704 -0.0000000003848
-0.592544 -0.0000008256207
-0.501383 -0.0001851985238
--0.410223 -0.0080724403496
+-0.410223 -0.0080724403495
-0.319062 -0.0860002778716
-0.227901 -0.3020549188440
-0.136741 -0.2694342257320
@@ -130,7 +130,7 @@
0.136741 -0.2694342257320
0.227901 -0.3020549188440
0.319062 -0.0860002778716
-0.410223 -0.0080724403496
+0.410223 -0.0080724403495
0.501383 -0.0001851985238
0.592544 -0.0000008256207
0.683704 -0.0000000003848
diff --git a/test/test_wavetoyfreef90/phi.xl b/test/test_wavetoyfreef90/phi.xl
index 9bef5dd..55a520c 100644
--- a/test/test_wavetoyfreef90/phi.xl
+++ b/test/test_wavetoyfreef90/phi.xl
@@ -24,7 +24,7 @@
"Time = 0.052632
--0.500000 0.0000000000000
+-0.500000 0.0000000001579
-0.447368 0.0000002442580
-0.394737 0.0000055185355
-0.342105 0.0000636892398
@@ -43,13 +43,13 @@
0.342105 0.0000636892398
0.394737 0.0000055185355
0.447368 0.0000002442580
-0.500000 0.0000000000000
+0.500000 0.0000000001579
"Time = 0.105263
-0.500000 0.0000000000000
--0.447368 0.0000074500351
--0.394737 0.0000571366688
+-0.447368 0.0000074500893
+-0.394737 0.0000571366787
-0.342105 0.0000891850929
-0.289474 -0.0021735254063
-0.236842 -0.0208336611591
@@ -64,17 +64,17 @@
0.236842 -0.0208336611591
0.289474 -0.0021735254063
0.342105 0.0000891850929
-0.394737 0.0000571366688
-0.447368 0.0000074500351
+0.394737 0.0000571366787
+0.447368 0.0000074500893
0.500000 0.0000000000000
"Time = 0.157895
--0.500000 0.0000000000000
--0.447368 0.0000404464126
--0.394737 -0.0000934612273
--0.342105 -0.0028408356519
--0.289474 -0.0203343223830
+-0.500000 0.0000000000121
+-0.447368 0.0000404464522
+-0.394737 -0.0000934611932
+-0.342105 -0.0028408356421
+-0.289474 -0.0203343223824
-0.236842 -0.0840586024960
-0.184211 -0.2362253936422
-0.131579 -0.4920251452215
@@ -85,54 +85,54 @@
0.131579 -0.4920251452215
0.184211 -0.2362253936422
0.236842 -0.0840586024960
-0.289474 -0.0203343223830
-0.342105 -0.0028408356519
-0.394737 -0.0000934612273
-0.447368 0.0000404464126
-0.500000 0.0000000000000
+0.289474 -0.0203343223824
+0.342105 -0.0028408356421
+0.394737 -0.0000934611932
+0.447368 0.0000404464522
+0.500000 0.0000000000121
"Time = 0.210526
--0.500000 0.0000000000000
--0.447368 -0.0002560735304
--0.394737 -0.0032223677845
--0.342105 -0.0191504024223
--0.289474 -0.0718425508255
--0.236842 -0.1869773941527
--0.184211 -0.3531984196037
+-0.500000 0.0000000001579
+-0.447368 -0.0002560735181
+-0.394737 -0.0032223677598
+-0.342105 -0.0191504023972
+-0.289474 -0.0718425508170
+-0.236842 -0.1869773941516
+-0.184211 -0.3531984196036
-0.131579 -0.4762760737732
-0.078947 -0.4212470397782
-0.026316 -0.2663944260771
0.026316 -0.2663944260771
0.078947 -0.4212470397782
0.131579 -0.4762760737732
-0.184211 -0.3531984196037
-0.236842 -0.1869773941527
-0.289474 -0.0718425508255
-0.342105 -0.0191504024223
-0.394737 -0.0032223677845
-0.447368 -0.0002560735304
-0.500000 0.0000000000000
+0.184211 -0.3531984196036
+0.236842 -0.1869773941516
+0.289474 -0.0718425508170
+0.342105 -0.0191504023972
+0.394737 -0.0032223677598
+0.447368 -0.0002560735181
+0.500000 0.0000000001579
"Time = 0.263158
-0.500000 0.0000000000000
--0.447368 -0.0034053135086
--0.394737 -0.0177523942899
--0.342105 -0.0616617809349
--0.289474 -0.1512610524732
--0.236842 -0.2676581405563
--0.184211 -0.3314593226331
--0.131579 -0.2530697030291
--0.078947 -0.0930373771551
+-0.447368 -0.0034053134726
+-0.394737 -0.0177523942812
+-0.342105 -0.0616617809179
+-0.289474 -0.1512610524542
+-0.236842 -0.2676581405491
+-0.184211 -0.3314593226319
+-0.131579 -0.2530697030290
+-0.078947 -0.0930373771550
-0.026316 -0.0172399268943
0.026316 -0.0172399268943
-0.078947 -0.0930373771551
-0.131579 -0.2530697030291
-0.184211 -0.3314593226331
-0.236842 -0.2676581405563
-0.289474 -0.1512610524732
-0.342105 -0.0616617809349
-0.394737 -0.0177523942899
-0.447368 -0.0034053135086
+0.078947 -0.0930373771550
+0.131579 -0.2530697030290
+0.184211 -0.3314593226319
+0.236842 -0.2676581405491
+0.289474 -0.1512610524542
+0.342105 -0.0616617809179
+0.394737 -0.0177523942812
+0.447368 -0.0034053134726
0.500000 0.0000000000000
diff --git a/test/test_wavetoyfreef90/phi.yl b/test/test_wavetoyfreef90/phi.yl
index 9bef5dd..55a520c 100644
--- a/test/test_wavetoyfreef90/phi.yl
+++ b/test/test_wavetoyfreef90/phi.yl
@@ -24,7 +24,7 @@
"Time = 0.052632
--0.500000 0.0000000000000
+-0.500000 0.0000000001579
-0.447368 0.0000002442580
-0.394737 0.0000055185355
-0.342105 0.0000636892398
@@ -43,13 +43,13 @@
0.342105 0.0000636892398
0.394737 0.0000055185355
0.447368 0.0000002442580
-0.500000 0.0000000000000
+0.500000 0.0000000001579
"Time = 0.105263
-0.500000 0.0000000000000
--0.447368 0.0000074500351
--0.394737 0.0000571366688
+-0.447368 0.0000074500893
+-0.394737 0.0000571366787
-0.342105 0.0000891850929
-0.289474 -0.0021735254063
-0.236842 -0.0208336611591
@@ -64,17 +64,17 @@
0.236842 -0.0208336611591
0.289474 -0.0021735254063
0.342105 0.0000891850929
-0.394737 0.0000571366688
-0.447368 0.0000074500351
+0.394737 0.0000571366787
+0.447368 0.0000074500893
0.500000 0.0000000000000
"Time = 0.157895
--0.500000 0.0000000000000
--0.447368 0.0000404464126
--0.394737 -0.0000934612273
--0.342105 -0.0028408356519
--0.289474 -0.0203343223830
+-0.500000 0.0000000000121
+-0.447368 0.0000404464522
+-0.394737 -0.0000934611932
+-0.342105 -0.0028408356421
+-0.289474 -0.0203343223824
-0.236842 -0.0840586024960
-0.184211 -0.2362253936422
-0.131579 -0.4920251452215
@@ -85,54 +85,54 @@
0.131579 -0.4920251452215
0.184211 -0.2362253936422
0.236842 -0.0840586024960
-0.289474 -0.0203343223830
-0.342105 -0.0028408356519
-0.394737 -0.0000934612273
-0.447368 0.0000404464126
-0.500000 0.0000000000000
+0.289474 -0.0203343223824
+0.342105 -0.0028408356421
+0.394737 -0.0000934611932
+0.447368 0.0000404464522
+0.500000 0.0000000000121
"Time = 0.210526
--0.500000 0.0000000000000
--0.447368 -0.0002560735304
--0.394737 -0.0032223677845
--0.342105 -0.0191504024223
--0.289474 -0.0718425508255
--0.236842 -0.1869773941527
--0.184211 -0.3531984196037
+-0.500000 0.0000000001579
+-0.447368 -0.0002560735181
+-0.394737 -0.0032223677598
+-0.342105 -0.0191504023972
+-0.289474 -0.0718425508170
+-0.236842 -0.1869773941516
+-0.184211 -0.3531984196036
-0.131579 -0.4762760737732
-0.078947 -0.4212470397782
-0.026316 -0.2663944260771
0.026316 -0.2663944260771
0.078947 -0.4212470397782
0.131579 -0.4762760737732
-0.184211 -0.3531984196037
-0.236842 -0.1869773941527
-0.289474 -0.0718425508255
-0.342105 -0.0191504024223
-0.394737 -0.0032223677845
-0.447368 -0.0002560735304
-0.500000 0.0000000000000
+0.184211 -0.3531984196036
+0.236842 -0.1869773941516
+0.289474 -0.0718425508170
+0.342105 -0.0191504023972
+0.394737 -0.0032223677598
+0.447368 -0.0002560735181
+0.500000 0.0000000001579
"Time = 0.263158
-0.500000 0.0000000000000
--0.447368 -0.0034053135086
--0.394737 -0.0177523942899
--0.342105 -0.0616617809349
--0.289474 -0.1512610524732
--0.236842 -0.2676581405563
--0.184211 -0.3314593226331
--0.131579 -0.2530697030291
--0.078947 -0.0930373771551
+-0.447368 -0.0034053134726
+-0.394737 -0.0177523942812
+-0.342105 -0.0616617809179
+-0.289474 -0.1512610524542
+-0.236842 -0.2676581405491
+-0.184211 -0.3314593226319
+-0.131579 -0.2530697030290
+-0.078947 -0.0930373771550
-0.026316 -0.0172399268943
0.026316 -0.0172399268943
-0.078947 -0.0930373771551
-0.131579 -0.2530697030291
-0.184211 -0.3314593226331
-0.236842 -0.2676581405563
-0.289474 -0.1512610524732
-0.342105 -0.0616617809349
-0.394737 -0.0177523942899
-0.447368 -0.0034053135086
+0.078947 -0.0930373771550
+0.131579 -0.2530697030290
+0.184211 -0.3314593226319
+0.236842 -0.2676581405491
+0.289474 -0.1512610524542
+0.342105 -0.0616617809179
+0.394737 -0.0177523942812
+0.447368 -0.0034053134726
0.500000 0.0000000000000
diff --git a/test/test_wavetoyfreef90/phi_max.tl b/test/test_wavetoyfreef90/phi_max.tl
index 6355b45..7d6d6cf 100644
--- a/test/test_wavetoyfreef90/phi_max.tl
+++ b/test/test_wavetoyfreef90/phi_max.tl
@@ -2,6 +2,6 @@
0.000000 0.8124050503725
0.052632 0.0002832523498
0.105263 0.0000891850929
-0.157895 0.0000404464126
-0.210526 0.0000003961843
-0.263158 0.0000001100396
+0.157895 0.0000404464522
+0.210526 0.0000003961856
+0.263158 0.0000001100397
diff --git a/test/test_wavetoyfreef90/phi_min.tl b/test/test_wavetoyfreef90/phi_min.tl
index c002c48..a1d8579 100644
--- a/test/test_wavetoyfreef90/phi_min.tl
+++ b/test/test_wavetoyfreef90/phi_min.tl
@@ -4,4 +4,4 @@
0.105263 -1.1290503258507
0.157895 -0.9019842677611
0.210526 -0.4997593550838
-0.263158 -0.3594146186544
+0.263158 -0.3594146186543
diff --git a/test/test_wavetoyfreef90/phi_nm1.tl b/test/test_wavetoyfreef90/phi_nm1.tl
index 5ac6c8a..895a3b0 100644
--- a/test/test_wavetoyfreef90/phi_nm1.tl
+++ b/test/test_wavetoyfreef90/phi_nm1.tl
@@ -1,7 +1,7 @@
"phi norm1 v time
0.000000 0.0047741452163
-0.052632 0.0023586563889
-0.105263 0.0094832901772
-0.157895 0.0166095490057
-0.210526 0.0237365580785
-0.263158 0.0308582835984
+0.052632 0.0023586563905
+0.105263 0.0094832901779
+0.157895 0.0166095490059
+0.210526 0.0237365580784
+0.263158 0.0308582835960
diff --git a/test/test_wavetoyfreef90/phi_nm2.tl b/test/test_wavetoyfreef90/phi_nm2.tl
index e9504b4..0fea72d 100644
--- a/test/test_wavetoyfreef90/phi_nm2.tl
+++ b/test/test_wavetoyfreef90/phi_nm2.tl
@@ -3,5 +3,5 @@
0.052632 0.0158441957039
0.105263 0.0637392141088
0.157895 0.0805995803466
-0.210526 0.0821416890830
-0.263158 0.0821638479507
+0.210526 0.0821416890828
+0.263158 0.0821638479495