aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/data.cc
diff options
context:
space:
mode:
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);
}