MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost > Class Template Reference

#include <MueLu_LWGraphBase.hpp>

Inheritance diagram for MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >:
MueLu::LWGraph< LocalOrdinal, GlobalOrdinal, Node >

Public Types

using local_ordinal_type = LocalOrdinal
 
using global_ordinal_type = GlobalOrdinal
 
using map_type = Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node >
 
using crs_graph_type = Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >
 
using size_type = size_t
 
using device_type = typename std::conditional< OnHost, Kokkos::Device< Kokkos::Serial, Kokkos::HostSpace >, typename Node::device_type >::type
 
using execution_space = typename device_type::execution_space
 
using memory_space = typename device_type::memory_space
 
using local_graph_device_type = KokkosSparse::StaticCrsGraph< LocalOrdinal, Kokkos::LayoutLeft, typename Node::device_type, void, size_t >
 
using local_graph_type = typename std::conditional< OnHost, typename local_graph_device_type::HostMirror, local_graph_device_type >::type
 
using boundary_nodes_type = Kokkos::View< bool *, memory_space >
 
using row_type = typename local_graph_type::row_map_type
 
using entries_type = typename local_graph_type::entries_type
 
using neighbor_vertices_type = KokkosSparse::GraphRowViewConst< local_graph_type >
 

Constructors/Destructors.

local_graph_type graph_
 Underlying graph (with label)
 
RCP< const map_typedomainMap_
 Graph maps.
 
RCP< const map_typeimportMap_
 
std::string objectLabel_
 Name of this graph.
 
boundary_nodes_type dirichletBoundaries_
 Boolean array marking Dirichlet rows.
 
LO minLocalIndex_
 Local index boundaries (cached from domain map)
 
LO maxLocalIndex_
 
size_type maxNumRowEntries_
 
void setup (const local_graph_type &graph, const RCP< const map_type > &domainMap, const RCP< const map_type > &importMap, const std::string &objectLabel)
 
 LWGraphBase (const local_graph_type &graph, const RCP< const map_type > &domainMap, const RCP< const map_type > &importMap, const std::string &objectLabel="")
 LWGraph constructor.
 
 LWGraphBase (const RCP< const crs_graph_type > &graph, const std::string &objectLabel="")
 
 LWGraphBase (const row_type &rows, const entries_type &columns, const RCP< const map_type > &domainMap, const RCP< const map_type > &importMap, const std::string &objectLabel="")
 
 ~LWGraphBase ()=default
 
const RCP< const Teuchos::Comm< int > > GetComm () const
 
const RCP< const Map > GetDomainMap () const
 
const RCP< const Map > GetImportMap () const
 Return overlapping import map (nodes).
 
KOKKOS_INLINE_FUNCTION size_type GetNodeNumVertices () const
 Return number of graph vertices.
 
KOKKOS_INLINE_FUNCTION size_type GetNodeNumEdges () const
 Return number of graph edges.
 
Xpetra::global_size_t GetGlobalNumEdges () const
 Return global number of graph edges.
 
KOKKOS_INLINE_FUNCTION size_type getLocalMaxNumRowEntries () const
 Returns the maximum number of entries across all rows/columns on this node.
 
KOKKOS_INLINE_FUNCTION neighbor_vertices_type getNeighborVertices (LO i) const
 Return the list of vertices adjacent to the vertex 'v'.
 
Teuchos::ArrayView< LO > getNeighborVertices_av (LO i) const
 Return the list of vertices adjacent to the vertex 'v'.
 
KOKKOS_INLINE_FUNCTION bool isLocalNeighborVertex (LO i) const
 Return true if vertex with local id 'v' is on current process.
 
KOKKOS_INLINE_FUNCTION row_type getRowPtrs () const
 Return the row pointers of the local graph.
 
KOKKOS_INLINE_FUNCTION entries_type getEntries () const
 Return the list entries in the local graph.
 
KOKKOS_INLINE_FUNCTION void SetBoundaryNodeMap (const boundary_nodes_type bndry)
 Set boolean array indicating which rows correspond to Dirichlet boundaries.
 
KOKKOS_INLINE_FUNCTION const boundary_nodes_type GetBoundaryNodeMap () const
 Returns map with global ids of boundary nodes.
 
std::string description () const
 Return a simple one-line description of the Graph.
 
