diff options
author | schnetter <schnetter@40f6ab95-0e4f-0410-8daa-ee8d7420be1d> | 2006-08-21 14:18:45 +0000 |
---|---|---|
committer | schnetter <schnetter@40f6ab95-0e4f-0410-8daa-ee8d7420be1d> | 2006-08-21 14:18:45 +0000 |
commit | f0428118d714b53c364fd42b5c8fd0ed102e99b0 (patch) | |
tree | f1185e936195d4a666f1e4c214f56b24e12cc6e4 | |
parent | 01e1326a8b8bb1b0ec21a25f4c08b825e4ad8e15 (diff) |
Correct error in setting surface radii when the parameters
set_spherical or set_elliptic are used.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SphericalSurface/trunk@24 40f6ab95-0e4f-0410-8daa-ee8d7420be1d
-rw-r--r-- | src/radius.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/radius.c b/src/radius.c index 102ae1d..0356259 100644 --- a/src/radius.c +++ b/src/radius.c @@ -69,7 +69,8 @@ void SphericalSurface_Set (CCTK_ARGUMENTS) for (j=0; j<nphi[n]; ++j) { for (i=0; i<ntheta[n]; ++i) { - sf_radius[n] = radius[n]; + int const ind = i + maxntheta * (j + maxnphi * n); + sf_radius[ind] = radius[n]; } } @@ -131,12 +132,13 @@ void SphericalSurface_Set (CCTK_ARGUMENTS) for (j=0; j<nphi[n]; ++j) { for (i=0; i<ntheta[n]; ++i) { + int const ind = i + maxntheta * (j + maxnphi * n); CCTK_REAL const theta = sf_origin_theta[n] + i * sf_delta_theta[n]; CCTK_REAL const phi = sf_origin_phi[n] + j * sf_delta_phi[n]; CCTK_REAL const x2 = pow (sin(theta) * cos(phi), 2); CCTK_REAL const y2 = pow (sin(theta) * sin(phi), 2); CCTK_REAL const z2 = pow (cos(theta) , 2); - sf_radius[n] = 1.0 / sqrt (x2 / rx2 + y2 / ry2 + z2 / rz2); + sf_radius[ind] = 1.0 / sqrt (x2 / rx2 + y2 / ry2 + z2 / rz2); } } |