aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/data.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-08-25 11:34:19 -0400
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 18:21:19 +0000
commita9b4bd8d16e866eb4ad1c06f0f72b81445f661c4 (patch)
tree94672de3c99baa5568af86ce13b148dc31e0f26a /Carpet/CarpetLib/src/data.cc
parent3bd1e904a73d01bf4a01e44e61c92109ca6e8c75 (diff)
CarpetLib: Support mixed vertex/cell centred restriction
Diffstat (limited to 'Carpet/CarpetLib/src/data.cc')
-rw-r--r--Carpet/CarpetLib/src/data.cc56
1 files changed, 47 insertions, 9 deletions
diff --git a/Carpet/CarpetLib/src/data.cc b/Carpet/CarpetLib/src/data.cc
index 484582073..9537453de 100644
--- a/Carpet/CarpetLib/src/data.cc
+++ b/Carpet/CarpetLib/src/data.cc
@@ -975,16 +975,54 @@ transfer_restrict (data const * const src,
this->extent(),
box);
break;
- case cell_centered:
- call_operator<T> (& restrict_3d_cc_rf2,
- static_cast <T const *> (src->storage()),
- src->shape(),
- static_cast <T *> (this->storage()),
- this->shape(),
- src->extent(),
- this->extent(),
- box);
+ case cell_centered: {
+ ivect const is_centered =
+ ((src->extent().lower() - this->extent().lower()) %
+ src->extent().stride()) !=
+ ivect(0,0,0);
+#warning "TODO"
+ cout << "REF restrict CC " << is_centered << "\n";
+ if (all(is_centered == ivect(1,1,1))) {
+ call_operator<T> (& restrict_3d_cc_rf2,
+ static_cast <T const *> (src->storage()),
+ src->shape(),
+ static_cast <T *> (this->storage()),
+ this->shape(),
+ src->extent(),
+ this->extent(),
+ box);
+ } else if (all(is_centered == ivect(0,1,1))) {
+ call_operator<T> (& restrict_3d_vc_rf2<T,0,1,1>,
+ static_cast <T const *> (src->storage()),
+ src->shape(),
+ static_cast <T *> (this->storage()),
+ this->shape(),
+ src->extent(),
+ this->extent(),
+ box);
+ } else if (all(is_centered == ivect(1,0,1))) {
+ call_operator<T> (& restrict_3d_vc_rf2<T,1,0,1>,
+ static_cast <T const *> (src->storage()),
+ src->shape(),
+ static_cast <T *> (this->storage()),
+ this->shape(),
+ src->extent(),
+ this->extent(),
+ box);
+ } else if (all(is_centered == ivect(1,1,0))) {
+ call_operator<T> (& restrict_3d_vc_rf2<T,1,1,0>,
+ static_cast <T const *> (src->storage()),
+ src->shape(),
+ static_cast <T *> (this->storage()),
+ this->shape(),
+ src->extent(),
+ this->extent(),
+ box);
+ } else {
+ assert (0);
+ }
break;
+ }
default:
assert (0);
}