void print (Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
 Print the Graph with some verbosity level to an FancyOStream object.
 
local_graph_typegetGraph () const
 
RCP< crs_graph_typeGetCrsGraph () const
 
const std::string & getObjectLabel () const
 

Detailed Description

template<class LocalOrdinal, class GlobalOrdinal, class Node, bool OnHost>
class MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >

Definition at line 72 of file MueLu_LWGraphBase.hpp.

Member Typedef Documentation

◆ local_ordinal_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::local_ordinal_type = LocalOrdinal

Definition at line 74 of file MueLu_LWGraphBase.hpp.

◆ global_ordinal_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::global_ordinal_type = GlobalOrdinal

Definition at line 75 of file MueLu_LWGraphBase.hpp.

◆ map_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::map_type = Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>

Definition at line 76 of file MueLu_LWGraphBase.hpp.

◆ crs_graph_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::crs_graph_type = Xpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>

Definition at line 77 of file MueLu_LWGraphBase.hpp.

◆ size_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::size_type = size_t

Definition at line 78 of file MueLu_LWGraphBase.hpp.

◆ device_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::device_type = typename std::conditional<OnHost, Kokkos::Device<Kokkos::Serial, Kokkos::HostSpace>, typename Node::device_type>::type

Definition at line 80 of file MueLu_LWGraphBase.hpp.

◆ execution_space

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::execution_space = typename device_type::execution_space

Definition at line 83 of file MueLu_LWGraphBase.hpp.

◆ memory_space

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::memory_space = typename device_type::memory_space

Definition at line 84 of file MueLu_LWGraphBase.hpp.

◆ local_graph_device_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::local_graph_device_type = KokkosSparse::StaticCrsGraph<LocalOrdinal, Kokkos::LayoutLeft, typename Node::device_type, void, size_t>

Definition at line 86 of file MueLu_LWGraphBase.hpp.

◆ local_graph_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::local_graph_type = typename std::conditional<OnHost, typename local_graph_device_type::HostMirror, local_graph_device_type>::type

Definition at line 93 of file MueLu_LWGraphBase.hpp.

◆ boundary_nodes_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::boundary_nodes_type = Kokkos::View<bool*, memory_space>

Definition at line 95 of file MueLu_LWGraphBase.hpp.

◆ row_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::row_type = typename local_graph_type::row_map_type

Definition at line 96 of file MueLu_LWGraphBase.hpp.

◆ entries_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::entries_type = typename local_graph_type::entries_type

Definition at line 97 of file MueLu_LWGraphBase.hpp.

◆ neighbor_vertices_type

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
using MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::neighbor_vertices_type = KokkosSparse::GraphRowViewConst<local_graph_type>

Definition at line 98 of file MueLu_LWGraphBase.hpp.

Constructor & Destructor Documentation

◆ LWGraphBase() [1/3]

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::LWGraphBase ( const local_graph_type graph,
const RCP< const map_type > &  domainMap,
const RCP< const map_type > &  importMap,
const std::string &  objectLabel = "" 
)
inline

LWGraph constructor.

Definition at line 132 of file MueLu_LWGraphBase.hpp.

◆ LWGraphBase() [2/3]

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::LWGraphBase ( const RCP< const crs_graph_type > &  graph,
const std::string &  objectLabel = "" 
)
inline

Definition at line 139 of file MueLu_LWGraphBase.hpp.

◆ LWGraphBase() [3/3]

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::LWGraphBase ( const row_type rows,
const entries_type columns,
const RCP< const map_type > &  domainMap,
const RCP< const map_type > &  importMap,
const std::string &  objectLabel = "" 
)
inline

Definition at line 164 of file MueLu_LWGraphBase.hpp.

◆ ~LWGraphBase()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::~LWGraphBase ( )
default

Member Function Documentation

◆ setup()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
void MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::setup ( const local_graph_type graph,
const RCP< const map_type > &  domainMap,
const RCP< const map_type > &  importMap,
const std::string &  objectLabel 
)
inlineprivate

Definition at line 107 of file MueLu_LWGraphBase.hpp.

◆ GetComm()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
const RCP< const Teuchos::Comm< int > > MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::GetComm ( ) const
inline

Definition at line 176 of file MueLu_LWGraphBase.hpp.

◆ GetDomainMap()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
const RCP< const Map > MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::GetDomainMap ( ) const
inline

Definition at line 179 of file MueLu_LWGraphBase.hpp.

◆ GetImportMap()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
const RCP< const Map > MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::GetImportMap ( ) const
inline

Return overlapping import map (nodes).

Definition at line 183 of file MueLu_LWGraphBase.hpp.

◆ GetNodeNumVertices()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
KOKKOS_INLINE_FUNCTION size_type MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::GetNodeNumVertices ( ) const
inline

Return number of graph vertices.

Definition at line 188 of file MueLu_LWGraphBase.hpp.

◆ GetNodeNumEdges()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
KOKKOS_INLINE_FUNCTION size_type MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::GetNodeNumEdges ( ) const
inline

Return number of graph edges.

Definition at line 193 of file MueLu_LWGraphBase.hpp.

◆ GetGlobalNumEdges()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
Xpetra::global_size_t MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::GetGlobalNumEdges ( ) const
inline

Return global number of graph edges.

Definition at line 198 of file MueLu_LWGraphBase.hpp.

◆ getLocalMaxNumRowEntries()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
KOKKOS_INLINE_FUNCTION size_type MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::getLocalMaxNumRowEntries ( ) const
inline

Returns the maximum number of entries across all rows/columns on this node.

Definition at line 205 of file MueLu_LWGraphBase.hpp.

◆ getNeighborVertices()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
KOKKOS_INLINE_FUNCTION neighbor_vertices_type MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::getNeighborVertices ( LO  i) const
inline

Return the list of vertices adjacent to the vertex 'v'.

Definition at line 210 of file MueLu_LWGraphBase.hpp.

◆ getNeighborVertices_av()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
Teuchos::ArrayView< LO > MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::getNeighborVertices_av ( LO  i) const
inline

Return the list of vertices adjacent to the vertex 'v'.

Definition at line 216 of file MueLu_LWGraphBase.hpp.

◆ isLocalNeighborVertex()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
KOKKOS_INLINE_FUNCTION bool MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::isLocalNeighborVertex ( LO  i) const
inline

Return true if vertex with local id 'v' is on current process.

Definition at line 223 of file MueLu_LWGraphBase.hpp.

◆ getRowPtrs()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
KOKKOS_INLINE_FUNCTION row_type MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::getRowPtrs ( ) const
inline

Return the row pointers of the local graph.

Definition at line 228 of file MueLu_LWGraphBase.hpp.

◆ getEntries()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
KOKKOS_INLINE_FUNCTION entries_type MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::getEntries ( ) const
inline

Return the list entries in the local graph.

Definition at line 233 of file MueLu_LWGraphBase.hpp.

◆ SetBoundaryNodeMap()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
KOKKOS_INLINE_FUNCTION void MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::SetBoundaryNodeMap ( const boundary_nodes_type  bndry)
inline

Set boolean array indicating which rows correspond to Dirichlet boundaries.

Definition at line 238 of file MueLu_LWGraphBase.hpp.

◆ GetBoundaryNodeMap()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
KOKKOS_INLINE_FUNCTION const boundary_nodes_type MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::GetBoundaryNodeMap ( ) const
inline

Returns map with global ids of boundary nodes.

Definition at line 243 of file MueLu_LWGraphBase.hpp.

◆ description()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
std::string MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::description ( ) const
inline

Return a simple one-line description of the Graph.

Definition at line 248 of file MueLu_LWGraphBase.hpp.

◆ print()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
void MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::print ( Teuchos::FancyOStream &  out,
const VerbLevel  verbLevel = Default 
) const
inline

Print the Graph with some verbosity level to an FancyOStream object.

Definition at line 253 of file MueLu_LWGraphBase.hpp.

◆ getGraph()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
local_graph_type & MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::getGraph ( ) const
inline

Definition at line 285 of file MueLu_LWGraphBase.hpp.

◆ GetCrsGraph()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
RCP< crs_graph_type > MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::GetCrsGraph ( ) const
inline

Definition at line 289 of file MueLu_LWGraphBase.hpp.

◆ getObjectLabel()

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
const std::string & MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::getObjectLabel ( ) const
inline

Definition at line 305 of file MueLu_LWGraphBase.hpp.

Member Data Documentation

◆ graph_

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
local_graph_type MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::graph_
mutableprivate

Underlying graph (with label)

Definition at line 311 of file MueLu_LWGraphBase.hpp.

◆ domainMap_

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
RCP<const map_type> MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::domainMap_
private

Graph maps.

Definition at line 314 of file MueLu_LWGraphBase.hpp.

◆ importMap_

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
RCP<const map_type> MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::importMap_
private

Definition at line 315 of file MueLu_LWGraphBase.hpp.

◆ objectLabel_

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
std::string MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::objectLabel_
private

Name of this graph.

Definition at line 318 of file MueLu_LWGraphBase.hpp.

◆ dirichletBoundaries_

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
boundary_nodes_type MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::dirichletBoundaries_
private

Boolean array marking Dirichlet rows.

Definition at line 321 of file MueLu_LWGraphBase.hpp.

◆ minLocalIndex_

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
LO MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::minLocalIndex_
private

Local index boundaries (cached from domain map)

Definition at line 324 of file MueLu_LWGraphBase.hpp.

◆ maxLocalIndex_

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
LO MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::maxLocalIndex_
private

Definition at line 324 of file MueLu_LWGraphBase.hpp.

◆ maxNumRowEntries_

template<class LocalOrdinal , class GlobalOrdinal , class Node , bool OnHost>
size_type MueLu::LWGraphBase< LocalOrdinal, GlobalOrdinal, Node, OnHost >::maxNumRowEntries_
private

Definition at line 325 of file MueLu_LWGraphBase.hpp.


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