69 const int interpolationOrder,
71 const ArrayView<const LO> LFineNodesPerDir,
72 const ArrayView<const int> CoarseRate) :
76 RCP<Teuchos::FancyOStream> out;
77 if(
const char* dbg = std::getenv(
"MUELU_INDEXMANAGER_DEBUG")) {
78 out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
79 out->setShowAllFrontMatter(
false).setShowProcRank(
true);
81 out = Teuchos::getFancyOStream(rcp(
new Teuchos::oblackholestream()));
84 setupIM(NumDimensions, interpolationOrder, CoarseRate, LFineNodesPerDir);
86 *out <<
"Done setting up the IndexManager" << std::endl;
90 *out <<
"Computed Mesh Parameters" << std::endl;
96 setupIM(
const int NumDimensions,
const int interpolationOrder,
97 const ArrayView<const int> CoarseRate,
const ArrayView<const LO> LFineNodesPerDir) {
102 TEUCHOS_TEST_FOR_EXCEPTION((LFineNodesPerDir.size() != 3)
105 "LFineNodesPerDir has to be of size 3 or of size numDimensions!");
107 typename Kokkos::View<LO[3], device_type>::HostMirror lFineNodesPerDir_h = Kokkos::create_mirror_view(
lFineNodesPerDir);
109 typename Kokkos::View<LO[3], device_type>::HostMirror coarseRate_h = Kokkos::create_mirror_view(
coarseRate);
114 for(
int dim = 0; dim < 3; ++dim) {
116 lFineNodesPerDir_h(dim) = LFineNodesPerDir[dim];
117 if(CoarseRate.size() == 1) {
118 coarseRate_h(dim) = CoarseRate[0];
120 coarseRate_h(dim) = CoarseRate[dim];
123 lFineNodesPerDir_h(dim) = 1;
124 coarseRate_h(dim) = 1;
136 RCP<Teuchos::FancyOStream> out;
137 if(
const char* dbg = std::getenv(
"MUELU_INDEXMANAGER_DEBUG")) {
138 out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
139 out->setShowAllFrontMatter(
false).setShowProcRank(
true);
141 out = Teuchos::getFancyOStream(rcp(
new Teuchos::oblackholestream()));
144 typename Kokkos::View<int[3], device_type>::HostMirror coarseRate_h = Kokkos::create_mirror_view(
coarseRate);
145 typename Kokkos::View<int[3], device_type>::HostMirror endRate_h = Kokkos::create_mirror_view(
endRate);
148 typename Kokkos::View<LO[3], device_type>::HostMirror lFineNodesPerDir_h = Kokkos::create_mirror_view(
lFineNodesPerDir);
149 typename Kokkos::View<LO[3], device_type>::HostMirror coarseNodesPerDir_h = Kokkos::create_mirror_view(
coarseNodesPerDir);
155 for(
int dim = 0; dim < 3; ++dim) {
157 endRate_h(dim) = (lFineNodesPerDir_h(dim) - 1) % coarseRate_h(dim);
158 if(endRate_h(dim) == 0) {endRate_h(dim) = coarseRate_h(dim);}
165 *out <<
"lFineNodesPerDir: {" << lFineNodesPerDir_h(0) <<
", " << lFineNodesPerDir_h(1) <<
", "
166 << lFineNodesPerDir_h(2) <<
"}" << std::endl;
167 *out <<
"endRate: {" << endRate_h(0) <<
", " << endRate_h(1) <<
", "
168 << endRate_h(2) <<
"}" << std::endl;
183 for(
int dim = 0; dim < 3; ++dim) {
188 coarseNodesPerDir_h(dim) = (lFineNodesPerDir_h(dim) - endRate_h(dim) - 1)
189 / coarseRate_h(dim) + 2;
193 coarseNodesPerDir_h(dim) = 1;
198 if(lFineNodesPerDir_h(dim) < 1) {coarseNodesPerDir_h(dim) = 0;}
205 *out <<
"coarseNodesPerDir: {" << coarseNodesPerDir_h(0) <<
", "
206 << coarseNodesPerDir_h(1) <<
", " << coarseNodesPerDir_h(2) <<
"}" << std::endl;
211 Kokkos::deep_copy(
endRate, endRate_h);
void setupIM(const int NumDimensions, const int interpolationOrder, const ArrayView< const int > coarseRate, const ArrayView< const LO > LFineNodesPerDir)
Common setup pattern used for all the different types of undelying mesh.