Ifpack2 Templated Preconditioning Package  Version 1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
List of all members
Ifpack2::Details::OverlappingRowGraph< GraphType > Class Template Reference

Sparse graph (Tpetra::RowGraph subclass) with ghost rows. More...

#include <Ifpack2_Details_OverlappingRowGraph_decl.hpp>

Inheritance diagram for Ifpack2::Details::OverlappingRowGraph< GraphType >:
Inheritance graph
[legend]

Public Types

Typedefs
typedef
GraphType::local_ordinal_type 
local_ordinal_type
 
typedef
GraphType::global_ordinal_type 
global_ordinal_type
 
typedef GraphType::node_type node_type
 
typedef
GraphType::local_inds_host_view_type 
local_inds_host_view_type
 
typedef
GraphType::nonconst_local_inds_host_view_type 
nonconst_local_inds_host_view_type
 
typedef
GraphType::global_inds_host_view_type 
global_inds_host_view_type
 
typedef
GraphType::nonconst_global_inds_host_view_type 
nonconst_global_inds_host_view_type
 
typedef Tpetra::Export
< local_ordinal_type,
global_ordinal_type, node_type > 
export_type
 
typedef Tpetra::Import
< local_ordinal_type,
global_ordinal_type, node_type > 
import_type
 
typedef Tpetra::Map
< local_ordinal_type,
global_ordinal_type, node_type > 
map_type
 
typedef Tpetra::RowGraph
< local_ordinal_type,
global_ordinal_type, node_type > 
row_graph_type
 
- Public Types inherited from Ifpack2::Details::RowGraph< GraphType >
typedef
GraphType::local_ordinal_type 
local_ordinal_type
 
typedef
GraphType::global_ordinal_type 
global_ordinal_type
 
typedef GraphType::node_type node_type
 
typedef
GraphType::local_inds_host_view_type 
local_inds_host_view_type
 
typedef
GraphType::nonconst_local_inds_host_view_type 
nonconst_local_inds_host_view_type
 
typedef
GraphType::global_inds_host_view_type 
global_inds_host_view_type
 
typedef
GraphType::nonconst_global_inds_host_view_type 
nonconst_global_inds_host_view_type
 

Public Member Functions

Constructors and destructor
 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)
 
virtual ~OverlappingRowGraph ()
 Destructor. More...
 
Matrix query methods
virtual Teuchos::RCP< const
Teuchos::Comm< int > > 
getComm () const
 The communicator over which the graph is distributed. More...
 
virtual Teuchos::RCP< const
map_type > 
getRowMap () const
 The Map that describes the distribution of rows over processes. More...
 
virtual Teuchos::RCP< const
map_type > 
getColMap () const
 The Map that describes the distribution of columns over processes. More...
 
virtual Teuchos::RCP< const
map_type > 
getDomainMap () const
 The Map that describes the domain of this graph. More...
 
virtual Teuchos::RCP< const
map_type > 
getRangeMap () const
 The Map that describes the range of this graph. More...
 
virtual Teuchos::RCP< const
import_type > 
getImporter () const
 Import object (from domain Map to column Map). More...
 
virtual Teuchos::RCP< const
export_type > 
getExporter () const
 Export object (from row Map to range Map). More...
 
virtual global_size_t getGlobalNumRows () const
 The global number of rows in this graph. More...
 
virtual global_size_t getGlobalNumCols () const
 The global number of columns in this graph. More...
 
virtual size_t getLocalNumRows () const
 The number of rows owned by the calling process. More...
 
virtual size_t getLocalNumCols () const
 The number of columns owned by the calling process. More...
 
virtual global_ordinal_type getIndexBase () const
 The index base for global indices for this graph. More...
 
virtual global_size_t getGlobalNumEntries () const
 The global number of entries in this graph. More...
 
virtual size_t getLocalNumEntries () const
 The number of entries in this graph owned by the calling process. More...
 
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. More...
 
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. More...
 
virtual size_t getGlobalMaxNumRowEntries () const
 The maximum number of entries in any row on any process. More...
 
virtual size_t getLocalMaxNumRowEntries () const
 The maximum number of entries in any row on the calling process. More...
 
virtual bool hasColMap () const
 Whether this graph has a column Map. More...
 
virtual bool isLocallyIndexed () const
 Whether this graph is locally indexed. More...
 
virtual bool isGloballyIndexed () const
 Whether this graph is globally indexed. More...
 
virtual bool isFillComplete () const
 true if fillComplete() has been called, else false. More...
 
Extraction methods
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. More...
 
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. More...
 
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. More...
 
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::ArrayView. More...
 
- Public Member Functions inherited from Ifpack2::Details::RowGraph< GraphType >
virtual ~RowGraph ()=default
 Destructor (virtual for memory safety of derived classes) More...
 

Detailed Description

template<class GraphType>
class Ifpack2::Details::OverlappingRowGraph< GraphType >

Sparse graph (Tpetra::RowGraph subclass) with ghost rows.

Template Parameters
GraphTypeTpetra::RowGraph or Tpetra::CrsGraph specialization.

