From effff820d40fa8eb7eea522b2a571641c06c2b17 Mon Sep 17 00:00:00 2001 From: schnetter <> Date: Thu, 12 Dec 2002 13:36:00 +0000 Subject: Introduced a new parameter "outside_boundary_points". It decides Introduced a new parameter "outside_boundary_points". It decides whether points on the fine grid that abutt the outer boundary are allowed to be outside the coarse grid outer boundary. This is necessary for periodicity. darcs-hash:20021212133606-07bb3-3983646ef2ae684dd8a63c7a3c8b0793db93759f.gz --- Carpet/CarpetRegrid/param.ccl | 12 ++++++++++-- Carpet/CarpetRegrid/src/regrid.cc | 23 +++++++++-------------- 2 files changed, 19 insertions(+), 16 deletions(-) (limited to 'Carpet/CarpetRegrid') diff --git a/Carpet/CarpetRegrid/param.ccl b/Carpet/CarpetRegrid/param.ccl index 975f485bb..b8f59c034 100644 --- a/Carpet/CarpetRegrid/param.ccl +++ b/Carpet/CarpetRegrid/param.ccl @@ -1,5 +1,5 @@ # Parameter definitions for thorn CarpetRegrid -# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetRegrid/param.ccl,v 1.9 2002/08/28 09:53:39 schnetter Exp $ +# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetRegrid/param.ccl,v 1.10 2002/12/12 14:36:06 schnetter Exp $ @@ -24,6 +24,14 @@ CCTK_INT activate_newlevels_on_regrid "When regridding, activate this many new l : :: "Number of new levels to activate. Negative numbers mean to de-activate" } 0 + + +BOOLEAN outside_boundary_points[3] "On finer grids, where the upper grid boundary is adjacent to the outer boundary, put points outside the outer boundary (needed e.g. for periodicity)" +{ +} "no" + + + KEYWORD refined_regions "Regions where the grid is refined" STEERABLE=always { "none" :: "Don't refine" @@ -256,7 +264,7 @@ CCTK_REAL maxerror "Maximum allowed error for non-refined grid points" STEERABLE *:* :: "everything goes" } 1.0 -STRING errorvar "Name of grid function that contains the error" STEERABLE=always +CCTK_STRING errorvar "Name of grid function that contains the error" STEERABLE=always { ".*" :: "must be the name of a grid function" } "" diff --git a/Carpet/CarpetRegrid/src/regrid.cc b/Carpet/CarpetRegrid/src/regrid.cc index 675ad4f46..b2a4c90e8 100644 --- a/Carpet/CarpetRegrid/src/regrid.cc +++ b/Carpet/CarpetRegrid/src/regrid.cc @@ -24,7 +24,7 @@ #include "regrid.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetRegrid/src/regrid.cc,v 1.19 2002/12/12 13:00:11 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetRegrid/src/regrid.cc,v 1.20 2002/12/12 14:36:06 schnetter Exp $"; CCTK_FILEVERSION(Carpet_CarpetRegrid_regrid_cc); } @@ -713,32 +713,27 @@ namespace CarpetRegrid { // cout << "MRA: Chose " << bbl.size() << " regions with a total size of " << numpoints << " to refine." << endl << endl; // Remove grid points outside the outer boundary + vect obp; + { + DECLARE_CCTK_PARAMETERS; + assert (sizeof outside_boundary_points == dim * sizeof (CCTK_INT)); + obp = outside_boundary_points; + } for (list::iterator it = bbl.begin(); it != bbl.end(); ++it) { - const ivect ub = min (it->upper(), hh->baseextent.upper()); + const ivect ub = obp.ifthen (it->upper(), + min (it->upper(), hh->baseextent.upper())); *it = ibbox(it->lower(), ub, it->stride()); } // Create obl from bbl - // TODO: create obl depending on the boundary position - // (at or close to the boundary) for (list::const_iterator it = bbl.begin(); it != bbl.end(); ++it) { obl.push_back (zip ((vect (*) (bool, bool)) &vect::make, it->lower() == hh->baseextent.lower(), it->upper() == hh->baseextent.upper())); -#if 0 - const vect lb = it->lower() == hh->baseextent.lower(); - const vect ub = it->upper() == hh->baseextent.upper(); - bvect bnd; - for (int d=0; d