aboutsummaryrefslogtreecommitdiff
path: root/src/radius.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/radius.c')
-rw-r--r--src/radius.c6
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);
}
}