10 #ifndef IFPACK2_OVERLAPGRAPH_HPP
11 #define IFPACK2_OVERLAPGRAPH_HPP
13 #include "Ifpack2_ConfigDefs.hpp"
14 #include "Tpetra_CrsGraph.hpp"
15 #include "Tpetra_Import.hpp"
17 #include "Ifpack2_CreateOverlapGraph.hpp"
39 template <class LocalOrdinal = typename Tpetra::CrsGraph<>::local_ordinal_type,
40 class GlobalOrdinal =
typename Tpetra::CrsGraph<LocalOrdinal>::global_ordinal_type,
41 class Node =
typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal>::node_type>
45 typedef Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>
graph_type;
63 const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>&
67 const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node>&
71 const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node>&
93 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
97 : UserMatrixGraph_(UserMatrixGraph_in)
98 , OverlapLevel_(OverlapLevel_in)
99 , IsOverlapped_(OverlapLevel_in > 0 && UserMatrixGraph_in->getDomainMap()->isDistributed()) {
103 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
106 : UserMatrixGraph_(Source.UserMatrixGraph_)
107 , OverlapRowMap_(Source.OverlapRowMap_)
108 , OverlapLevel_(Source.OverlapLevel_)
109 , IsOverlapped_(Source.IsOverlapped_) {
111 typedef Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> map_type;
114 if (!OverlapGraph_.
is_null()) {
117 if (!OverlapRowMap_.
is_null()) {
118 OverlapRowMap_ =
rcp(
new map_type(*OverlapRowMap_));
125 #endif // IFPACK2_OVERLAPGRAPH_HPP
Construct an overlapped graph from a given nonoverlapping graph.
Definition: Ifpack2_OverlapGraph.hpp:42
Teuchos::RCP< const GraphType > createOverlapGraph(const Teuchos::RCP< const GraphType > &inputGraph, const int overlapLevel)
Construct an overlapped graph for use with Ifpack2 preconditioners.
Definition: Ifpack2_CreateOverlapGraph.hpp:39
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > & getOverlapImporter() const
Return the Import object.
Definition: Ifpack2_OverlapGraph.hpp:72
const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > & getOverlapRowMap() const
Return the overlap graph's row Map.
Definition: Ifpack2_OverlapGraph.hpp:68
int OverlapLevel() const
Return the level of overlap used to create this graph.
Definition: Ifpack2_OverlapGraph.hpp:81
OverlapGraph(const Teuchos::RCP< const graph_type > &UserMatrixGraph_in, int OverlapLevel_in)
Constructor that takes a graph and the level of overlap.
Definition: Ifpack2_OverlapGraph.hpp:95
Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > graph_type
The Tpetra::CrsGraph specialization that this class uses.
Definition: Ifpack2_OverlapGraph.hpp:45
const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > & getOverlapGraph() const
Return the overlap graph.
Definition: Ifpack2_OverlapGraph.hpp:64
virtual ~OverlapGraph()
Destructor (virtual for memory safety of derived classes).
Definition: Ifpack2_OverlapGraph.hpp:60