Ifpack2 Templated Preconditioning Package  Version 1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Ifpack2_Details_OverlappingRowGraph_decl.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
4 //
5 // Copyright 2009 NTESS and the Ifpack2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef IFPACK2_DETAILS_OVERLAPPINGROWGRAPH_DECL_HPP
11 #define IFPACK2_DETAILS_OVERLAPPINGROWGRAPH_DECL_HPP
12 
13 #include <Ifpack2_ConfigDefs.hpp>
14 #include "Ifpack2_Details_RowGraph.hpp"
15 #include <Tpetra_Import_decl.hpp>
16 #include <Tpetra_Export_decl.hpp>
17 
18 namespace Ifpack2 {
19 namespace Details {
20 
31 template <class GraphType>
32 class OverlappingRowGraph : virtual public Ifpack2::Details::RowGraph<GraphType> {
33  public:
35 
36  typedef typename GraphType::local_ordinal_type local_ordinal_type;
37  typedef typename GraphType::global_ordinal_type global_ordinal_type;
38  typedef typename GraphType::node_type node_type;
39  typedef typename GraphType::local_inds_host_view_type local_inds_host_view_type;
40  typedef typename GraphType::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
41  typedef typename GraphType::global_inds_host_view_type global_inds_host_view_type;
42  typedef typename GraphType::nonconst_global_inds_host_view_type nonconst_global_inds_host_view_type;
43 
44  typedef Tpetra::Export<local_ordinal_type, global_ordinal_type, node_type> export_type;
45  typedef Tpetra::Import<local_ordinal_type, global_ordinal_type, node_type> import_type;
46  typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
47  typedef Tpetra::RowGraph<local_ordinal_type, global_ordinal_type, node_type> row_graph_type;
48 
50 
52 
73  const Teuchos::RCP<const row_graph_type>& overlappingGraph,
74  const Teuchos::RCP<const map_type>& rowMap,
75  const Teuchos::RCP<const map_type>& colMap,
76  const Tpetra::global_size_t numGlobalRows,
77  const Tpetra::global_size_t numGlobalCols,
78  const Tpetra::global_size_t numGlobalNonzeros,
79  const size_t maxNumEntries,
80  const Teuchos::RCP<const import_type>& nonoverlappingImporter,
81  const Teuchos::RCP<const import_type>& overlappingImporter);
83  virtual ~OverlappingRowGraph();
84 
86 
88 
91 
94 
97 
103 
109 
112 
115 
117  virtual global_size_t getGlobalNumRows() const;
118 
120  virtual global_size_t getGlobalNumCols() const;
121 
123  virtual size_t getLocalNumRows() const;
124 
130  virtual size_t getLocalNumCols() const;
131 
133  virtual global_ordinal_type getIndexBase() const;
134 
136  virtual global_size_t getGlobalNumEntries() const;
137 
139  virtual size_t getLocalNumEntries() const;
140 
150  virtual size_t getNumEntriesInGlobalRow(global_ordinal_type globalRow) const;
151 
161  virtual size_t getNumEntriesInLocalRow(local_ordinal_type localRow) const;
162 
164  virtual size_t getGlobalMaxNumRowEntries() const;
165 
167  virtual size_t getLocalMaxNumRowEntries() const;
168 
170  virtual bool hasColMap() const;
171 
173  virtual bool isLocallyIndexed() const;
174 
176  virtual bool isGloballyIndexed() const;
177 
179  virtual bool isFillComplete() const;
180 
182 
184 
198  virtual void
199  getGlobalRowCopy(global_ordinal_type globalRow,
200  nonconst_global_inds_host_view_type& gblColInds,
201  size_t& numIndices) const;
202 
220  virtual void
221  getLocalRowCopy(local_ordinal_type localRow,
222  nonconst_local_inds_host_view_type& gblColInds,
223  size_t& numIndices) const;
224 
252  virtual void
253  getLocalRowView(const local_ordinal_type lclRow,
254  local_inds_host_view_type& lclColInds) const;
255 
271  virtual void
272  getGlobalRowView(const global_ordinal_type gblRow,
273  global_inds_host_view_type& gblColInds) const;
274 
276  private:
278 
279  Teuchos::RCP<const row_graph_type> nonoverlappingGraph_;
280  Teuchos::RCP<const row_graph_type> overlappingGraph_;
283  const Tpetra::global_size_t numGlobalRows_;
284  const Tpetra::global_size_t numGlobalCols_;
285  const Tpetra::global_size_t numGlobalNonzeros_;
286  const size_t maxNumEntries_;
287  Teuchos::RCP<const import_type> nonoverlappingImporter_;
288  Teuchos::RCP<const import_type> overlappingImporter_;
290 };
291 
292 } // namespace Details
293 } // namespace Ifpack2
294 
295 #endif // IFPACK2_DETAILS_OVERLAPPINGROWGRAPH_DECL_HPP
OverlappingRowGraph(const Teuchos::RCP< const row_graph_type > &nonoverlappingGraph, const Teuchos::RCP< const row_graph_type > &overlappingGraph, const Teuchos::RCP< const map_type > &rowMap, const Teuchos::RCP< const map_type > &colMap, const Tpetra::global_size_t numGlobalRows, const Tpetra::global_size_t numGlobalCols, const Tpetra::global_size_t numGlobalNonzeros, const size_t maxNumEntries, const Teuchos::RCP< const import_type > &nonoverlappingImporter, const Teuchos::RCP< const import_type > &overlappingImporter)
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:22
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries in any row on any process.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:152
virtual Teuchos::RCP< const map_type > getRowMap() const
The Map that describes the distribution of rows over processes.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:54
virtual bool isGloballyIndexed() const
Whether this graph is globally indexed.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:172
virtual bool hasColMap() const
Whether this graph has a column Map.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:162
virtual Teuchos::RCP< const export_type > getExporter() const
Export object (from row Map to range Map).
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:84
virtual void getLocalRowView(const local_ordinal_type lclRow, local_inds_host_view_type &lclColInds) const
Get a constant, nonpersisting, locally indexed view of the given row of the graph.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:232
virtual void getLocalRowCopy(local_ordinal_type localRow, nonconst_local_inds_host_view_type &gblColInds, size_t &numIndices) const
Copy out a list of local column indices in the given local row that are owned by the calling process...
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:200
virtual global_ordinal_type getIndexBase() const
The index base for global indices for this graph.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:111
virtual void getGlobalRowView(const global_ordinal_type gblRow, global_inds_host_view_type &gblColInds) const
Get a const, non-persisting view of the given global row&#39;s global column indices, as a Teuchos::Array...
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:216
All Ifpack2 implementations of Tpetra::RowGraph must inherit from this class.
Definition: Ifpack2_Details_RowGraph.hpp:30
virtual Teuchos::RCP< const map_type > getDomainMap() const
The Map that describes the domain of this graph.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:66
Sparse graph (Tpetra::RowGraph subclass) with ghost rows.
Definition: Ifpack2_Details_OverlappingRowGraph_decl.hpp:32
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The communicator over which the graph is distributed.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:48
virtual size_t getLocalNumCols() const
The number of columns owned by the calling process.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:105
virtual size_t getLocalNumEntries() const
The number of entries in this graph owned by the calling process.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:121
virtual ~OverlappingRowGraph()
Destructor.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:44
virtual bool isLocallyIndexed() const
Whether this graph is locally indexed.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:167
virtual bool isFillComplete() const
true if fillComplete() has been called, else false.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:177
virtual global_size_t getGlobalNumCols() const
The global number of columns in this graph.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:94
virtual size_t getNumEntriesInLocalRow(local_ordinal_type localRow) const
The number of entries in the given local row that are owned by the calling process.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:141
virtual size_t getLocalNumRows() const
The number of rows owned by the calling process.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:99
virtual void getGlobalRowCopy(global_ordinal_type globalRow, nonconst_global_inds_host_view_type &gblColInds, size_t &numIndices) const
Copy out a list of column indices in the given global row that are owned by the calling process...
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:183
virtual Teuchos::RCP< const import_type > getImporter() const
Import object (from domain Map to column Map).
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:78
virtual size_t getLocalMaxNumRowEntries() const
The maximum number of entries in any row on the calling process.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:157
virtual Teuchos::RCP< const map_type > getColMap() const
The Map that describes the distribution of columns over processes.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:60
virtual global_size_t getGlobalNumRows() const
The global number of rows in this graph.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:89
virtual Teuchos::RCP< const map_type > getRangeMap() const
The Map that describes the range of this graph.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:72
virtual global_size_t getGlobalNumEntries() const
The global number of entries in this graph.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:116
virtual size_t getNumEntriesInGlobalRow(global_ordinal_type globalRow) const
The number of entries in the given global row that are owned by the calling process.
Definition: Ifpack2_Details_OverlappingRowGraph_def.hpp:129