diff options
author | goodale <goodale@f80f6fb6-8356-4fd4-90bc-d84ad503c100> | 2000-03-29 07:42:23 +0000 |
---|---|---|
committer | goodale <goodale@f80f6fb6-8356-4fd4-90bc-d84ad503c100> | 2000-03-29 07:42:23 +0000 |
commit | acd7a42b3d1301a3f94121f15f5740113e49e74a (patch) | |
tree | 3556d92921d142e91cdc33847cf286ecd921d18a /src | |
parent | ca7c92c9a2b58b255d484e6c4b0c7488b1965dc0 (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/WaveToyF90/trunk@42 f80f6fb6-8356-4fd4-90bc-d84ad503c100
Diffstat (limited to 'src')
-rw-r--r-- | src/InitSymBound.F | 1 | ||||
-rw-r--r-- | src/WaveToy.F | 30 |
2 files changed, 13 insertions, 18 deletions
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 |