aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorschnetter <>2002-12-12 15:49:00 +0000
committerschnetter <>2002-12-12 15:49:00 +0000
commitdd795b632a3db6fda5337a12f0f3fe273cabab71 (patch)
treea5fe02f1c47049da8b3718778aa81ea56c392e5b /Carpet
parent7e6c0199ec7b5146c196aa7eb50543f3a0a1adf0 (diff)
bboxset.hh: Added new function "setsize" to the bboxset class. It
bboxset.hh: Added new function "setsize" to the bboxset class. It returns how many bounding boxes are in the set. dh.cc: Restrict to a smaller region. Exclude those points that are necessary to prolongate to the boundaries. Restrict.cc: Don't prolongate the boundaries after restricting. darcs-hash:20021212154955-07bb3-cbd598a3c35120a286278e50c6fde61c8b2c6a66.gz
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/Carpet/src/Restrict.cc4
-rw-r--r--Carpet/CarpetLib/src/bboxset.hh3
-rw-r--r--Carpet/CarpetLib/src/dh.cc43
3 files changed, 33 insertions, 17 deletions
diff --git a/Carpet/Carpet/src/Restrict.cc b/Carpet/Carpet/src/Restrict.cc
index e545f7ca4..28eac5dcc 100644
--- a/Carpet/Carpet/src/Restrict.cc
+++ b/Carpet/Carpet/src/Restrict.cc
@@ -10,7 +10,7 @@
#include "carpet.hh"
extern "C" {
- static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Restrict.cc,v 1.11 2002/10/24 10:39:38 schnetter Exp $";
+ static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Restrict.cc,v 1.12 2002/12/12 16:49:55 schnetter Exp $";
CCTK_FILEVERSION(Carpet_Carpet_Restrict_cc);
}
@@ -67,6 +67,7 @@ namespace Carpet {
arrdata[group].data[var]->sync (tl, reflevel, c, mglevel);
}
+#if 0
for (int c=0; c<arrdata[group].hh->components(reflevel+1); ++c) {
arrdata[group].data[var]->ref_bnd_prolongate
(tl, reflevel+1, c, mglevel, time);
@@ -75,6 +76,7 @@ namespace Carpet {
for (int c=0; c<arrdata[group].hh->components(reflevel+1); ++c) {
arrdata[group].data[var]->sync (tl, reflevel+1, c, mglevel);
}
+#endif
} // if not finest refinement level
diff --git a/Carpet/CarpetLib/src/bboxset.hh b/Carpet/CarpetLib/src/bboxset.hh
index 11435d0e1..9d43d8c82 100644
--- a/Carpet/CarpetLib/src/bboxset.hh
+++ b/Carpet/CarpetLib/src/bboxset.hh
@@ -5,7 +5,7 @@
copyright : (C) 2000 by Erik Schnetter
email : schnetter@astro.psu.edu
- $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bboxset.hh,v 1.8 2002/05/05 22:16:59 schnetter Exp $
+ $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bboxset.hh,v 1.9 2002/12/12 16:49:55 schnetter Exp $
***************************************************************************/
@@ -85,6 +85,7 @@ public:
// Accessors
bool empty () const { return bs.empty(); }
T size () const;
+ int setsize () const { return bs.size(); }
// Add (bboxes that don't overlap)
bboxset& operator+= (const box& b);
diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc
index 2239cd44f..3023b9c31 100644
--- a/Carpet/CarpetLib/src/dh.cc
+++ b/Carpet/CarpetLib/src/dh.cc
@@ -6,7 +6,7 @@
copyright : (C) 2000 by Erik Schnetter
email : schnetter@astro.psu.edu
- $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.cc,v 1.22 2002/10/24 11:36:34 schnetter Exp $
+ $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.cc,v 1.23 2002/12/12 16:49:55 schnetter Exp $
***************************************************************************/
@@ -143,7 +143,7 @@ void dh<D>::recompose () {
boxes[rl][c ][ml].recv_sync[cc].push_back(*b);
boxes[rl][cc][ml].send_sync[c ].push_back(*b);
}
- }
+ } // for cc
// Multigrid boxes
if (ml>0) {
@@ -169,23 +169,13 @@ void dh<D>::recompose () {
boxes[rl][c][ml-1].recv_mg_coarse.push_back(recv);
boxes[rl][c][ml ].send_mg_fine .push_back(send);
}
- }
+ } // if not finest multigrid level
// Refinement boxes
if (rl<h.reflevels()-1) {
for (int cc=0; cc<h.components(rl+1); ++cc) {
const ibbox intrf = boxes[rl+1][cc][ml].interior;
// const ibbox extrf = boxes[rl+1][cc][ml].exterior;
- // Restriction (interior)
- {
- // (the restriction may fill the interior of the of the
- // coarse grid, and may use the interior of the fine
- // grid, and the bbox must be as large as possible)
- const ibbox recv = intrf.contracted_for(intr) & intr;
- const ibbox send = recv.expanded_for(intrf);
- boxes[rl+1][cc][ml].send_ref_coarse[c ].push_back(send);
- boxes[rl ][c ][ml].recv_ref_fine [cc].push_back(recv);
- }
// Prolongation (interior)
{
// (the prolongation may use the exterior of the coarse
@@ -216,9 +206,32 @@ void dh<D>::recompose () {
boxes[rl ][c ][ml].send_ref_bnd_fine [cc].push_back(send);
}
}
+ // Restriction (interior)
+ {
+ // (the restriction may fill the interior of the of the
+ // coarse grid, and may use the interior of the fine
+ // grid, and the bbox must be as large as possible)
+ // (the restriction must not fill points that are used
+ // to prolongate the boundaries)
+ const ibbox recv = intrf.contracted_for(intr) & intr;
+
+ const iblist& sendlist = boxes[rl][c][ml].send_ref_bnd_fine[cc];
+ ibset recv2s (recv);
+ for (iblist::const_iterator sli = sendlist.begin();
+ sli != sendlist.end();
+ ++sli) {
+ recv2s -= *sli;
+ }
+ assert (recv2s.setsize() == 1);
+ const ibbox recv2 = *recv2s.begin();
+// const ibbox send = recv.expanded_for(intrf);
+ const ibbox send = recv2.expanded_for(intrf);
+ boxes[rl+1][cc][ml].send_ref_coarse[c ].push_back(send);
+ boxes[rl ][c ][ml].recv_ref_fine [cc].push_back(recv);
+ }
- }
- }
+ } // for cc
+ } // if not finest refinement level
} // for ml
} // for c