diff options
author | schnetter <> | 2001-04-23 06:10:00 +0000 |
---|---|---|
committer | schnetter <> | 2001-04-23 06:10:00 +0000 |
commit | 3c8cafa058889929160d7019304b99fab0656df8 (patch) | |
tree | 46dd47a05e490ed976623074c18bcdac45787c81 /Carpet/CarpetLib | |
parent | bcf0f1685d561b33bb1b0c1e033adb4a145767d3 (diff) |
Modified the Carpet driver so that it uses the same new timelevel
Modified the Carpet driver so that it uses the same new timelevel
cycling as does PUGH.
Modified the CarpetIOASCII and CarpetIOFlexIO output routines so that
they always output the current time level.
Found and fixed a bug in the time interpolation in CarpetLib.
Fixed a bug where the necessary number of ghost zones for space
interpolation was calculated incorrectly.
Fixed bugs in the example parameter files that used an insufficient
number of ghost zones.
darcs-hash:20010423061011-07bb3-c69e59f7bc5f283d7632a663c0770578cdb73881.gz
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r-- | Carpet/CarpetLib/src/dh.cc | 28 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/dh.hh | 10 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/ggf.cc | 14 |
3 files changed, 36 insertions, 16 deletions
diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc index ec51bfd65..449ba1dc5 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.12 2001/03/28 18:56:09 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.cc,v 1.13 2001/04/23 08:10:15 schnetter Exp $ ***************************************************************************/ @@ -57,6 +57,13 @@ dh<D>::~dh () { h.remove(this); } +// Helpers +template<int D> +int dh<D>::prolongation_stencil_size () const { + assert (prolongation_order>=0); + return prolongation_order/2; +} + // Modifiers template<int D> void dh<D>::recompose () { @@ -220,12 +227,14 @@ void dh<D>::recompose () { 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) + // Boundaries that are not synced, or are neither synced nor + // prolonged to from coarser grids (outer boundaries) ibset& sync_not = boxes[rl][c][ml].sync_not; + ibset& recv_not = boxes[rl][c][ml].recv_not; // The whole boundary sync_not = boxes[rl][c][ml].boundaries; + recv_not = boxes[rl][c][ml].boundaries; // Subtract boxes received during synchronisation const iblistvect& recv_sync = boxes[rl][c][ml].recv_sync; @@ -234,6 +243,18 @@ void dh<D>::recompose () { for (iblist::const_iterator li=lvi->begin(); li!=lvi->end(); ++li) { sync_not -= *li; + recv_not -= *li; + } + } + + // Subtract all boxes received + const iblistvect& recv_ref_bnd_coarse + = boxes[rl][c][ml].recv_ref_bnd_coarse; + for (iblistvect::const_iterator lvi=recv_ref_bnd_coarse.begin(); + lvi!=recv_ref_bnd_coarse.end(); ++lvi) { + for (iblist::const_iterator li=lvi->begin(); + li!=lvi->end(); ++li) { + recv_not -= *li; } } @@ -287,6 +308,7 @@ void dh<D>::recompose () { 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; + cout << "recv_not=" << boxes[rl][c][ml].recv_not << endl; } } } diff --git a/Carpet/CarpetLib/src/dh.hh b/Carpet/CarpetLib/src/dh.hh index 2267db505..70ffe3803 100644 --- a/Carpet/CarpetLib/src/dh.hh +++ b/Carpet/CarpetLib/src/dh.hh @@ -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.hh,v 1.6 2001/03/28 18:56:09 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.hh,v 1.7 2001/04/23 08:10:15 schnetter Exp $ ***************************************************************************/ @@ -79,7 +79,8 @@ public: ibset boundaries; // boundaries iblistvect recv_sync; // received while syncing iblistvect recv_ref_bnd_coarse; // received from coarser grids - ibset sync_not; // not received while syncing (outer boundary) + ibset sync_not; // not received while syncing (outer boundary of that level) + ibset recv_not; // not received while syncing or prolongating (globally outer boundary) }; private: @@ -118,10 +119,7 @@ public: ~dh (); // Helpers - int prolongation_stencil_size () const { - assert (prolongation_order>=0); - return prolongation_order/2; - } + int prolongation_stencil_size () const; // Modifiers void recompose (); diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc index 42f4098ba..e4c890497 100644 --- a/Carpet/CarpetLib/src/ggf.cc +++ b/Carpet/CarpetLib/src/ggf.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/ggf.cc,v 1.8 2001/03/27 22:26:31 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/ggf.cc,v 1.9 2001/04/23 08:10:15 schnetter Exp $ ***************************************************************************/ @@ -276,9 +276,9 @@ void generic_gf<D>::intercat (int tl1, int rl1, int c1, int ml1, vector<int> tls(tl2s.size()); for (int i=0; i<(int)gsrcs.size(); ++i) { gsrcs[i] = storage[tl2s[i]-tmin][rl2][c2][ml2]; - tls[i] = tl2s[i] * t.get_delta(rl2,ml2); + tls[i] = t.time(tl2s[i],rl2,ml2); } - const int tl = tl1 * t.get_delta(rl1,ml1); + const int tl = t.time(tl1,rl1,ml1); const ibbox recv = d.boxes[rl1][c1][ml1].*recv_list; const ibbox send = d.boxes[rl2][c2][ml2].*send_list; @@ -312,9 +312,9 @@ void generic_gf<D>::intercat (int tl1, int rl1, int c1, int ml1, vector<int> tls(tl2s.size()); for (int i=0; i<(int)gsrcs.size(); ++i) { gsrcs[i] = storage[tl2s[i]-tmin][rl2][c2][ml2]; - tls[i] = tl2s[i] * t.get_delta(rl2,ml2); + tls[i] = t.time(tl2s[i],rl2,ml2); } - const int tl = tl1 * t.get_delta(rl1,ml1); + const int tl = t.time(tl1,rl1,ml1); const iblist recv = d.boxes[rl1][c1][ml1].*recv_list; const iblist send = d.boxes[rl2][c2][ml2].*send_list; @@ -353,9 +353,9 @@ void generic_gf<D>::intercat (int tl1, int rl1, int c1, int ml1, vector<int> tls(tl2s.size()); for (int i=0; i<(int)gsrcs.size(); ++i) { gsrcs[i] = storage[tl2s[i]-tmin][rl2][c2][ml2]; - tls[i] = tl2s[i] * t.get_delta(rl2,ml2); + tls[i] = t.time(tl2s[i],rl2,ml2); } - const int tl = tl1 * t.get_delta(rl1,ml1); + const int tl = t.time(tl1,rl1,ml1); const iblist recv = (d.boxes[rl1][c1][ml1].*recv_listvect)[c2]; const iblist send = (d.boxes[rl2][c2][ml2].*send_listvect)[c1]; |