53 #ifndef MUELU_AMALGAMATIONINFO_KOKKOS_DEF_HPP_
54 #define MUELU_AMALGAMATIONINFO_KOKKOS_DEF_HPP_
56 #include <Xpetra_MapFactory.hpp>
62 #include "MueLu_Aggregates_kokkos.hpp"
66 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
72 int myPid = aggregates.GetMap()->getComm()->getRank();
76 LO size = procWinner.
size();
77 GO numAggregates = aggregates.GetNumAggregates();
79 std::vector<LO> sizes(numAggregates);
80 if (stridedblocksize_ == 1) {
81 for (
LO lnode = 0; lnode < size; ++lnode) {
82 LO myAgg = vertex2AggId[lnode];
83 if (procWinner[lnode] == myPid)
87 for (
LO lnode = 0; lnode < size; ++lnode) {
88 LO myAgg = vertex2AggId[lnode];
89 if (procWinner[lnode] == myPid) {
90 GO gnodeid = nodeGlobalElts[lnode];
93 if (columnMap_->isNodeGlobalElement(gDofIndex))
101 for (
GO i=0; i<numAggregates; ++i) {
102 aggStart[i+1] = aggStart[i] + sizes[i];
109 if (stridedblocksize_ == 1) {
110 for (
LO lnode = 0; lnode < size; ++lnode) {
111 LO myAgg = vertex2AggId[lnode];
112 if (procWinner[lnode] == myPid) {
113 aggToRowMap[ aggStart[myAgg] + numDofs[myAgg] ] = ComputeGlobalDOF(nodeGlobalElts[lnode]);
118 for (
LO lnode = 0; lnode < size; ++lnode) {
119 LO myAgg = vertex2AggId[lnode];
121 if (procWinner[lnode] == myPid) {
122 GO gnodeid = nodeGlobalElts[lnode];
125 if (columnMap_->isNodeGlobalElement(gDofIndex)) {
126 aggToRowMap[ aggStart[myAgg] + numDofs[myAgg] ] = gDofIndex;
137 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
143 int myPid = aggregates.GetMap()->getComm()->getRank();
148 const GO numAggregates = aggregates.GetNumAggregates();
152 LO size = procWinner.
size();
154 std::vector<LO> sizes(numAggregates);
155 if (stridedblocksize_ == 1) {
156 for (
LO lnode = 0; lnode < size; lnode++)
157 if (procWinner[lnode] == myPid)
158 sizes[vertex2AggId[lnode]]++;
160 for (
LO lnode = 0; lnode < size; lnode++)
161 if (procWinner[lnode] == myPid) {
162 GO nodeGID = nodeGlobalElts[lnode];
164 for (
LO k = 0; k < stridedblocksize_; k++) {
165 GO GID = ComputeGlobalDOF(nodeGID, k);
166 if (columnMap_->isNodeGlobalElement(GID))
167 sizes[vertex2AggId[lnode]]++;
174 for (
GO i = 0; i < numAggregates; i++)
175 aggStart[i+1] = aggStart[i] + sizes[i];
181 if (stridedblocksize_ == 1) {
182 for (
LO lnode = 0; lnode < size; ++lnode)
183 if (procWinner[lnode] == myPid) {
184 LO myAgg = vertex2AggId[lnode];
185 aggToRowMap[aggStart[myAgg] + numDofs[myAgg]] = lnode;
189 for (
LO lnode = 0; lnode < size; ++lnode)
190 if (procWinner[lnode] == myPid) {
191 LO myAgg = vertex2AggId[lnode];
192 GO nodeGID = nodeGlobalElts[lnode];
194 for (
LO k = 0; k < stridedblocksize_; k++) {
195 GO GID = ComputeGlobalDOF(nodeGID, k);
196 if (columnMap_->isNodeGlobalElement(GID)) {
197 aggToRowMap[aggStart[myAgg] + numDofs[myAgg]] = lnode*stridedblocksize_ + k;
209 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
217 LO nodeElements = Teuchos::as<LO>(nodeMap->getLocalNumElements());
218 if (stridedblocksize_ == 1) {
219 for (
LO n = 0; n<nodeElements; n++) {
221 myDofGids->push_back(gDofIndex);
224 for (
LO n = 0; n<nodeElements; n++) {
227 if (columnMap_->isNodeGlobalElement(gDofIndex))
228 myDofGids->push_back(gDofIndex);
240 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
245 GlobalOrdinal gDofIndex = offset_ + (gNodeID-indexBase_)*fullblocksize_ + nStridedOffset_ + k + indexBase_;
Teuchos::RCP< Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > ComputeUnamalgamatedImportDofMap(const Aggregates_kokkos &aggregates) const
ComputeUnamalgamatedImportDofMap build overlapping dof row map from aggregates needed for overlapping...
MueLu::DefaultLocalOrdinal LocalOrdinal
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
MueLu::DefaultGlobalOrdinal GlobalOrdinal
void UnamalgamateAggregates(const Aggregates_kokkos &aggregates, Teuchos::ArrayRCP< LocalOrdinal > &aggStart, Teuchos::ArrayRCP< GlobalOrdinal > &aggToRowMap) const
UnamalgamateAggregates.
void UnamalgamateAggregatesLO(const Aggregates_kokkos &aggregates, Teuchos::ArrayRCP< LocalOrdinal > &aggStart, Teuchos::ArrayRCP< LO > &aggToRowMap) const
GO ComputeGlobalDOF(GO const &gNodeID, LO const &k=0) const
ComputeGlobalDOF return global dof id associated with global node id gNodeID and dof index k...