MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_LocalLexicographicIndexManager_decl.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// MueLu: A package for multigrid based preconditioning
4//
5// Copyright 2012 NTESS and the MueLu contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef MUELU_LOCALLEXICOGRAPHICINDEXMANAGER_DECL_HPP
11#define MUELU_LOCALLEXICOGRAPHICINDEXMANAGER_DECL_HPP
12
13// use for Teuchos:Comm<T>
14#include "Teuchos_CommHelpers.hpp"
15
16#include <Xpetra_Map_fwd.hpp>
17
18#include "MueLu_ConfigDefs.hpp"
19#include "MueLu_IndexManager.hpp"
21
22/*****************************************************************************
23
24****************************************************************************/
25
26namespace MueLu {
27
44template <class LocalOrdinal, class GlobalOrdinal, class Node>
45class LocalLexicographicIndexManager : public IndexManager<LocalOrdinal, GlobalOrdinal, Node> {
46#undef MUELU_LOCALLEXICOGRAPHICINDEXMANAGER_SHORT
48
49 public:
51
52 LocalLexicographicIndexManager(const RCP<const Teuchos::Comm<int> > comm, const bool coupled,
53 const int NumDimensions, const int interpolationOrder,
54 const int MyRank, const int NumRanks,
55 const Array<GO> GFineNodesPerDir,
56 const Array<LO> LFineNodesPerDir,
57 const Array<LO> CoarseRate, const Array<GO> MeshData);
58
60
62
63 void getGhostedNodesData(const RCP<const Map> fineMap,
64 Array<LO>& ghostedNodeCoarseLIDs,
65 Array<int>& ghostedNodeCoarsePIDs,
66 Array<GO>& ghostedNodeCoarseGIDs) const;
67
68 void getCoarseNodesData(const RCP<const Map> fineCoordinatesMap,
69 Array<GO>& coarseNodeCoarseGIDs,
70 Array<GO>& coarseNodeFineGIDs) const;
71
72 std::vector<std::vector<GO> > getCoarseMeshData() const;
73
74 void getFineNodeGlobalTuple(const GO myGID, GO& i, GO& j, GO& k) const;
75
76 void getFineNodeLocalTuple(const LO myLID, LO& i, LO& j, LO& k) const;
77
78 void getFineNodeGhostedTuple(const LO myLID, LO& i, LO& j, LO& k) const;
79
80 void getFineNodeGID(const GO i, const GO j, const GO k, GO& myGID) const;
81
82 void getFineNodeLID(const LO i, const LO j, const LO k, LO& myLID) const;
83
84 void getCoarseNodeGlobalTuple(const GO myGID, GO& i, GO& j, GO& k) const;
85
86 void getCoarseNodeLocalTuple(const LO myLID, LO& i, LO& j, LO& k) const;
87
88 void getCoarseNodeGID(const GO i, const GO j, const GO k, GO& myGID) const;
89
90 void getCoarseNodeLID(const LO i, const LO j, const LO k, LO& myLID) const;
91
92 void getCoarseNodeGhostedLID(const LO i, const LO j, const LO k, LO& myLID) const;
93
94 void getCoarseNodeFineLID(const LO i, const LO j, const LO k, LO& myLID) const;
95
96 void getGhostedNodeFineLID(const LO i, const LO j, const LO k, LO& myLID) const;
97
98 void getGhostedNodeCoarseLID(const LO i, const LO j, const LO k, LO& myLID) const;
99
100 private:
101 const int myRank;
102 const int numRanks;
103
104 // Iterator delimiting the entries in meshData that correspond to the block that owns the local
105 // part of the mesh.
106 typename std::vector<std::vector<GO> >::iterator myBlockStart, myBlockEnd;
107
108 int pi, pj, pk;
109
112
114 Array<int> rankIndices;
115 std::vector<std::vector<GO> > meshData;
116 std::vector<std::vector<GO> > coarseMeshData;
117
119
121
122 void getGIDLocalLexicographic(const LO iGhosted, const LO jGhosted, const LO kGhosted,
123 const Array<LO> coarseNodeFineIndices, GO& myGID, LO& myPID,
124 LO& myLID) const;
125};
126
127} // namespace MueLu
128
129#define MUELU_LOCALLEXICOGRAPHICINDEXMANAGER_SHORT
130#endif // MUELU_LOCALLEXICOGRAPHICINDEXMANAGER_DECL_HPP
Container class for mesh layout and indices calculation.
void getFineNodeGlobalTuple(const GO myGID, GO &i, GO &j, GO &k) const
void getGhostedNodesData(const RCP< const Map > fineMap, Array< LO > &ghostedNodeCoarseLIDs, Array< int > &ghostedNodeCoarsePIDs, Array< GO > &ghostedNodeCoarseGIDs) const
const int numRanks
Number of ranks used to decompose the problem.
void getFineNodeLocalTuple(const LO myLID, LO &i, LO &j, LO &k) const
int myRankIndex
local process index for record in meshData after sorting.
void getFineNodeGhostedTuple(const LO myLID, LO &i, LO &j, LO &k) const
void getGhostedNodeFineLID(const LO i, const LO j, const LO k, LO &myLID) const
void getFineNodeGID(const GO i, const GO j, const GO k, GO &myGID) const
void getGIDLocalLexicographic(const LO iGhosted, const LO jGhosted, const LO kGhosted, const Array< LO > coarseNodeFineIndices, GO &myGID, LO &myPID, LO &myLID) const
void getCoarseNodeLID(const LO i, const LO j, const LO k, LO &myLID) const
void getCoarseNodeGlobalTuple(const GO myGID, GO &i, GO &j, GO &k) const
std::vector< std::vector< GO > > meshData
layout of indices accross all processes.
void getGhostedNodeCoarseLID(const LO i, const LO j, const LO k, LO &myLID) const
void getCoarseNodeGID(const GO i, const GO j, const GO k, GO &myGID) const
std::vector< std::vector< GO > > coarseMeshData
layout of indices accross all processes after coarsening.
Array< int > rankIndices
mapping between rank ID and reordered rank ID.
void getCoarseNodeLocalTuple(const LO myLID, LO &i, LO &j, LO &k) const
void getFineNodeLID(const LO i, const LO j, const LO k, LO &myLID) const
void getCoarseNodeFineLID(const LO i, const LO j, const LO k, LO &myLID) const
void getCoarseNodeGhostedLID(const LO i, const LO j, const LO k, LO &myLID) const
void getCoarseNodesData(const RCP< const Map > fineCoordinatesMap, Array< GO > &coarseNodeCoarseGIDs, Array< GO > &coarseNodeFineGIDs) const
Namespace for MueLu classes and methods.