Ifpack2 Templated Preconditioning Package  Version 1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Ifpack2_OverlappingPartitioner_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_OVERLAPPINGPARTITIONER_DECL_HPP
11 #define IFPACK2_OVERLAPPINGPARTITIONER_DECL_HPP
12 
13 #include "Ifpack2_ConfigDefs.hpp"
14 #include "Ifpack2_Partitioner.hpp"
15 #include "Tpetra_RowGraph.hpp"
16 
17 namespace Ifpack2 {
18 
44 template<class GraphType>
45 class OverlappingPartitioner : public Partitioner<GraphType> {
46 public:
47  typedef typename GraphType::local_ordinal_type local_ordinal_type;
48  typedef typename GraphType::global_ordinal_type global_ordinal_type;
49  typedef typename GraphType::node_type node_type;
50  typedef typename GraphType::nonconst_global_inds_host_view_type nonconst_global_inds_host_view_type;
51  typedef typename GraphType::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
52 
53  typedef Tpetra::RowGraph<local_ordinal_type, global_ordinal_type, node_type> row_graph_type;
54 
57 
59  virtual ~OverlappingPartitioner();
60 
66  int numLocalParts () const;
67 
69  int overlappingLevel() const;
70 
74  local_ordinal_type operator () (const local_ordinal_type MyRow) const;
75 
77  local_ordinal_type
78  operator () (const local_ordinal_type i, const local_ordinal_type j) const;
79 
81  size_t numRowsInPart (const local_ordinal_type Part) const;
82 
84  void rowsInPart (const local_ordinal_type Part, Teuchos::ArrayRCP<local_ordinal_type>& List) const;
85 
88  nonOverlappingPartition () const;
89 
91 
96  virtual void setParameters (Teuchos::ParameterList& List);
97 
99 
103  virtual void setPartitionParameters (Teuchos::ParameterList& List) = 0;
104 
106  virtual void compute();
107 
109  virtual void computePartitions() = 0;
110 
112  virtual void computeOverlappingPartitions();
113 
115  virtual bool isComputed() const;
116 
118  virtual std::ostream& print(std::ostream& os) const;
119 
121 
122 
124  std::string description() const;
125 
128 
130 
131 protected:
132 
139 
146 
153 
156 
159 
162 
164  bool verbose_;
165 
171 }; // class Ifpack2::OverlappingPartitioner
172 
173 }// namespace Ifpack2
174 
175 #endif // IFPACK2_OVERLAPPINGPARTITIONER_DECL_HPP
Teuchos::Array< local_ordinal_type > Partition_
Mapping from local row to partition number.
Definition: Ifpack2_OverlappingPartitioner_decl.hpp:145
Teuchos::Array< Teuchos::ArrayRCP< local_ordinal_type > > Parts_
Mapping from partition to all rows it contains.
Definition: Ifpack2_OverlappingPartitioner_decl.hpp:152
void rowsInPart(const local_ordinal_type Part, Teuchos::ArrayRCP< local_ordinal_type > &List) const
Fill List with the local indices of the rows in the (overlapping) partition Part. ...
Definition: Ifpack2_OverlappingPartitioner_def.hpp:105
virtual Teuchos::ArrayView< const local_ordinal_type > nonOverlappingPartition() const
A view of the local indices of the nonoverlapping partitions of each local row.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:118
OverlappingPartitioner(const Teuchos::RCP< const row_graph_type > &graph)
Constructor.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:24
int OverlappingLevel_
Level of overlap.
Definition: Ifpack2_OverlappingPartitioner_decl.hpp:158
int overlappingLevel() const
The number of levels of overlap.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:47
int numLocalParts() const
Number of computed local partitions.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:40
Ifpack2::Partitioner:
Definition: Ifpack2_Partitioner.hpp:146
Teuchos::RCP< const row_graph_type > Graph_
The graph to be partitioned.
Definition: Ifpack2_OverlappingPartitioner_decl.hpp:155
virtual void computeOverlappingPartitions()
Computes the partitions. Returns 0 if successful.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:219
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:442
virtual ~OverlappingPartitioner()
Destructor.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:35
virtual bool isComputed() const
Returns true if partitions have been computed successfully.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:408
int NumLocalParts_
Number of local subgraphs.
Definition: Ifpack2_OverlappingPartitioner_decl.hpp:138
std::string description() const
Return a simple one-line description of this object.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:426
virtual void computePartitions()=0
Computes the partitions. Returns 0 if successful.
static const EVerbosityLevel verbLevel_default
virtual void compute()
Computes the partitions. Returns 0 if successful.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:167
virtual std::ostream & print(std::ostream &os) const
Prints basic information on iostream. This function is used by operator&lt;&lt;.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:416
local_ordinal_type operator()(const local_ordinal_type MyRow) const
Local index of the nonoverlapping partition of the given row.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:56
bool verbose_
If true, information are reported to stdout.
Definition: Ifpack2_OverlappingPartitioner_decl.hpp:164
virtual void setParameters(Teuchos::ParameterList &List)
Set all the parameters for the partitioner.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:127
bool maintainSparsity_
If true, only add row to partition (block) if doing so won&#39;t add new columns to the column map...
Definition: Ifpack2_OverlappingPartitioner_decl.hpp:170
size_t numRowsInPart(const local_ordinal_type Part) const
the number of rows contained in the given partition.
Definition: Ifpack2_OverlappingPartitioner_def.hpp:91
Create overlapping partitions of a local graph.
Definition: Ifpack2_OverlappingPartitioner_decl.hpp:45
virtual void setPartitionParameters(Teuchos::ParameterList &List)=0
Set all the parameters for the partitioner.
bool IsComputed_
If true, the graph has been successfully partitioned.
Definition: Ifpack2_OverlappingPartitioner_decl.hpp:161