From 168a3c0a7f89b9ec54504e47c18dd0ca7bcb6940 Mon Sep 17 00:00:00 2001 From: goodale Date: Wed, 29 Mar 2000 07:42:21 +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/WaveToyF77/trunk@50 4451c3c6-1034-4891-99ea-21147727ccdf --- interface.ccl | 11 ++--- schedule.ccl | 1 - src/InitSymBound.F77 | 1 - src/WaveToy.F77 | 33 +++++---------- test/test_wavetoyf77/phi.dl | 4 +- test/test_wavetoyf77/phi.xl | 92 ++++++++++++++++++++--------------------- test/test_wavetoyf77/phi.yl | 92 ++++++++++++++++++++--------------------- test/test_wavetoyf77/phi_max.tl | 6 +-- test/test_wavetoyf77/phi_min.tl | 2 +- test/test_wavetoyf77/phi_nm1.tl | 10 ++--- test/test_wavetoyf77/phi_nm2.tl | 4 +- 11 files changed, 120 insertions(+), 136 deletions(-) diff --git a/interface.ccl b/interface.ccl index 1237dc6..29fcba4 100644 --- a/interface.ccl +++ b/interface.ccl @@ -3,21 +3,18 @@ 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 scalartmps type = GF -{ - phi_next -} "Temporary GFs for WaveToy" - diff --git a/schedule.ccl b/schedule.ccl index cdb0fd1..998985a 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -16,7 +16,6 @@ schedule WaveToyF77_InitSymBound at BASEGRID schedule WaveToyF77_Evolution as WaveToy_Evolution at EVOL { LANG: Fortran - STORAGE: scalartmps } "Evolution of 3D wave equation" diff --git a/src/InitSymBound.F77 b/src/InitSymBound.F77 index 423b35c..cf5c2b4 100644 --- a/src/InitSymBound.F77 +++ b/src/InitSymBound.F77 @@ -40,7 +40,6 @@ sym(3) = one call SetCartSymmetry(cctkGH, sym,'wavetoy::phi') - call SetCartSymmetry(cctkGH, sym,'wavetoyf77::phi_next') return end diff --git a/src/WaveToy.F77 b/src/WaveToy.F77 index 6130447..98d21be 100644 --- a/src/WaveToy.F77 +++ b/src/WaveToy.F77 @@ -45,6 +45,8 @@ c Declare variables in argument list CCTK_REAL dx2,dy2,dz2,dt2 CCTK_REAL dx2i,dy2i,dz2i + CCTK_REAL factor + c Set up shorthands c ----------------- dx = CCTK_DELTA_SPACE(1) @@ -69,16 +71,16 @@ c ----------------- jend = cctk_lsh(2)-1 kend = cctk_lsh(3)-1 + factor = 2*(1 - (dt2)*(dx2i + dy2i + dz2i)) + c Do the evolution c ---------------- do k = kstart, kend do j = jstart, jend do i = istart, iend - phi_next(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) @@ -89,25 +91,12 @@ c ---------------- c Synchronize c ----------- - call CCTK_SyncGroup(cctkGH,"wavetoyf77::scalartmps") + call CCTK_SyncGroup(cctkGH,"wavetoy::scalarevolve") c Apply boundary conditions c ------------------------- call WaveToyF77_Boundaries(CCTK_PASS_FTOF) -c Update timeslices -c ----------------- - do k = 1, cctk_lsh(3) - do j = 1, cctk_lsh(2) - do i = 1, cctk_lsh(1) - - phi_old(i,j,k) = phi(i,j,k) - phi(i,j,k) = phi_next(i,j,k) - - end do - end do - end do - return end @@ -155,16 +144,16 @@ c --------------------- c Apply the symmetry boundary conditions on any coordinate axes c ------------------------------------------------------------- - call CartSymBCGroup(ierr,cctkGH,"wavetoyf77::scalartmps") + call CartSymBCGroup(ierr,cctkGH,"wavetoy::scalarevolve") c Apply the outer boundary conditions c ----------------------------------- if (CCTK_EQUALS(bound,"flat")) then - call FlatBCVar(ierr,cctkGH,sw,"wavetoyf77::phi_next") + call FlatBCVar(ierr,cctkGH,sw,"wavetoy::phi") else if (CCTK_EQUALS(bound,"zero")) then - call ConstantBCVar(ierr,cctkGH,zero,sw,"wavetoyf77::phi_next") + call ConstantBCVar(ierr,cctkGH,zero,sw,"wavetoy::phi") else if (CCTK_Equals(bound,"radiation").eq.1) then - call RadiativeBCVar(ierr,cctkGH,zero,one,sw,"wavetoyf77::phi_next", + call RadiativeBCVar(ierr,cctkGH,zero,one,sw,"wavetoy::phi", & "wavetoy::phi") end if diff --git a/test/test_wavetoyf77/phi.dl b/test/test_wavetoyf77/phi.dl index 16493b0..12f574d 100644 --- a/test/test_wavetoyf77/phi.dl +++ b/test/test_wavetoyf77/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_wavetoyf77/phi.xl b/test/test_wavetoyf77/phi.xl index 9bef5dd..55a520c 100644 --- a/test/test_wavetoyf77/phi.xl +++ b/test/test_wavetoyf77/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_wavetoyf77/phi.yl b/test/test_wavetoyf77/phi.yl index 9bef5dd..55a520c 100644 --- a/test/test_wavetoyf77/phi.yl +++ b/test/test_wavetoyf77/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_wavetoyf77/phi_max.tl b/test/test_wavetoyf77/phi_max.tl index 6355b45..7d6d6cf 100644 --- a/test/test_wavetoyf77/phi_max.tl +++ b/test/test_wavetoyf77/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_wavetoyf77/phi_min.tl b/test/test_wavetoyf77/phi_min.tl index c002c48..a1d8579 100644 --- a/test/test_wavetoyf77/phi_min.tl +++ b/test/test_wavetoyf77/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_wavetoyf77/phi_nm1.tl b/test/test_wavetoyf77/phi_nm1.tl index 5ac6c8a..895a3b0 100644 --- a/test/test_wavetoyf77/phi_nm1.tl +++ b/test/test_wavetoyf77/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_wavetoyf77/phi_nm2.tl b/test/test_wavetoyf77/phi_nm2.tl index e9504b4..0fea72d 100644 --- a/test/test_wavetoyf77/phi_nm2.tl +++ b/test/test_wavetoyf77/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