46#ifndef MUELU_AGGREGATES_DECL_HPP
47#define MUELU_AGGREGATES_DECL_HPP
51#include <Kokkos_StaticCrsGraph.hpp>
52#include <Tpetra_KokkosCompat_ClassicNodeAPI_Wrapper.hpp>
56#include <Xpetra_Map_fwd.hpp>
57#include <Xpetra_Vector_fwd.hpp>
58#include <Xpetra_VectorFactory_fwd.hpp>
59#include <Xpetra_MultiVector_fwd.hpp>
63#include "MueLu_LWGraph_kokkos.hpp"
64#include "MueLu_Graph.hpp"
66#include "MueLu_IndexManager.hpp"
67#include "MueLu_IndexManager_kokkos.hpp"
69#define MUELU_UNAGGREGATED -1
72#define MUELU_UNASSIGNED -1
105 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
108 template <
class LocalOrdinal,
class GlobalOrdinal,
class DeviceType>
114 using node_type = Tpetra::KokkosCompat::KokkosDeviceWrapperNode<DeviceType>;
116 using range_type = Kokkos::RangePolicy<local_ordinal_type, execution_space>;
117 using LO_view = Kokkos::View<local_ordinal_type*, device_type>;
124#undef MUELU_AGGREGATES_SHORT
132 typename local_graph_type::device_type::memory_space>;
269 const RCP<const Map> GetMap()
const;
280 typename aggregates_sizes_type::const_type ComputeAggregateSizes(
bool forceRecompute =
false)
const;
291 Teuchos::ArrayRCP<LocalOrdinal> ComputeAggregateSizesArrayRCP(
bool forceRecompute =
false)
const;
293 local_graph_type GetGraph()
const;
299 void ComputeNodesInAggregate(LO_view & aggPtr, LO_view & aggNodes, LO_view & unaggregated)
const;
303 GO GetNumGlobalAggregatesComputeIfNeeded();
309 std::string description()
const;
313 void print(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = verbLevel_default)
const;
375#define MUELU_AGGREGATES_SHORT
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultGlobalOrdinal GlobalOrdinal
typename DeviceType::execution_space execution_space
RCP< IndexManager_kokkos > geoDataKokkos_
void SetNumAggregates(LO nAggregates)
Set number of local aggregates on current processor.
Aggregates(const GraphBase &graph)
Standard constructor for Aggregates structure.
void SetIndexManager(RCP< IndexManager > &geoData)
Set the index manager used by various aggregation algorithms. This has to be done by the aggregation ...
typename LWGraph_kokkos::local_graph_type local_graph_type
KOKKOS_INLINE_FUNCTION bool AggregatesCrossProcessors() const
Return false if and only if no aggregates include DOFs from other processes.
colors_view_type graphColors_
const RCP< LOVector > & GetProcWinner() const
Returns constant vector that maps local node IDs to owning processor IDs.
LO numAggregates_
Number of aggregates on this processor.
RCP< LOVector > procWinner_
KOKKOS_INLINE_FUNCTION void AggregatesCrossProcessors(const bool &flag)
Record whether aggregates include DOFs from other processes.
aggregates_sizes_type::HostMirror aggregateSizesHost_
RCP< IndexManager > & GetIndexManager()
Get the index manager used by various aggregation algorithms. This has to be done by the aggregation ...
bool aggregatesIncludeGhosts_
Set to false iff aggregates do not include any DOFs belong to other processes.
local_graph_type graph_
Aggregates represented as Kokkos graph type.
aggregates_sizes_type aggregateSizes_
Array of sizes of each local aggregate.
Kokkos::View< typename local_graph_type::entries_type::data_type, typename local_graph_type::device_type::memory_space > colors_view_type
void SetGraphColors(colors_view_type graphColors)
Set a distance 2 coloring of the underlying graph. The coloring is computed and set during Phase1 of ...
void SetGraphNumColors(const LO graphNumColors)
Set the number of colors needed by the distance 2 coloring.
RCP< LOMultiVector > & GetVertex2AggIdNonConst()
Returns a nonconstant vector that maps local node IDs to local aggregates IDs.
LocalOrdinal local_ordinal_type
Kokkos::View< local_ordinal_type *, device_type > LO_view
virtual ~Aggregates()
Destructor.
Teuchos::ArrayRCP< bool > isRoot_
An ArrayRCP of booleans specifying if a local entry is an aggregate root.
RCP< LOMultiVector > vertex2AggId_
void SetIsRoot(LO i, bool value=true)
Set root node information.
RCP< IndexManager > geoData_
void SetIndexManagerKokkos(RCP< IndexManager_kokkos > &geoDataKokkos)
Set the index manager used by structured aggregation algorithms. This has to be done by the aggregati...
Kokkos::RangePolicy< local_ordinal_type, execution_space > range_type
RCP< IndexManager_kokkos > & GetIndexManagerKokkos()
Get the index manager used by structured aggregation algorithms. This has to be done by the aggregati...
RCP< LOVector > & GetProcWinnerNonConst()
Returns nonconstant vector that maps local node IDs to owning processor IDs.
LO GetGraphNumColors()
Get the number of colors needed by the distance 2 coloring.
Kokkos::View< LocalOrdinal *, device_type > aggregates_sizes_type
KOKKOS_INLINE_FUNCTION LO GetNumAggregates() const
MueLu::GraphBase< LocalOrdinal, GlobalOrdinal, Node > GraphBase
colors_view_type & GetGraphColors()
Get a distance 2 coloring of the underlying graph. The coloring is computed and set during Phase1 of ...
const RCP< LOMultiVector > & GetVertex2AggId() const
Returns constant vector that maps local node IDs to local aggregates IDs.
Tpetra::KokkosCompat::KokkosDeviceWrapperNode< DeviceType > node_type
void SetNumGlobalAggregates(GO nGlobalAggregates)
Set number of global aggregates on current processor.
GlobalOrdinal global_ordinal_type
bool IsRoot(LO i) const
Returns true if node with given local node id is marked to be a root node.
GO numGlobalAggregates_
Number of global aggregates.
Container class for aggregation information.
Base class for MueLu classes.
Lightweight MueLu representation of a compressed row storage graph.
Namespace for MueLu classes and methods.