This class is meant to be created by and used with OverlappingRowMatrix. It is the subclass of Tpetra::RowGraph returned by that class' getGraph() method.

Warning
This class is an implementation detail of Ifpack2. Users should not rely on its interface.

Constructor & Destructor Documentation

template<class GraphType >
Ifpack2::Details::OverlappingRowGraph< GraphType >::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 
)

Standard constructor.

Parameters
nonoverlappingGraph[in] Graph containing only the nonoverlapping rows.
overlappingGraph[in] Graph containing only the overlapping rows.
rowMap[in] Map which is the union of the row Maps of the two graphs.
colMap[in] Column Map.
numGlobalRows[in] Global number of rows.
numGlobalCols[in] Global number of columns.
numGlobalNonzeros[in] Global number of entries.
maxNumEntries[in] Max number of entries in any row owned by this process.
nonoverlappingImporter[in] Import from the nonoverlapping graph's row Map, to the row Map representing the entire graph (nonoverlapping + overlapping).
overlappingImporter[in] Import from the nonoverlapping graph's row Map, to the overlapping graph's row Map.
template<class GraphType >
Ifpack2::Details::OverlappingRowGraph< GraphType >::~OverlappingRowGraph ( )
virtual

Destructor.

Member Function Documentation

template<class GraphType >
Teuchos::RCP< const Teuchos::Comm< int > > Ifpack2::Details::OverlappingRowGraph< GraphType >::getComm ( ) const
virtual

The communicator over which the graph is distributed.

template<class GraphType >
Teuchos::RCP< const Tpetra::Map< typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type > > Ifpack2::Details::OverlappingRowGraph< GraphType >::getRowMap ( ) const
virtual

The Map that describes the distribution of rows over processes.

template<class GraphType >
Teuchos::RCP< const Tpetra::Map< typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type > > Ifpack2::Details::OverlappingRowGraph< GraphType >::getColMap ( ) const
virtual

The Map that describes the distribution of columns over processes.

template<class GraphType >
Teuchos::RCP< const Tpetra::Map< typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type > > Ifpack2::Details::OverlappingRowGraph< GraphType >::getDomainMap ( ) const
virtual

The Map that describes the domain of this graph.

The domain is the distribution of valid input vectors of apply(), for a matrix whose graph is *this.

template<class GraphType >
Teuchos::RCP< const Tpetra::Map< typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type > > Ifpack2::Details::OverlappingRowGraph< GraphType >::getRangeMap ( ) const
virtual

The Map that describes the range of this graph.

The range is the distribution of valid output vectors of apply(), for a matrix whose graph is *this.

template<class GraphType >
Teuchos::RCP< const Tpetra::Import< typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type > > Ifpack2::Details::OverlappingRowGraph< GraphType >::getImporter ( ) const
virtual

Import object (from domain Map to column Map).

template<class GraphType >
Teuchos::RCP< const Tpetra::Export< typename GraphType::local_ordinal_type, typename GraphType::global_ordinal_type, typename GraphType::node_type > > Ifpack2::Details::OverlappingRowGraph< GraphType >::getExporter ( ) const
virtual

Export object (from row Map to range Map).

template<class GraphType >
global_size_t Ifpack2::Details::OverlappingRowGraph< GraphType >::getGlobalNumRows ( ) const
virtual

The global number of rows in this graph.

template<class GraphType >
global_size_t Ifpack2::Details::OverlappingRowGraph< GraphType >::getGlobalNumCols ( ) const
virtual

The global number of columns in this graph.

template<class GraphType >
size_t Ifpack2::Details::OverlappingRowGraph< GraphType >::getLocalNumRows ( ) const
virtual

The number of rows owned by the calling process.

template<class GraphType >
size_t Ifpack2::Details::OverlappingRowGraph< GraphType >::getLocalNumCols ( ) const
virtual

The number of columns owned by the calling process.

This is the number of columns needed to apply the forward operator on the calling process, that is, the number of elements listed in the column Map on the calling process.

template<class GraphType >
GraphType::global_ordinal_type Ifpack2::Details::OverlappingRowGraph< GraphType >::getIndexBase ( ) const
virtual

The index base for global indices for this graph.

template<class GraphType >
Tpetra::global_size_t Ifpack2::Details::OverlappingRowGraph< GraphType >::getGlobalNumEntries ( ) const
virtual

The global number of entries in this graph.

template<class GraphType >
size_t Ifpack2::Details::OverlappingRowGraph< GraphType >::getLocalNumEntries ( ) const
virtual

The number of entries in this graph owned by the calling process.

template<class GraphType >
size_t Ifpack2::Details::OverlappingRowGraph< GraphType >::getNumEntriesInGlobalRow ( global_ordinal_type  globalRow) const
virtual

The number of entries in the given global row that are owned by the calling process.

Parameters
globalRow[in] Global index of the row.
Returns
Teuchos::OrdinalTraits<size_t>::invalid() if the specified row (either in the input graph or in the overlap graph) is not owned by the calling process, else the number of entries in that row that are owned by the calling process.
template<class GraphType >
size_t Ifpack2::Details::OverlappingRowGraph< GraphType >::getNumEntriesInLocalRow ( local_ordinal_type  localRow) const
virtual

