MueLu Version of the Day
Loading...
Searching...
No Matches
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>
23#include <Xpetra_MapFactory_fwd.hpp>
24
25#include "MueLu_ConfigDefs.hpp"
26
27#include "MueLu_BaseClass.hpp"
28
31
32namespace MueLu {
33
42template <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
81 RCP<const Map> getNodeRowMap() const { return nodeRowMap_; }
82 RCP<const Map> getNodeColMap() const { return nodeColMap_; }
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 */
91 RCP<Array<LO> > getRowTranslation() const { return rowTranslation_; }
92 RCP<Array<LO> > getColTranslation() const { return colTranslation_; }
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
105 Teuchos::RCP<Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > ComputeUnamalgamatedImportDofMap(const Aggregates& aggregates) const;
106
107 private:
108 void UnamalgamateAggregates(const Teuchos::RCP<const Map>& nodeMap,
109 const RCP<LOVector>& procWinnerVec,
110 const RCP<LOMultiVector>& vertex2AggIdVec,
111 const GO numAggregates,
112 Teuchos::ArrayRCP<LocalOrdinal>& aggStart,
113 Teuchos::ArrayRCP<GlobalOrdinal>& aggToRowMap) const;
114
115 void UnamalgamateAggregatesLO(const Teuchos::RCP<const Map>& nodeMap,
116 const RCP<LOVector>& procWinnerVec,
117 const RCP<LOMultiVector>& vertex2AggIdVec,
118 const GO numAggregates,
119 Teuchos::ArrayRCP<LocalOrdinal>& aggStart,
120 Teuchos::ArrayRCP<LO>& aggToRowMap) const;
121
122 Teuchos::RCP<Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > ComputeUnamalgamatedImportDofMap(const Teuchos::RCP<const Map>& nodeMap) const;
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
151 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
167 RCP<Array<LO> > rowTranslation_;
168 RCP<Array<LO> > colTranslation_;
169
171 RCP<const Map> nodeRowMap_;
172 RCP<const Map> nodeColMap_;
173
178 RCP<const Map> columnMap_;
179
181
183
191};
192
193} // namespace MueLu
194
195#define MUELU_AMALGAMATIONINFO_SHORT
196#endif /* MUELU_AMALGAMATIONINFO_DECL_HPP_ */
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Container class for aggregation information.
minimal container class for storing amalgamation information
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.
void UnamalgamateAggregatesLO(const Teuchos::RCP< const Map > &nodeMap, const RCP< LOVector > &procWinnerVec, const RCP< LOMultiVector > &vertex2AggIdVec, const GO numAggregates, Teuchos::ArrayRCP< LocalOrdinal > &aggStart, Teuchos::ArrayRCP< LO > &aggToRowMap) const
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
RCP< Array< LO > > getColTranslation() const
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
< returns the node row map for the graph
GO GlobalOffset()
returns offset of global dof ids
void UnamalgamateAggregatesLO(const Aggregates &aggregates, Teuchos::ArrayRCP< LocalOrdinal > &aggStart, Teuchos::ArrayRCP< LO > &aggToRowMap) const
RCP< const Map > nodeRowMap_
node row and column map of graph (built from row and column map of A)
std::string description() const
Return a simple one-line description of this object.
GO ComputeGlobalDOF(GO const &gNodeID, LO const &k=0) const
ComputeGlobalDOF.
Teuchos::RCP< Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > ComputeUnamalgamatedImportDofMap(const Aggregates &aggregates) const
ComputeUnamalgamatedImportDofMap build overlapping dof row map from aggregates needed for overlapping...
RCP< const Map > getNodeRowMap() const
void GetStridingInformation(LO &fullBlockSize, LO &blockID, LO &stridingOffset, LO &stridedBlockSize, GO &indexBase)
returns striding information
RCP< Array< LO > > rowTranslation_
Arrays containing local node ids given local dof ids.
RCP< Array< LO > > getRowTranslation() const
< returns the node column map for the graph
void UnamalgamateAggregates(const Aggregates &aggregates, Teuchos::ArrayRCP< LocalOrdinal > &aggStart, Teuchos::ArrayRCP< GlobalOrdinal > &aggToRowMap) const
UnamalgamateAggregates.
LO ComputeLocalNode(LocalOrdinal const &ldofID) const
Base class for MueLu classes.
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode