aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@40f6ab95-0e4f-0410-8daa-ee8d7420be1d>2004-02-04 09:57:20 +0000
committerschnetter <schnetter@40f6ab95-0e4f-0410-8daa-ee8d7420be1d>2004-02-04 09:57:20 +0000
commit986e26469db4081d628ac049ff40a2faa707accd (patch)
treed29b2a7d4e31b48e2356a4ca8d3305bb7902c001
parentc74036ca0132e2b92b268a8141576a7bbf457156 (diff)
The number of ghost zones is now per surfaces.
Do more error checking. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SphericalSurface/trunk@6 40f6ab95-0e4f-0410-8daa-ee8d7420be1d
-rw-r--r--src/setup.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/setup.c b/src/setup.c
index fc6420c..f2d5649 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -21,8 +21,10 @@ void SphericalSurfaceInfo_Setup (CCTK_ARGUMENTS)
for (n=0; n<nsurfaces; ++n) {
/* internal consistency checks */
- assert (ntheta[n] >= 3*nghoststheta && ntheta[n] <= maxntheta);
- assert (nphi[n] >= 3*nghostsphi && nphi[n] <= maxnphi);
+ assert (nghoststheta[n] >= 0 && nghoststheta[n] <= maxnghoststheta);
+ assert (nghostsphi[n] >= 0 && nghostsphi[n] <= maxnghostsphi);
+ assert (ntheta[n] >= 3*nghoststheta[n] && ntheta[n] <= maxntheta);
+ assert (nphi[n] >= 3*nghostsphi[n] && nphi[n] <= maxnphi);
@@ -31,14 +33,14 @@ void SphericalSurfaceInfo_Setup (CCTK_ARGUMENTS)
if (symmetric_z[n]) {
/* upper hemisphere: z>=0, theta in (0, pi/2) */
- sf_delta_theta[n] = pi/2 / (ntheta[n] - 2*nghoststheta - 0.5);
- sf_origin_theta[n] = - (nghoststheta - 0.5) * sf_delta_theta[n];
+ sf_delta_theta[n] = pi/2 / (ntheta[n] - 2*nghoststheta[n] - 0.5);
+ sf_origin_theta[n] = - (nghoststheta[n] - 0.5) * sf_delta_theta[n];
} else {
/* both hemispheres: theta in (0, pi) */
- sf_delta_theta[n] = pi / (ntheta[n] - 2*nghoststheta);
- sf_origin_theta[n] = - (nghoststheta - 0.5) * sf_delta_theta[n];
+ sf_delta_theta[n] = pi / (ntheta[n] - 2*nghoststheta[n]);
+ sf_origin_theta[n] = - (nghoststheta[n] - 0.5) * sf_delta_theta[n];
}
@@ -50,32 +52,32 @@ void SphericalSurfaceInfo_Setup (CCTK_ARGUMENTS)
if (symmetric_y[n]) {
/* one quadrant: x>=0, y>=0, phi in [0, pi/2] */
- assert (nphi[n] - 2*nghostsphi >= 1);
- sf_delta_phi[n] = pi/2 / (nphi[n] - 2*nghostsphi - 1);
- sf_origin_phi[n] = - nghostsphi * sf_delta_phi[n];
+ assert (nphi[n] - 2*nghostsphi[n] >= 1);
+ sf_delta_phi[n] = pi/2 / (nphi[n] - 2*nghostsphi[n] - 1);
+ sf_origin_phi[n] = - nghostsphi[n] * sf_delta_phi[n];
} else {
/* two quadrants: x>=0, phi in [-pi/2, pi/2] */
- assert (nphi[n] - 2*nghostsphi >= 2);
- sf_delta_phi[n] = pi / (nphi[n] - 2*nghostsphi - 1);
- sf_origin_phi[n] = - pi/2 - nghostsphi * sf_delta_phi[n];
+ assert (nphi[n] - 2*nghostsphi[n] >= 2);
+ sf_delta_phi[n] = pi / (nphi[n] - 2*nghostsphi[n] - 1);
+ sf_origin_phi[n] = - pi/2 - nghostsphi[n] * sf_delta_phi[n];
}
} else {
if (symmetric_y[n]) {
/* two quadrants: y>=0, phi in [0, pi] */
- assert (nphi[n] - 2*nghostsphi >= 2);
- sf_delta_phi[n] = pi / (nphi[n] - 2*nghostsphi - 1);
- sf_origin_phi[n] = - nghostsphi * sf_delta_phi[n];
+ assert (nphi[n] - 2*nghostsphi[n] >= 2);
+ sf_delta_phi[n] = pi / (nphi[n] - 2*nghostsphi[n] - 1);
+ sf_origin_phi[n] = - nghostsphi[n] * sf_delta_phi[n];
} else {
/* all quadrants: phi in [0, 2pi) */
- assert (nphi[n] - 2*nghostsphi >= 4);
- sf_delta_phi[n] = 2*pi / (nphi[n] - 2*nghostsphi);
- sf_origin_phi[n] = - nghostsphi * sf_delta_phi[n];
+ assert (nphi[n] - 2*nghostsphi[n] >= 4);
+ sf_delta_phi[n] = 2*pi / (nphi[n] - 2*nghostsphi[n]);
+ sf_origin_phi[n] = - nghostsphi[n] * sf_delta_phi[n];
}
}