diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2010-08-25 11:34:19 -0400 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2011-12-14 18:21:19 +0000 |
commit | a9b4bd8d16e866eb4ad1c06f0f72b81445f661c4 (patch) | |
tree | 94672de3c99baa5568af86ce13b148dc31e0f26a /Carpet/CarpetLib/src/data.cc | |
parent | 3bd1e904a73d01bf4a01e44e61c92109ca6e8c75 (diff) |
CarpetLib: Support mixed vertex/cell centred restriction
Diffstat (limited to 'Carpet/CarpetLib/src/data.cc')
-rw-r--r-- | Carpet/CarpetLib/src/data.cc | 56 |
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); } |