aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib
diff options
context:
space:
mode:
authorschnetter <>2003-04-30 10:39:00 +0000
committerschnetter <>2003-04-30 10:39:00 +0000
commit160d8e69a8c3f6ebc5990ab2d027e9c1d831ab07 (patch)
tree820264ef204b5705323fdcd4629cdcc8b28123ea /Carpet/CarpetLib
parenta5bda619cc53f66f593bad1f8043dbd0590f6d7a (diff)
dh.cc: Handle empty grids, i.e. processors without any grid points.
dh.cc: Handle empty grids, i.e. processors without any grid points. gh.cc: More veryverbose screen output before regridding. darcs-hash:20030430103939-07bb3-bd5fdf75dc6f36ee63b696690d8d03567ecd1492.gz
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r--Carpet/CarpetLib/src/dh.cc10
-rw-r--r--Carpet/CarpetLib/src/gh.cc40
-rw-r--r--Carpet/CarpetLib/src/vect.cc3
3 files changed, 45 insertions, 8 deletions
diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc
index 958dbdf95..60a7500d1 100644
--- a/Carpet/CarpetLib/src/dh.cc
+++ b/Carpet/CarpetLib/src/dh.cc
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.cc,v 1.29 2003/03/28 10:11:54 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.cc,v 1.30 2003/04/30 12:39:39 schnetter Exp $
#include <assert.h>
@@ -76,9 +76,11 @@ void dh<D>::recompose () {
if (h.outer_boundaries[rl][c][d][0]) ldist[d] = 0;
if (h.outer_boundaries[rl][c][d][1]) udist[d] = 0;
}
- // TODO: This can happen on multiple processors
- assert (! intr.empty());
- boxes[rl][c][ml].exterior = intr.expand(ldist, udist);
+ if (! intr.empty()) {
+ // If a processor has zero grid points, then it gets an
+ // empty bbox, i.e. no ghost zones are added
+ boxes[rl][c][ml].exterior = intr.expand(ldist, udist);
+ }
// Boundaries (ghost zones only)
// (interior + boundaries = exterior)
diff --git a/Carpet/CarpetLib/src/gh.cc b/Carpet/CarpetLib/src/gh.cc
index 76f8ea7e1..c34abdb35 100644
--- a/Carpet/CarpetLib/src/gh.cc
+++ b/Carpet/CarpetLib/src/gh.cc
@@ -1,9 +1,12 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/gh.cc,v 1.18 2003/01/03 15:49:36 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/gh.cc,v 1.19 2003/04/30 12:39:39 schnetter Exp $
#include <assert.h>
#include <stdlib.h>
#include <iostream>
+#include "cctk.h"
+#include "cctk_Parameters.h"
+
#include "defs.hh"
#include "dh.hh"
#include "th.hh"
@@ -31,8 +34,12 @@ gh<D>::~gh () { }
// Modifiers
template<int D>
-void gh<D>::recompose (const rexts& exts, const rbnds& outer_bounds,
- const rprocs& procs) {
+void gh<D>::recompose (const rexts& exts,
+ const rbnds& outer_bounds,
+ const rprocs& procs)
+{
+ DECLARE_CCTK_PARAMETERS;
+
extents = exts;
outer_boundaries = outer_bounds;
processors = procs;
@@ -121,6 +128,31 @@ void gh<D>::recompose (const rexts& exts, const rbnds& outer_bounds,
}
}
+ if (output_bboxes) {
+ for (int rl=0; rl<reflevels(); ++rl) {
+ for (int c=0; c<components(rl); ++c) {
+ for (int ml=0; ml<mglevels(rl,c); ++ml) {
+ cout << endl;
+ cout << "gh bboxes:" << endl;
+ cout << "rl=" << rl << " c=" << c << " ml=" << ml << endl;
+ cout << "extent=" << extents[rl][c][ml] << endl;
+ cout << "outer_boundary=" << outer_boundaries[rl][c][ml] << endl;
+ cout << "processor=" << processors[rl][c] << endl;
+ }
+ }
+ }
+ for (int rl=0; rl<reflevels(); ++rl) {
+ if (components(rl)>0) {
+ for (int ml=0; ml<mglevels(rl,0); ++ml) {
+ cout << endl;
+ cout << "gh bases:" << endl;
+ cout << "rl=" << rl << " ml=" << ml << endl;
+ cout << "base=" << bases[rl][ml] << endl;
+ }
+ }
+ }
+ }
+
// Recompose the other hierarchies
for (typename list<th<D>*>::iterator t=ths.begin(); t!=ths.end(); ++t) {
@@ -242,6 +274,8 @@ ostream& gh<D>::output (ostream& os) const {
<< "mgfactor=" << mgfact << ",mgcentering=" << mgcent << ","
<< "baseextent=" << baseextent << ","
<< "extents=" << extents << ","
+ << "outer_boundaries=" << outer_boundaries << ","
+ << "processors=" << processors << ","
<< "dhs={";
int cnt=0;
for (typename list<dh<D>*>::const_iterator d = dhs.begin();
diff --git a/Carpet/CarpetLib/src/vect.cc b/Carpet/CarpetLib/src/vect.cc
index 208cfe206..a80d2688f 100644
--- a/Carpet/CarpetLib/src/vect.cc
+++ b/Carpet/CarpetLib/src/vect.cc
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/vect.cc,v 1.10 2003/03/26 17:34:43 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/vect.cc,v 1.11 2003/04/30 12:39:40 schnetter Exp $
#include <assert.h>
@@ -54,6 +54,7 @@ template class vect<int,3>;
template void vect<double,3>::input (istream& is);
template void vect<vect<bool,2>,3>::input (istream& is);
+template void vect<bool,2>::output (ostream& os) const;
template void vect<bool,3>::output (ostream& os) const;
template void vect<double,3>::output (ostream& os) const;
template void vect<vect<bool,2>,3>::output (ostream& os) const;