aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-08-25 12:02:00 -0400
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 18:21:20 +0000
commitf264200d9d15cd29124d3d286b751af4b2b811da (patch)
treea9c451331d570991406317a7526b55999381546e /Carpet
parentaa7aa644f6b2ca763ebddf5005acb1ef4476e5d6 (diff)
CarpetLib: Add refluxing function to ggf class
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetLib/src/ggf.cc24
-rw-r--r--Carpet/CarpetLib/src/ggf.hh4
2 files changed, 28 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc
index 02b90bc38..4c5d64a2d 100644
--- a/Carpet/CarpetLib/src/ggf.cc
+++ b/Carpet/CarpetLib/src/ggf.cc
@@ -487,6 +487,26 @@ ref_prolongate_all (comm_state & state,
+// Reflux a refinement level
+void
+ggf::
+ref_reflux_all (comm_state & state,
+ int const tl, int const rl, int const ml,
+ int const dir, int const face)
+{
+ // Ignore the transport operator
+ static Timer timer ("ref_reflux_all");
+ timer.start ();
+
+ transfer_from_all (state,
+ tl,rl+1,ml,
+ dh::fast_dboxes::fast_ref_refl_sendrecv[dir][face],
+ tl,rl,ml);
+ timer.stop (0);
+}
+
+
+
// Transfer regions of all components
void
ggf::
@@ -549,6 +569,10 @@ transfer_from_all (comm_state & state,
pseudoregion_t const & precv = (* ipsendrecv).recv;
ibbox const & send = psend.extent;
ibbox const & recv = precv.extent;
+ assert (send.is_aligned_with(h.baseextent(ml2,rl2)));
+ assert (recv.is_aligned_with(h.baseextent(ml1,rl1)));
+ // assert (all (send.stride() == h.baseextent(ml2,rl2).stride()));
+ // assert (all (recv.stride() == h.baseextent(ml1,rl1).stride()));
int const c2 = psend.component;
int const c1 = precv.component;
int const lc2 = h.get_local_component(rl2,c2);
diff --git a/Carpet/CarpetLib/src/ggf.hh b/Carpet/CarpetLib/src/ggf.hh
index 3badcff14..d9412f822 100644
--- a/Carpet/CarpetLib/src/ggf.hh
+++ b/Carpet/CarpetLib/src/ggf.hh
@@ -143,6 +143,10 @@ public:
// Prolongate a refinement level
void ref_prolongate_all (comm_state& state,
int tl, int rl, int ml, CCTK_REAL time);
+
+ // Reflux a refinement level
+ void ref_reflux_all (comm_state& state,
+ int tl, int rl, int ml, int dir, int face);