diff options
author | allen <allen@7ec00dc9-1e7a-42ad-bf73-a299ee168e72> | 2002-08-21 15:44:38 +0000 |
---|---|---|
committer | allen <allen@7ec00dc9-1e7a-42ad-bf73-a299ee168e72> | 2002-08-21 15:44:38 +0000 |
commit | 4f35fc0adca6bd9134243e246c4061dbf29a6bd6 (patch) | |
tree | 85e5b583ee47761003e9b4f71008bf1722bdd3bc | |
parent | dae5fa26d86e95fd6dfeac089c3418280d83a76f (diff) |
Fixed error setting solution at special case of r=0
Closes Cactus/1085
Also made the gaussian in IDScalarWaveCXX consistent with gaussians in
the other ID thorns, hence new testsuite results.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/IDScalarWaveCXX/trunk@37 7ec00dc9-1e7a-42ad-bf73-a299ee168e72
-rw-r--r-- | src/InitialData.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/InitialData.cc b/src/InitialData.cc index 5e457d8..d5c6682 100644 --- a/src/InitialData.cc +++ b/src/InitialData.cc @@ -83,8 +83,17 @@ extern "C" void IDScalarWaveCXX_InitialData(CCTK_ARGUMENTS) CCTK_REAL R = sqrt(X*X + Y*Y + Z*Z); phi[index] = amplitude*exp( - sqr( (R - radius) / sigma ) ); - phi_p[index] = amplitude*exp( - sqr( (R - radius - dt) / sigma ) ); - + if (R == 0.0) + { + phi_p[index] = amplitude*(1.0 - 2.0*dt*dt/sigma)*exp(-dt*dt/sigma); + } + else + { + phi_p[index] = amplitude/2.0*(R-dt)/R* + exp( - sqr( (R - radius - dt)/ sigma ) ) + + amplitude/2.0*(R+dt)/R* + exp( - sqr( (R - radius + dt)/ sigma ) ); + } } } } |