aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/dh.cc
diff options
context:
space:
mode:
authoreschnett <>2001-03-10 19:54:00 +0000
committereschnett <>2001-03-10 19:54:00 +0000
commit221dcbf0bd2211f5bd64dcf6bd5560765f91a101 (patch)
treefe9a01ca3c2dea72092af7731244e25453acc607 /Carpet/CarpetLib/src/dh.cc
parentbf79e13766e3d17d8614f7b662bdc46a45e54b03 (diff)
Carpet now passes the Cart3d test suite. This required a rewrite of
Carpet now passes the Cart3d test suite. This required a rewrite of CarpetSlabe, which now uses the data<> class instead of doing things its own way. This in turn required some updates to data<>. CarpetSlab now ignores (i. e. does not use) boundaries, except outer boundaries. For that to work, the dh<> class has been given the notion of an outer boundary. In order to increase performance, the cctk_bbox[] information in Carpet is not set correctly. As an approximation, it just reflects whether the current grid component lies at the outer boundary, as calculated using cctk_lbnd, cctk_ubnd, and cctk_gsh. darcs-hash:20010310195459-f6438-8ee874d722de4df717e5eb3002722ceb8d4a9bb7.gz
Diffstat (limited to 'Carpet/CarpetLib/src/dh.cc')
-rw-r--r--Carpet/CarpetLib/src/dh.cc40
1 files changed, 35 insertions, 5 deletions
diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc
index 5dc7ba0e7..756f37cad 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.3 2001/03/07 13:00:57 eschnett Exp $
+ $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.cc,v 1.4 2001/03/10 20:55:06 eschnett Exp $
***************************************************************************/
@@ -66,18 +66,18 @@ void dh<D>::recompose () {
boxes[rl][c].resize(h.mglevels(rl,c));
for (int ml=0; ml<h.mglevels(rl,c); ++ml) {
const ibbox intr = h.extents[rl][c][ml];
-
+
// Interior
// (the interior of the grid has the extent as specified by
// the user)
boxes[rl][c][ml].interior = intr;
-
+
// Exterior (add ghost zones)
// (the content of the exterior is completely determined by
// the interior of this or other components; the content of
// the exterior is redundant)
boxes[rl][c][ml].exterior = intr.expand(lghosts, ughosts);
-
+
// Boundaries (ghost zones only)
// (interior + boundaries = exterior)
boxes[rl][c][ml].boundaries = boxes[rl][c][ml].exterior - intr;
@@ -118,8 +118,9 @@ void dh<D>::recompose () {
for (int ml=0; ml<h.mglevels(rl,c); ++ml) {
const ibbox intr = boxes[rl][c][ml].interior;
const ibbox extr = boxes[rl][c][ml].exterior;
+
const ibset bnds = boxes[rl][c][ml].boundaries;
-
+
// Sync boxes
for (int cc=0; cc<h.components(rl); ++cc) {
assert (ml<h.mglevels(rl,cc));
@@ -208,6 +209,31 @@ void dh<D>::recompose () {
} // for c
} // for rl
+ for (int rl=0; rl<h.reflevels(); ++rl) {
+ for (int c=0; c<h.components(rl); ++c) {
+ for (int ml=0; ml<h.mglevels(rl,c); ++ml) {
+
+ // Boundaries that are neither synced nor prolonged from
+ // coarser grids (outer boundaries)
+ ibset& sync_not = boxes[rl][c][ml].sync_not;
+
+ // The whole boundary
+ sync_not = boxes[rl][c][ml].boundaries;
+
+ // Subtract boxes received during synchronisation
+ const iblistvect& recv_sync = boxes[rl][c][ml].recv_sync;
+ for (iblistvect::const_iterator lvi=recv_sync.begin();
+ lvi!=recv_sync.end(); ++lvi) {
+ for (iblist::const_iterator li=lvi->begin();
+ li!=lvi->end(); ++li) {
+ sync_not -= *li;
+ }
+ }
+
+ } // for ml
+ } // for c
+ } // for rl
+
bases.resize(h.reflevels());
for (int rl=0; rl<h.reflevels(); ++rl) {
if (h.components(rl)==0) {
@@ -221,6 +247,8 @@ void dh<D>::recompose () {
bases[rl][ml].exterior *= boxes[rl][c][ml].exterior;
bases[rl][ml].interior *= boxes[rl][c][ml].interior;
}
+ bases[rl][ml].boundaries
+ = bases[rl][ml].exterior - bases[rl][ml].interior;
}
}
}
@@ -247,6 +275,7 @@ void dh<D>::recompose () {
cout << "boundaries=" << boxes[rl][c][ml].boundaries << endl;
cout << "recv_sync=" << boxes[rl][c][ml].recv_sync << endl;
cout << "recv_ref_bnd_coarse=" << boxes[rl][c][ml].recv_ref_bnd_coarse << endl;
+ cout << "sync_not=" << boxes[rl][c][ml].sync_not << endl;
}
}
}
@@ -258,6 +287,7 @@ void dh<D>::recompose () {
cout << "rl=" << rl << " ml=" << ml << endl;
cout << "exterior=" << bases[rl][ml].exterior << endl;
cout << "interior=" << bases[rl][ml].interior << endl;
+ cout << "boundaries=" << bases[rl][ml].boundaries << endl;
}
}
}