MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_AmalgamationInfo_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 /*
11  * MueLu_AmalgamationInfo_decl.hpp
12  *
13  * Created on: Mar 28, 2012
14  * Author: wiesner
15  */
16 
17 #ifndef MUELU_AMALGAMATIONINFO_DECL_HPP_
18 #define MUELU_AMALGAMATIONINFO_DECL_HPP_
19 
20 #include <Xpetra_ConfigDefs.hpp> // global_size_t
21 #include <Xpetra_Map_fwd.hpp>
22 #include <Xpetra_Vector_fwd.hpp>
24 
25 #include "MueLu_ConfigDefs.hpp"
26 
27 #include "MueLu_BaseClass.hpp"
28 
30 #include "MueLu_Aggregates_fwd.hpp"
31 
32 namespace MueLu {
33 
42 template <class LocalOrdinal = DefaultLocalOrdinal,
44  class Node = DefaultNode>
46  : public BaseClass {
47 #undef MUELU_AMALGAMATIONINFO_SHORT
49 
50  public:
52  AmalgamationInfo(RCP<Array<LO> > rowTranslation,
53  RCP<Array<LO> > colTranslation,
54  RCP<const Map> nodeRowMap,
55  RCP<const Map> nodeColMap,
56  RCP<const Map> const& columnMap,
57  LO fullblocksize, GO offset, LO blockid, LO nStridedOffset, LO stridedblocksize)
58  : rowTranslation_(rowTranslation)
59  , colTranslation_(colTranslation)
60  , nodeRowMap_(nodeRowMap)
61  , nodeColMap_(nodeColMap)
62  , columnMap_(columnMap)
63  , fullblocksize_(fullblocksize)
64  , offset_(offset)
65  , blockid_(blockid)
66  , nStridedOffset_(nStridedOffset)
67  , stridedblocksize_(stridedblocksize)
68  , indexBase_(columnMap->getIndexBase()) {}
69 
71  virtual ~AmalgamationInfo() {}
72 
74  std::string description() const { return "AmalgamationInfo"; }
75 
77  // using MueLu::Describable::describe; // overloading, not hiding
78  // void describe(Teuchos::FancyOStream &out, const VerbLevel verbLevel = Default) const;;
79  void print(Teuchos::FancyOStream& out, const VerbLevel verbLevel = Default) const;
80 
83 
84  /* @brief Translation arrays
85  *
86  * Returns translation arrays providing local node ids given local dof ids built from either
87  * the non-overlapping (unique) row map or the overlapping (non-unique) column map.
88  * The getColTranslation routine, e.g., is used for the MergeRows routine in CoalesceDropFactory.
89  */
94 
99  void UnamalgamateAggregates(const Aggregates& aggregates, Teuchos::ArrayRCP<LocalOrdinal>& aggStart, Teuchos::ArrayRCP<GlobalOrdinal>& aggToRowMap) const;
100  void UnamalgamateAggregatesLO(const Aggregates& aggregates, Teuchos::ArrayRCP<LocalOrdinal>& aggStart, Teuchos::ArrayRCP<LO>& aggToRowMap) const;
101 
106 
107  private:
109  const RCP<LOVector>& procWinnerVec,
110  const RCP<LOMultiVector>& vertex2AggIdVec,
111  const GO numAggregates,
113  Teuchos::ArrayRCP<GlobalOrdinal>& aggToRowMap) const;
114 
116  const RCP<LOVector>& procWinnerVec,
117  const RCP<LOMultiVector>& vertex2AggIdVec,
118  const GO numAggregates,
120  Teuchos::ArrayRCP<LO>& aggToRowMap) const;
121 
123 
124  public:
135  GO ComputeGlobalDOF(GO const& gNodeID, LO const& k = 0) const;
136 
144  LO ComputeLocalDOF(LocalOrdinal const& lNodeID, LocalOrdinal const& k) const;
145 
146  LO ComputeLocalNode(LocalOrdinal const& ldofID) const;
147 
150  GO GlobalOffset() { return offset_; }
152 
154  void GetStridingInformation(LO& fullBlockSize, LO& blockID, LO& stridingOffset, LO& stridedBlockSize, GO& indexBase) {
155  fullBlockSize = fullblocksize_;
156  blockID = blockid_;
157  stridingOffset = nStridedOffset_;
158  stridedBlockSize = stridedblocksize_;
159  indexBase = indexBase_;
160  }
161 
162  private:
164 
165 
169 
173 
179 
181 
183 
191 };
192 
193 } // namespace MueLu
194 
195 #define MUELU_AMALGAMATIONINFO_SHORT
196 #endif /* MUELU_AMALGAMATIONINFO_DECL_HPP_ */
LO ComputeLocalNode(LocalOrdinal const &ldofID) const
MueLu::DefaultLocalOrdinal LocalOrdinal
RCP< const Map > nodeRowMap_
node row and column map of graph (built from row and column map of A)
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Container class for aggregation information.
GlobalOrdinal GO
void UnamalgamateAggregates(const Aggregates &aggregates, Teuchos::ArrayRCP< LocalOrdinal > &aggStart, Teuchos::ArrayRCP< GlobalOrdinal > &aggToRowMap) const
UnamalgamateAggregates.
virtual ~AmalgamationInfo()
Destructor.
AmalgamationInfo(RCP< Array< LO > > rowTranslation, RCP< Array< LO > > colTranslation, RCP< const Map > nodeRowMap, RCP< const Map > nodeColMap, RCP< const Map > const &columnMap, LO fullblocksize, GO offset, LO blockid, LO nStridedOffset, LO stridedblocksize)
Constructor.
RCP< const Map > getNodeColMap() const
&lt; returns the node row map for the graph
void UnamalgamateAggregatesLO(const Aggregates &aggregates, Teuchos::ArrayRCP< LocalOrdinal > &aggStart, Teuchos::ArrayRCP< LO > &aggToRowMap) const
LocalOrdinal LO
MueLu::DefaultNode Node
RCP< const Map > getNodeRowMap() const
GO ComputeGlobalDOF(GO const &gNodeID, LO const &k=0) const
ComputeGlobalDOF.
MueLu::DefaultGlobalOrdinal GlobalOrdinal
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
Teuchos::RCP< Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > ComputeUnamalgamatedImportDofMap(const Aggregates &aggregates) const
ComputeUnamalgamatedImportDofMap build overlapping dof row map from aggregates needed for overlapping...
void GetStridingInformation(LO &fullBlockSize, LO &blockID, LO &stridingOffset, LO &stridedBlockSize, GO &indexBase)
returns striding information
Base class for MueLu classes.
GO GlobalOffset()
returns offset of global dof ids
RCP< Array< LO > > getRowTranslation() const
&lt; returns the node column map for the graph
RCP< const Map > columnMap_
DOF map (really column map of A)
LO ComputeLocalDOF(LocalOrdinal const &lNodeID, LocalOrdinal const &k) const
ComputeLocalDOF return locbal dof id associated with local node id lNodeID and dof index k...
std::string description() const
Return a simple one-line description of this object.
RCP< Array< LO > > rowTranslation_
Arrays containing local node ids given local dof ids.
minimal container class for storing amalgamation information
RCP< Array< LO > > getColTranslation() const