aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@c78560ca-4b45-4335-b268-5f3340f3cb52>2006-05-15 20:04:56 +0000
committerschnetter <schnetter@c78560ca-4b45-4335-b268-5f3340f3cb52>2006-05-15 20:04:56 +0000
commitf0b4af5d17ee11d4333b76ea372653df44a2c572 (patch)
treef7e299fb68bb8c4786799fb1ebe7c8b538797a99
parenta016c8d1372349f113ca59f955011d148ec92f32 (diff)
Add a new manual check to ensure that the coordinate ranges are only
set up once when there is mesh refinement. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/CartGrid3D/trunk@230 c78560ca-4b45-4335-b268-5f3340f3cb52
-rw-r--r--src/CartGrid3D.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/CartGrid3D.c b/src/CartGrid3D.c
index 8cde05e..baf83d8 100644
--- a/src/CartGrid3D.c
+++ b/src/CartGrid3D.c
@@ -71,6 +71,7 @@ void DecodeSymParameters3D(int sym[6]);
@@*/
void CartGrid3D_SetRanges(CCTK_ARGUMENTS)
{
+ static int have_set_up_ranges = 0;
int i, j, k, idx;
int coord_handle, ierr;
CCTK_REAL this_delta[3], origin[3], min1[3], max1[3];
@@ -82,6 +83,16 @@ void CartGrid3D_SetRanges(CCTK_ARGUMENTS)
DECLARE_CCTK_PARAMETERS
+ /* Ranges must be set up only once, and this must happen on the
+ coarse grid. However, the coarse grid itself may not actually
+ exist; in this case, use the coarsest existing grid. We assume
+ that this is the first grid for which this routine is called. */
+ /* TODO: The ranges should be set up once per patch, not once
+ globally. Implement this once the flesh can maintain per-patch
+ coordinate information. */
+ if (have_set_up_ranges) return;
+ have_set_up_ranges = 1;
+
coarse_delta[0] = coarse_dx;
coarse_delta[1] = coarse_dy;
coarse_delta[2] = coarse_dz;