aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Carpet/Carpet/param.ccl4
-rw-r--r--Carpet/CarpetLib/src/dh.cc18
-rw-r--r--Carpet/CarpetLib/src/dh.hh10
3 files changed, 25 insertions, 7 deletions
diff --git a/Carpet/Carpet/param.ccl b/Carpet/Carpet/param.ccl
index 5970b688e..b0f4b8428 100644
--- a/Carpet/Carpet/param.ccl
+++ b/Carpet/Carpet/param.ccl
@@ -202,6 +202,10 @@ CCTK_INT additional_buffer_zones "Additional buffer zones"
*:* :: ""
} 0
+BOOLEAN use_buffer2_zones "Use buffer2 zones"
+{
+} "no"
+
BOOLEAN use_tapered_grids "Use tapered grids, avoiding time interpolation during evolution"
{
} "no"
diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc
index 337490ab7..a01f82278 100644
--- a/Carpet/CarpetLib/src/dh.cc
+++ b/Carpet/CarpetLib/src/dh.cc
@@ -71,20 +71,26 @@ init_fast_ref_refl_sendrecv ()
// Constructors
dh::
dh (gh & h_,
- vector<i2vect> const & ghost_widths_, vector<i2vect> const & buffer_widths_,
+ vector<i2vect> const & ghost_widths_,
+ vector<i2vect> const & buffer_widths_,
+ vector<i2vect> const & buffer2_widths_,
vector<int> const & prolongation_orders_space_)
: h(h_),
- ghost_widths(ghost_widths_), buffer_widths(buffer_widths_),
+ ghost_widths(ghost_widths_),
+ buffer_widths(buffer_widths_),
+ buffer2_widths(buffer2_widths_),
prolongation_orders_space(prolongation_orders_space_)
{
fast_dboxes::init_fast_ref_refl_sendrecv();
size_t const maxreflevels = h.reffacts.size();
assert (ghost_widths.size() >= maxreflevels);
assert (buffer_widths.size() >= maxreflevels);
+ assert (buffer2_widths.size() >= maxreflevels);
assert (prolongation_orders_space.size() >= maxreflevels);
for (size_t rl=0; rl<maxreflevels; ++rl) {
assert (all (all (ghost_widths.AT(rl) >= 0)));
assert (all (all (buffer_widths.AT(rl) >= 0)));
+ assert (all (all (buffer2_widths.AT(rl) >= 0)));
assert (prolongation_orders_space.AT(rl) >= 0);
}
@@ -284,6 +290,7 @@ regrid (bool const do_init)
i2vect const& ghost_width = ghost_widths.AT(rl);
i2vect const& buffer_width = buffer_widths.AT(rl);
+ i2vect const& buffer2_width = buffer2_widths.AT(rl);
@@ -969,11 +976,14 @@ regrid (bool const do_init)
ibbox const& odomext = h.baseextent(ml,orl);
// Refinement restriction may fill all coarse interior points,
- // and must use all fine active points
+ // and must use all fine active points that are not buffer2
+ // points
ibset allrestricted;
switch (h.refcent) {
case vertex_centered:
+ // TODO: support this
+ assert (all (all (buffer2_width == 0)));
allrestricted = allactive.contracted_for(odomext);
break;
case cell_centered: {
@@ -984,7 +994,7 @@ regrid (bool const do_init)
ibset const tmp0 = source;
ibset const tmp1 = tmp0.expanded_for(target);
ibset const tmp2 = all_target - tmp1;
- ibset const tmp3 = tmp2.expand(1,1);
+ ibset const tmp3 = tmp2.expand(1,1).expand(buffer2_width);
ibset const tmp4 = all_target - tmp3;
allrestricted = tmp4;
// cout << "source=" << source << "\n"
diff --git a/Carpet/CarpetLib/src/dh.hh b/Carpet/CarpetLib/src/dh.hh
index 3a7a3294a..7a2282fba 100644
--- a/Carpet/CarpetLib/src/dh.hh
+++ b/Carpet/CarpetLib/src/dh.hh
@@ -18,6 +18,7 @@
using namespace std;
#define CARPET_HAVE_BUFFER_WIDTHS
+#define CARPET_HAVE_BUFFER2_WIDTHS
// Forward declaration
class ggf;
@@ -217,8 +218,9 @@ public: // should be readonly
i2vect buffer_width; // number of buffer zones
int prolongation_order_space; // order of spatial prolongation operator
#endif
- vector<i2vect> ghost_widths; // number of ghost zones [rl]
- vector<i2vect> buffer_widths; // number of buffer zones [rl]
+ vector<i2vect> ghost_widths; // number of ghost zones [rl]
+ vector<i2vect> buffer_widths; // number of buffer zones [rl]
+ vector<i2vect> buffer2_widths; // number of2 buffer zones [rl]
vector<int> prolongation_orders_space; // order of spatial
// prolongation operator [rl]
@@ -233,7 +235,9 @@ public:
// Constructors
dh (gh & h,
- vector<i2vect> const & ghost_widths, vector<i2vect> const & buffer_widths,
+ vector<i2vect> const & ghost_widths,
+ vector<i2vect> const & buffer_widths,
+ vector<i2vect> const & buffer2_widths,
vector<int> const & prolongation_orders_space);
// Destructors