The number of entries in the given local row that are owned by the calling process.

Parameters
globalRow[in] Local index of the row.
Returns
Teuchos::OrdinalTraits<size_t>::invalid() if the specified row (either in the input graph or in the overlap graph) is not owned by the calling process, else the number of entries in that row that are owned by the calling process.
template<class GraphType >
size_t Ifpack2::Details::OverlappingRowGraph< GraphType >::getGlobalMaxNumRowEntries ( ) const
virtual

The maximum number of entries in any row on any process.

template<class GraphType >
size_t Ifpack2::Details::OverlappingRowGraph< GraphType >::getLocalMaxNumRowEntries ( ) const
virtual

The maximum number of entries in any row on the calling process.

template<class GraphType >
bool Ifpack2::Details::OverlappingRowGraph< GraphType >::hasColMap ( ) const
virtual

Whether this graph has a column Map.

template<class GraphType >
bool Ifpack2::Details::OverlappingRowGraph< GraphType >::isLocallyIndexed ( ) const
virtual

Whether this graph is locally indexed.

template<class GraphType >
bool Ifpack2::Details::OverlappingRowGraph< GraphType >::isGloballyIndexed ( ) const
virtual

Whether this graph is globally indexed.

template<class GraphType >
bool Ifpack2::Details::OverlappingRowGraph< GraphType >::isFillComplete ( ) const
virtual

true if fillComplete() has been called, else false.

template<class GraphType >
void Ifpack2::Details::OverlappingRowGraph< GraphType >::getGlobalRowCopy ( global_ordinal_type  globalRow,
nonconst_global_inds_host_view_type &  gblColInds,
size_t &  numIndices 
) const
virtual

Copy out a list of column indices in the given global row that are owned by the calling process.

Parameters
globalRow[in] Global index of the row.
indices[out] Global column indices in that row that are owned by the calling process.
numIndices[out] Number of indices returned in indices.

This method throws std::runtime_error if indices is not large enough to hold the column indices in row globalRow. If row globalRow does not belong to this process, then indices is not modified and numIndices is set to Teuchos::OrdinalTraits<size_t>::invalid() on output.

template<class GraphType >
void Ifpack2::Details::OverlappingRowGraph< GraphType >::getLocalRowCopy ( local_ordinal_type  localRow,
nonconst_local_inds_host_view_type &  gblColInds,
size_t &  numIndices 
) const
virtual

Copy out a list of local column indices in the given local row that are owned by the calling process.

This method only makes sense to call if the graph has a column Map, since the local column indices are computed with respect to the column Map.

Parameters
localRow[in] Local index of the row.
indices[out] Local column indices in that row that are owned by the calling process.
numIndices[out] Number of indices returned in indices.

This method throws std::runtime_error if indices is not large enough to hold the column indices in row localRow. If row localRow does not belong to this process, then indices is not modified and numIndices is set to Teuchos::OrdinalTraits<size_t>::invalid() on output.

template<class GraphType >
void Ifpack2::Details::OverlappingRowGraph< GraphType >::getLocalRowView ( const local_ordinal_type  lclRow,
local_inds_host_view_type &  lclColInds 
) const
virtual

Get a constant, nonpersisting, locally indexed view of the given row of the graph.

The returned views of the column indices are not guaranteed to persist beyond the lifetime of this. Furthermore, some RowGraph implementations allow changing the values, or the indices and values. Any such changes invalidate the returned views.

This method only gets the entries in the given row that are stored on the calling process. Note that if the graph has an overlapping row Map, it is possible that the calling process does not store all the entries in that row.

Precondition
isLocallyIndexed () && supportsRowViews ()
Postcondition
indices.size () == getNumEntriesInGlobalRow (LocalRow)
Parameters
lclRow[in] Local index of the row.
lclColInds[out] Local indices of the columns in the row. If the given row is not a valid row index on the calling process, then the result has no entries (its size is zero).

Subclasses are expected to implement this method. We would have made this method pure virtual, but that would have broken backwards compatibility, since we added the method at least one major release after introducing this class.

template<class GraphType >
void Ifpack2::Details::OverlappingRowGraph< GraphType >::getGlobalRowView ( const global_ordinal_type  gblRow,
global_inds_host_view_type &  gblColInds 
) const
virtual

Get a const, non-persisting view of the given global row's global column indices, as a Teuchos::ArrayView.

Parameters
gblRow[in] Global index of the row.
gblColInds[out] Global column indices in the row. If the given row is not a valid row index on the calling process, then the result has no entries (its size is zero).
Precondition
! isLocallyIndexed()
Postcondition
gblColInds.size() == getNumEntriesInGlobalRow(gblRow)

Subclasses are expected to implement this method. We would have made this method pure virtual, but that would have broken backwards compatibility, since we added the method at least one major release after introducing this class.


The documentation for this class was generated from the following files: