From f264200d9d15cd29124d3d286b751af4b2b811da Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 25 Aug 2010 12:02:00 -0400 Subject: CarpetLib: Add refluxing function to ggf class --- Carpet/CarpetLib/src/ggf.cc | 24 ++++++++++++++++++++++++ Carpet/CarpetLib/src/ggf.hh | 4 ++++ 2 files changed, 28 insertions(+) (limited to 'Carpet') 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); -- cgit v1.2.3