43#ifndef IFPACK2_OVERLAPPINGROWGRAPH_DEF_HPP
44#define IFPACK2_OVERLAPPINGROWGRAPH_DEF_HPP
46#include <Ifpack2_Details_OverlappingRowGraph_decl.hpp>
47#include <Tpetra_Import.hpp>
48#include <Tpetra_Export.hpp>
54template<
class GraphType>
58 const Teuchos::RCP<const map_type>&
rowMap,
59 const Teuchos::RCP<const map_type>&
colMap,
79template<
class GraphType>
83template<
class GraphType>
84Teuchos::RCP<const Teuchos::Comm<int> >
87 return nonoverlappingGraph_->getComm ();
93template<
class GraphType>
94Teuchos::RCP<const Tpetra::Map<typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type> >
101template<
class GraphType>
102Teuchos::RCP<const Tpetra::Map<typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type> >
109template<
class GraphType>
110Teuchos::RCP<const Tpetra::Map<typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type> >
113 return nonoverlappingGraph_->getDomainMap ();
117template<
class GraphType>
118Teuchos::RCP<const Tpetra::Map<typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type> >
121 return nonoverlappingGraph_->getRangeMap ();
125template<
class GraphType>
126Teuchos::RCP<const Tpetra::Import<typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type> >
133template<
class GraphType>
134Teuchos::RCP<const Tpetra::Export<typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type> >
141template<
class GraphType>
144 return numGlobalRows_;
148template<
class GraphType>
151 return numGlobalCols_;
155template<
class GraphType>
158 return nonoverlappingGraph_->getNodeNumRows () +
159 overlappingGraph_->getNodeNumRows ();
163template<
class GraphType>
166 return this->getNodeNumRows ();
170template<
class GraphType>
171typename GraphType::global_ordinal_type
174 return nonoverlappingGraph_->getIndexBase ();
178template<
class GraphType>
181 return numGlobalNonzeros_;
185template<
class GraphType>
188 return nonoverlappingGraph_->getNodeNumEntries () +
189 overlappingGraph_->getNodeNumEntries ();
193template<
class GraphType>
199 if (
localRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
200 return Teuchos::OrdinalTraits<size_t>::invalid();
202 return getNumEntriesInLocalRow (
localRow);
207template<
class GraphType>
213 const size_t numMyRowsA = nonoverlappingGraph_->getNodeNumRows ();
215 return nonoverlappingGraph_->getNumEntriesInLocalRow (
localRow);
222template<
class GraphType>
225 throw std::runtime_error(
"Ifpack2::OverlappingRowGraph::getGlobalMaxNumRowEntries() not supported.");
229template<
class GraphType>
232 return maxNumEntries_;
236template<
class GraphType>
243template<
class GraphType>
250template<
class GraphType>
257template<
class GraphType>
263template<
class GraphType>
267 nonconst_global_inds_host_view_type&
indices,
271 if (
localRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
272 numIndices = Teuchos::OrdinalTraits<size_t>::invalid ();
274 if (Teuchos::as<size_t> (
localRow) < nonoverlappingGraph_->getNodeNumRows ()) {
282#ifdef TPETRA_ENABLE_DEPRECATED_CODE
283template<
class GraphType>
287 const Teuchos::ArrayView<global_ordinal_type>&
indices,
291 if (
localRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
292 numIndices = Teuchos::OrdinalTraits<size_t>::invalid ();
294 if (Teuchos::as<size_t> (localRow) < nonoverlappingGraph_->getNodeNumRows ()) {
295 nonoverlappingGraph_->getGlobalRowCopy (globalRow, indices, numIndices);
297 overlappingGraph_->getGlobalRowCopy (globalRow, indices, numIndices);
303template<
class GraphType>
307 nonconst_local_inds_host_view_type&
indices,
311 const size_t numMyRowsA = nonoverlappingGraph_->getNodeNumRows ();
322#ifdef TPETRA_ENABLE_DEPRECATED_CODE
323template<
class GraphType>
327 const Teuchos::ArrayView<local_ordinal_type>&
indices,
331 const size_t numMyRowsA = nonoverlappingGraph_->getNodeNumRows ();
335 const local_ordinal_type localRowOffset =
336 localRow - as<local_ordinal_type> (numMyRowsA);
337 overlappingGraph_->getLocalRowCopy (localRowOffset, indices, numIndices);
342template<
class GraphType>
346 global_inds_host_view_type &
indices)
const {
348 if (
LocalRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid()) {
349 indices = global_inds_host_view_type();
351 if (Teuchos::as<size_t> (
LocalRow) < nonoverlappingGraph_->getNodeNumRows ()) {
359#ifdef TPETRA_ENABLE_DEPRECATED_CODE
360template<
class GraphType>
364 Teuchos::ArrayView<const global_ordinal_type>&
indices)
const
367 if (
LocalRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid()) {
370 if (Teuchos::as<size_t> (LocalRow) < nonoverlappingGraph_->getNodeNumRows ()) {
371 nonoverlappingGraph_->getGlobalRowView (GlobalRow, indices);
373 overlappingGraph_->getGlobalRowView (GlobalRow, indices);
380template<
class GraphType>
384 local_inds_host_view_type &
indices)
const {
386 const size_t numMyRowsA = nonoverlappingGraph_->getNodeNumRows ();
396#ifdef TPETRA_ENABLE_DEPRECATED_CODE
397template<
class GraphType>
401 Teuchos::ArrayView<const local_ordinal_type>&
indices)
const
404 const size_t numMyRowsA = nonoverlappingGraph_->getNodeNumRows ();
408 overlappingGraph_->getLocalRowView (LocalRow - as<local_ordinal_type> (numMyRowsA),
418#define IFPACK2_DETAILS_OVERLAPPINGROWGRAPH_INSTANT(LO,GO,N) \
419 template class Ifpack2::Details::OverlappingRowGraph<Tpetra::CrsGraph< LO, GO, N > >; \
420 template class Ifpack2::Details::OverlappingRowGraph<Tpetra::RowGraph< LO, GO, N > >;
Ifpack2's implementation of Trilinos::Details::LinearSolver interface.
Definition Ifpack2_Details_LinearSolver_decl.hpp:110
virtual Teuchos::RCP< const map_type > getRangeMap() const
The Map that describes the range of this graph.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:119
virtual bool isLocallyIndexed() const
Whether this graph is locally indexed.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:244
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:210
virtual bool isGloballyIndexed() const
Whether this graph is globally indexed.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:251
virtual global_size_t getGlobalNumEntries() const
The global number of entries in this graph.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:179
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries in any row on any process.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:223
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:266
virtual size_t getNodeMaxNumRowEntries() const
The maximum number of entries in any row on the calling process.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:230
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:383
virtual bool isFillComplete() const
true if fillComplete() has been called, else false.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:258
virtual bool hasColMap() const
Whether this graph has a column Map.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:237
virtual Teuchos::RCP< const map_type > getRowMap() const
The Map that describes the distribution of rows over processes.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:95
virtual Teuchos::RCP< const import_type > getImporter() const
Import object (from domain Map to column Map).
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:127
virtual global_size_t getGlobalNumRows() const
The global number of rows in this graph.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:142
virtual Teuchos::RCP< const map_type > getColMap() const
The Map that describes the distribution of columns over processes.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:103
virtual size_t getNodeNumEntries() const
The number of entries in this graph owned by the calling process.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:186
virtual global_size_t getGlobalNumCols() const
The global number of columns in this graph.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:149
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's global column indices, as a Teuchos::Array...
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:345
virtual size_t getNodeNumCols() const
The number of columns owned by the calling process.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:164
virtual Teuchos::RCP< const map_type > getDomainMap() const
The Map that describes the domain of this graph.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:111
virtual ~OverlappingRowGraph()
Destructor.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:80
virtual size_t getNodeNumRows() const
The number of rows owned by the calling process.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:156
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The communicator over which the graph is distributed.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:85
virtual Teuchos::RCP< const export_type > getExporter() const
Export object (from row Map to range Map).
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:135
virtual global_ordinal_type getIndexBase() const
The index base for global indices for this graph.
Definition Ifpack2_Details_OverlappingRowGraph_def.hpp:172
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:56
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:196
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:306
Ifpack2 implementation details.
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:73