aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallen <allen@f5a6acaf-da7d-456b-b0a8-35edbc60b392>2001-12-04 20:50:45 +0000
committerallen <allen@f5a6acaf-da7d-456b-b0a8-35edbc60b392>2001-12-04 20:50:45 +0000
commitef3600aa5b1480f5cdde8b1eabd32adf130bf79d (patch)
tree5d0364a9a624abad6932d3c7f3bca54a88e9f252
parent33550b63f53172ab1e58319e3cd902439495311e (diff)
Changing Gaussian initial data for the scalar wave equation to be time symmetric
Unfortunately changes all testsuites. git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/IDScalarWave/trunk@49 f5a6acaf-da7d-456b-b0a8-35edbc60b392
-rw-r--r--src/InitialData.F7735
1 files changed, 19 insertions, 16 deletions
diff --git a/src/InitialData.F77 b/src/InitialData.F77
index fc90ac3..d3af842 100644
--- a/src/InitialData.F77
+++ b/src/InitialData.F77
@@ -37,6 +37,7 @@
INTEGER i,j,k
CCTK_REAL dt,omega, pi
+ CCTK_REAL xp,yp,zp,rp
pi = 4.0*atan(1.0)
@@ -65,12 +66,24 @@
do j=1, cctk_lsh(2)
do i=1, cctk_lsh(1)
- phi(i,j,k) = amplitude*exp(
- & -(sqrt(x(i,j,k)**2
- & +y(i,j,k)**2+z(i,j,k)**2)-radius)**2/sigma**2)
- phi_p(i,j,k) = amplitude*exp(
- & -(sqrt(x(i,j,k)**2
- & +y(i,j,k)**2+z(i,j,k)**2)-radius-dt)**2/sigma**2)
+ xp=x(i,j,k)
+ yp=y(i,j,k)
+ zp=z(i,j,k)
+
+ rp = sqrt(xp*xp+yp*yp+zp*zp)
+
+ phi(i,j,k) = amplitude*exp(-(rp-radius)**2/sigma**2)
+ phi_p(i,j,k) = amplitude/2.0*(rp-dt)/rp*
+ & exp( - ( (rp-radius-dt)/sigma)**2 )
+ & + amplitude/2.0*(rp+dt)/rp*
+ & exp( - ( (rp-radius+dt)/sigma)**2 )
+
+
+c phi_p[index] = amplitude/2.0*(R-dt)/R*
+c exp( - sqr( (R - radius - dt)/ sigma ) )
+c + amplitude/2.0*(R+dt)/R*
+c exp( - sqr( (R - radius + dt)/ sigma ) )
+c ;
end do
end do
@@ -112,16 +125,6 @@ c Use kx,ky,kz as number of modes in each direction.
end if
-c zero out corners of phi next */
-c phi_n(1, 1, 1) = 0.0
-c phi_n(1, 1, cctk_lsh(3)) = 0.0
-c phi_n(1, cctk_lsh(2), 1) = 0.0
-c phi_n(1, cctk_lsh(2), cctk_lsh(3)) = 0.0
-c phi_n(cctk_lsh(1), 1, 1) = 0.0
-c phi_n(cctk_lsh(1), 1, cctk_lsh(3)) = 0.0
-c phi_n(cctk_lsh(1), cctk_lsh(2), 1) = 0.0
-c phi_n(cctk_lsh(1), cctk_lsh(2), cctk_lsh(3)) = 0.0
-
return
end