From acd7a42b3d1301a3f94121f15f5740113e49e74a Mon Sep 17 00:00:00 2001 From: goodale Date: Wed, 29 Mar 2000 07:42:23 +0000 Subject: 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/WaveToyF90/trunk@42 f80f6fb6-8356-4fd4-90bc-d84ad503c100 --- interface.ccl | 11 ++--- schedule.ccl | 1 - src/InitSymBound.F | 1 - src/WaveToy.F | 30 ++++++-------- test/test_wavetoyf90/phi.dl | 4 +- test/test_wavetoyf90/phi.xl | 92 ++++++++++++++++++++--------------------- test/test_wavetoyf90/phi.yl | 92 ++++++++++++++++++++--------------------- test/test_wavetoyf90/phi_max.tl | 6 +-- test/test_wavetoyf90/phi_min.tl | 2 +- test/test_wavetoyf90/phi_nm1.tl | 10 ++--- test/test_wavetoyf90/phi_nm2.tl | 4 +- 11 files changed, 122 insertions(+), 131 deletions(-) diff --git a/interface.ccl b/interface.ccl index 7a90d2a..e169a6b 100644 --- a/interface.ccl +++ b/interface.ccl @@ -3,20 +3,17 @@ 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 4b43084..1b0c6cf 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -16,7 +16,6 @@ schedule WaveToyF90_InitSymBound at BASEGRID schedule WaveToyF90_Evolution as WaveToy_Evolution at EVOL { LANG: Fortran - STORAGE: temps } "Evolution of 3D wave equation" diff --git a/src/InitSymBound.F b/src/InitSymBound.F index 3b44602..912f0e2 100644 --- a/src/InitSymBound.F +++ b/src/InitSymBound.F @@ -34,7 +34,6 @@ INTEGER, DIMENSION(3) :: sym = 1 call SetCartSymmetry(cctkGH, sym, 'wavetoy::phi') - call SetCartSymmetry(cctkGH, sym, 'wavetoyf90::phi_tmp') end subroutine WaveToyF90_InitSymbound diff --git a/src/WaveToy.F b/src/WaveToy.F index 27dea4a..24228c4 100644 --- a/src/WaveToy.F +++ b/src/WaveToy.F @@ -42,6 +42,8 @@ CCTK_REAL :: dx2,dy2,dz2,dt2 CCTK_REAL :: dx2i,dy2i,dz2i + CCTK_REAL :: factor + ! Set up shorthands ! ----------------- dx = CCTK_DELTA_SPACE(1) @@ -66,19 +68,19 @@ jend = cctk_lsh(2)-1 kend = cctk_lsh(3)-1 + factor = 2*(1 - (dt2)*(dx2i + dy2i + dz2i)) + ! Do the evolution ! ---------------- do k = kstart, kend do j = jstart, jend do i = istart, iend - phi_tmp(i,j,k) = - 1 2.0*(1.0 - (dt2)*(dx2i + - 2 dy2i + dz2i))*phi(i,j,k) - - 3 phi_old(i,j,k) + (dt2) * - 5 ((phi(i+1,j,k)+phi(i-1,j,k))*dx2i - 6 +(phi(i,j+1,k)+phi(i,j-1,k))*dy2i - 7 +(phi(i,j,k+1)+phi(i,j,k-1))*dz2i) + phi_n(i,j,k) = factor*phi(i,j,k) - + 1 phi_p(i,j,k) + (dt2) * + 2 ((phi(i+1,j,k)+phi(i-1,j,k))*dx2i + 3 +(phi(i,j+1,k)+phi(i,j-1,k))*dy2i + 4 +(phi(i,j,k+1)+phi(i,j,k-1))*dz2i) end do end do @@ -86,18 +88,12 @@ ! Synchronize ! ----------- - call CCTK_SyncGroup(cctkGH,"wavetoyf90::temps") + call CCTK_SyncGroup(cctkGH,"wavetoy::scalarevolve") ! Apply boundary conditions ! ------------------------- call WaveToyF90_Boundaries(CCTK_PASS_FTOF) -! Update timeslices -! ----------------- - phi_old = phi - phi = phi_tmp - - end subroutine WaveToyF90_Evolution @@ -129,13 +125,13 @@ CCTK_REAL,parameter :: zero = 0.0 CCTK_REAL,parameter :: one = 1.0 - call CartSymBCGroup(ierr,cctkGH,"wavetoyf90::temps") + call CartSymBCGroup(ierr,cctkGH,"wavetoy::scalarevolve") if (CCTK_EQUALS(bound,"flat")) then - call FlatBCVar(ierr,cctkGH,sw,"wavetoyf90::phi_tmp") + call FlatBCVar(ierr,cctkGH,sw,"wavetoy::phi") else if (CCTK_EQUALS(bound,"radiation")) then call RadiativeBCVar(ierr,cctkGH,zero,one,sw, - & "wavetoyf90::phi_tmp","wavetoy::phi") + & "wavetoy::phi","wavetoy::phi") end if if (ierr < 0) then diff --git a/test/test_wavetoyf90/phi.dl b/test/test_wavetoyf90/phi.dl index 16493b0..12f574d 100644 --- a/test/test_wavetoyf90/phi.dl +++ b/test/test_wavetoyf90/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_wavetoyf90/phi.xl b/test/test_wavetoyf90/phi.xl index 9bef5dd..55a520c 100644 --- a/test/test_wavetoyf90/phi.xl +++ b/test/test_wavetoyf90/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_wavetoyf90/phi.yl b/test/test_wavetoyf90/phi.yl index 9bef5dd..55a520c 100644 --- a/test/test_wavetoyf90/phi.yl +++ b/test/test_wavetoyf90/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_wavetoyf90/phi_max.tl b/test/test_wavetoyf90/phi_max.tl index 6355b45..7d6d6cf 100644 --- a/test/test_wavetoyf90/phi_max.tl +++ b/test/test_wavetoyf90/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_wavetoyf90/phi_min.tl b/test/test_wavetoyf90/phi_min.tl index c002c48..a1d8579 100644 --- a/test/test_wavetoyf90/phi_min.tl +++ b/test/test_wavetoyf90/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_wavetoyf90/phi_nm1.tl b/test/test_wavetoyf90/phi_nm1.tl index 5ac6c8a..895a3b0 100644 --- a/test/test_wavetoyf90/phi_nm1.tl +++ b/test/test_wavetoyf90/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_wavetoyf90/phi_nm2.tl b/test/test_wavetoyf90/phi_nm2.tl index e9504b4..0fea72d 100644 --- a/test/test_wavetoyf90/phi_nm2.tl +++ b/test/test_wavetoyf90/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 -- cgit v1.2.3