49 #ifndef XPETRA_STRIDEDMAPFACTORY_HPP
50 #define XPETRA_STRIDEDMAPFACTORY_HPP
63 template <class LocalOrdinal = StridedMap<>::local_ordinal_type,
68 class StridedMapFactory {
69 #undef XPETRA_STRIDEDMAPFACTORY_SHORT
84 return rcp(
new StridedMap(lib, numGlobalElements, indexBase, stridingInfo, comm, stridedBlockId, offset, lg, node));
90 LocalOrdinal stridedBlockId = -1, GlobalOrdinal offset = 0,
93 return rcp(
new StridedMap(lib, numGlobalElements, numLocalElements, indexBase, stridingInfo, comm, stridedBlockId, offset, node));
97 return rcp(
new StridedMap(map, stridingInfo, map->getIndexBase(), stridedBlockId, offset));
103 "Xpetra::StridedMapFactory::Build: constructor expects stridedBlockId > -1.");
105 "Xpetra::StridedMapFactory::Build: constructor expects a full map (stridedBlockId == -1).");
107 std::vector<size_t> stridingInfo = map->getStridingData();
113 size_t nStridedOffset = 0;
114 for (
int j = 0; j < map->getStridedBlockId(); j++)
115 nStridedOffset += stridingInfo[j];
117 size_t numMyBlockDofs = (stridingInfo[stridedBlockId] * map->getNodeNumElements()) / map->getFixedBlockSize();
118 std::vector<GlobalOrdinal> subBlockDofGids(numMyBlockDofs);
121 LocalOrdinal ind = 0;
123 if (map->GID2StridingBlockId(*it) == Teuchos::as<size_t>(stridedBlockId))
124 subBlockDofGids[ind++] = *it;
138 for (LocalOrdinal i = 0; i < N; i++)
139 newElements[i] = oldElements[i];
152 GlobalOrdinal indexBase,
153 std::vector<size_t>& stridingInfo,
155 LocalOrdinal stridedBlockId = -1,
156 GlobalOrdinal offset = 0,
159 return rcp (
new StridedMap (lib, numGlobalElements, elementList,
160 indexBase, stridingInfo, comm,
161 stridedBlockId, node));
166 #define XPETRA_STRIDEDMAPFACTORY_SHORT