aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src
diff options
context:
space:
mode:
authorschnetter <>2004-04-20 09:55:00 +0000
committerschnetter <>2004-04-20 09:55:00 +0000
commit43111a0c58b59ef52278a3fcfd3090b598ae7bd0 (patch)
tree75942c799a7cc21dff8ff0bd15d83b1888b66d5a /Carpet/CarpetLib/src
parentc910348d4a43be3bba9f111b90e4d2bfee2194e1 (diff)
While regridding, initialise only the interior of the grid functions.
While regridding, initialise only the interior of the grid functions. There is in general not be enough parent to intialise the outer boundaries. darcs-hash:20040420095552-07bb3-812459eafff1161f31a5cb26686ced00b7512b68.gz
Diffstat (limited to 'Carpet/CarpetLib/src')
-rw-r--r--Carpet/CarpetLib/src/dh.hh10
-rw-r--r--Carpet/CarpetLib/src/ggf.cc33
2 files changed, 35 insertions, 8 deletions
diff --git a/Carpet/CarpetLib/src/dh.hh b/Carpet/CarpetLib/src/dh.hh
index c78d31291..c8d6b3bc0 100644
--- a/Carpet/CarpetLib/src/dh.hh
+++ b/Carpet/CarpetLib/src/dh.hh
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.hh,v 1.18 2004/04/18 13:29:43 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.hh,v 1.19 2004/04/20 11:55:52 schnetter Exp $
#ifndef DH_HH
#define DH_HH
@@ -71,6 +71,14 @@ public:
iblistvect recv_ref_bnd_coarse; // received from coarser grids
ibset sync_not; // not received while syncing (outer boundary of that level)
ibset recv_not; // not received while syncing or prolongating (globally outer boundary)
+
+#if 0
+ // after regridding:
+ iblistvect prev_send; // sent from previous dh
+ iblistvect recv_prev; // received from previous dh
+ iblistvect send_prev_fine; // sent to finer
+ iblistvect recv_prev_coarse; // received from coarser
+#endif
};
private:
diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc
index c378b5822..49ba695c8 100644
--- a/Carpet/CarpetLib/src/ggf.cc
+++ b/Carpet/CarpetLib/src/ggf.cc
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/ggf.cc,v 1.39 2004/04/19 21:38:33 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/ggf.cc,v 1.40 2004/04/20 11:55:52 schnetter Exp $
#include <assert.h>
#include <stdlib.h>
@@ -111,7 +111,7 @@ void ggf<D>::recompose_fill (comm_state<D>& state, const int rl)
// Find out which regions need to be prolongated
// TODO: do this once in the dh instead of for each variable here
- ibset work (d.boxes.at(rl).at(c).at(ml).exterior);
+ ibset work (d.boxes.at(rl).at(c).at(ml).interior);
// Copy from old storage, if possible
// TODO: copy only from interior regions?
@@ -122,13 +122,14 @@ void ggf<D>::recompose_fill (comm_state<D>& state, const int rl)
ibset ovlp = work & oldstorage.at(tl-tmin).at(rl).at(cc).at(ml)->extent();
ovlp.normalize();
work -= ovlp;
+ work.normalize();
for (typename ibset::const_iterator r=ovlp.begin(); r!=ovlp.end(); ++r) {
- storage.at(tl-tmin).at(rl).at(c).at(ml)->copy_from (state, oldstorage.at(tl-tmin).at(rl).at(cc).at(ml), *r);
+ storage.at(tl-tmin).at(rl).at(c).at(ml)->copy_from
+ (state, oldstorage.at(tl-tmin).at(rl).at(cc).at(ml), *r);
}
} // if ml
} // for cc
} // if rl
- work.normalize();
// Initialise from coarser level, if possible
if (rl>0) {
@@ -145,15 +146,33 @@ void ggf<D>::recompose_fill (comm_state<D>& state, const int rl)
vector<const gdata<D>*> gsrcs(numtl);
for (int i=0; i<numtl; ++i) {
gsrcs.at(i) = storage.at(tls.at(i)-tmin).at(rl-1).at(cc).at(ml);
+ assert (gsrcs.at(i)->extent() == gsrcs.at(0)->extent());
}
const CCTK_REAL time = t.time(tl,rl,ml);
- for (typename ibset::const_iterator r=work.begin(); r!=work.end(); ++r) {
- storage.at(tl-tmin).at(rl).at(c).at(ml)->interpolate_from (state, gsrcs, times, *r, time, d.prolongation_order_space, prolongation_order_time);
- }
+
+ // TODO: choose larger regions first
+ // TODO: prefer regions from the same processor
+ const iblist& list = d.boxes.at(rl).at(c).at(ml).recv_ref_coarse.at(cc);
+ for (typename iblist::const_iterator iter=list.begin(); iter!=list.end(); ++iter) {
+ ibset ovlp = work & *iter;
+ ovlp.normalize();
+ work -= ovlp;
+ work.normalize();
+ for (typename ibset::const_iterator r=ovlp.begin(); r!=ovlp.end(); ++r) {
+ storage.at(tl-tmin).at(rl).at(c).at(ml)->interpolate_from
+ (state, gsrcs, times, *r, time,
+ d.prolongation_order_space, prolongation_order_time);
+ } // for r
+ } // for iter
} // for cc
} // if transport_operator
} // if rl
+ // Note that work need not be empty here; in this case, not
+ // everything could be initialised. This is okay on
+ // boundaries.
+ // TODO: check this.
+
} // for tl
} // for ml
} // for c