aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetRegrid/src/automatic.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-05-01 20:50:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-05-01 20:50:00 +0000
commit11ac382474368f028c892b391975f53a8ac57759 (patch)
tree55827438fa69d0ce9ef5defae73eeecdc545335a /Carpet/CarpetRegrid/src/automatic.cc
parent0fbb3fc20f36bce10eb1f92921a3f947abef3c99 (diff)
global: Add varying refinement factors
Add support for varying refinement factors. The spatial refinement factors can be different in different directions, can be different from the time refinement factor, and can be different on each level. (However, the underlying spatial transport operators do currently not handle any factors except two.) darcs-hash:20050501205010-891bb-8d3a74abaad55ee6c77ef18d51fca2a2b69740de.gz
Diffstat (limited to 'Carpet/CarpetRegrid/src/automatic.cc')
-rw-r--r--Carpet/CarpetRegrid/src/automatic.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/Carpet/CarpetRegrid/src/automatic.cc b/Carpet/CarpetRegrid/src/automatic.cc
index 987ef133b..82dbd5796 100644
--- a/Carpet/CarpetRegrid/src/automatic.cc
+++ b/Carpet/CarpetRegrid/src/automatic.cc
@@ -111,6 +111,9 @@ namespace CarpetRegrid {
const int tl = 0;
const int ml = 0;
+ // Determine refinement factor
+ ivect const reffact = spacereffacts.at(rl+1) / spacereffacts.at(rl);
+
if (veryverbose) {
cout << endl << "MRA: Choosing regions to refine on level " << rl << " in " << hh.components(rl) << " components" << endl;
}
@@ -122,7 +125,7 @@ namespace CarpetRegrid {
const data<CCTK_REAL>& errordata = *errorgf(tl,rl,c,ml);
- Automatic_Recursive (cctkGH, hh, errordata, bbl, region);
+ Automatic_Recursive (cctkGH, hh, errordata, bbl, region, reffact);
}
if (veryverbose) {
@@ -167,7 +170,8 @@ namespace CarpetRegrid {
const gh & hh,
const data<CCTK_REAL> & errordata,
list<ibbox> & bbl,
- const ibbox & region)
+ const ibbox & region,
+ const ivect & reffact)
{
DECLARE_CCTK_PARAMETERS;
@@ -202,7 +206,7 @@ namespace CarpetRegrid {
if (cnt == 0) {
// Don't refine
- } else if (width*reffact < 2*minwidth or fraction >= minfraction) {
+ } else if (any (reffact*width < 2*minwidth) or fraction >= minfraction) {
// Refine the whole region
const ivect lo(region.lower());
const ivect up(region.upper());
@@ -231,8 +235,8 @@ namespace CarpetRegrid {
assert ((region1 & region2).empty());
assert (region1 + region2 == region);
list<ibbox> bbl1, bbl2;
- Automatic_Recursive (cctkGH, hh, errordata, bbl1, region1);
- Automatic_Recursive (cctkGH, hh, errordata, bbl2, region2);
+ Automatic_Recursive (cctkGH, hh, errordata, bbl1, region1, reffact);
+ Automatic_Recursive (cctkGH, hh, errordata, bbl2, region2, reffact);
// Combine regions if possible
up2 += str-str/reffact;
up2[dir] = lo2[dir];