aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetRegrid
diff options
context:
space:
mode:
authorschnetter <>2002-12-12 13:36:00 +0000
committerschnetter <>2002-12-12 13:36:00 +0000
commiteffff820d40fa8eb7eea522b2a571641c06c2b17 (patch)
tree2539c20ea5f583f347776f6f1f55257b8237ad29 /Carpet/CarpetRegrid
parent53dc93c139b8b78a29ea8a6490e48fbbba835732 (diff)
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
Diffstat (limited to 'Carpet/CarpetRegrid')
-rw-r--r--Carpet/CarpetRegrid/param.ccl12
-rw-r--r--Carpet/CarpetRegrid/src/regrid.cc23
2 files changed, 19 insertions, 16 deletions
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<bool,dim> obp;
+ {
+ DECLARE_CCTK_PARAMETERS;
+ assert (sizeof outside_boundary_points == dim * sizeof (CCTK_INT));
+ obp = outside_boundary_points;
+ }
for (list<ibbox>::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<ibbox>::const_iterator it = bbl.begin();
it != bbl.end();
++it) {
obl.push_back (zip ((vect<bool,2> (*) (bool, bool)) &vect<bool,2>::make,
it->lower() == hh->baseextent.lower(),
it->upper() == hh->baseextent.upper()));
-#if 0
- const vect<bool,dim> lb = it->lower() == hh->baseextent.lower();
- const vect<bool,dim> ub = it->upper() == hh->baseextent.upper();
- bvect bnd;
- for (int d=0; d<dim; ++d) {
- bnd[d][0] = lb[d];
- bnd[d][1] = ub[d];
- }
- obl.push_back (bnd);
-#endif
}
}