Ifpack2 Templated Preconditioning Package  Version 1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Ifpack2_Partitioner.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_PARTITIONER_HPP
11 #define IFPACK2_PARTITIONER_HPP
12 
13 #include "Ifpack2_ConfigDefs.hpp"
15 #include "Teuchos_ArrayRCP.hpp"
16 #include <iostream>
17 
18 namespace Ifpack2 {
19 
21 
145 template <class GraphType>
147 public:
148  typedef typename GraphType::local_ordinal_type LocalOrdinal;
149  typedef typename GraphType::global_ordinal_type GlobalOrdinal;
150  typedef typename GraphType::node_type Node;
151 
153  virtual ~Partitioner() {};
154 
159  virtual int numLocalParts () const = 0;
160 
162  virtual int overlappingLevel() const = 0;
163 
168  virtual LocalOrdinal operator() (LocalOrdinal MyRow) const = 0;
169 
171  virtual LocalOrdinal operator() (LocalOrdinal i, LocalOrdinal j) const = 0;
172 
174  virtual size_t numRowsInPart (const LocalOrdinal Part) const = 0;
175 
177  virtual void
178  rowsInPart (const LocalOrdinal Part,
179  Teuchos::ArrayRCP<LocalOrdinal>& List) const = 0;
180 
183  nonOverlappingPartition () const = 0;
184 
186  virtual void setParameters (Teuchos::ParameterList& List) = 0;
187 
189  virtual void compute () = 0;
190 
192  virtual bool isComputed () const = 0;
193 
195  virtual std::ostream& print (std::ostream& os) const = 0;
196 
197 };
198 
199 // Overloaded output stream operator for Partitioner
200 template <class GraphType>
201 inline std::ostream&
202 operator<< (std::ostream& os,
204 {
205  return obj.print (os);
206 }
207 
208 } // namespace Ifpack2
209 
210 #endif // IFPACK2_PARTITIONER_HPP
virtual void rowsInPart(const LocalOrdinal Part, Teuchos::ArrayRCP< LocalOrdinal > &List) const =0
Copy into List the rows in the (overlapping) partition Part.
virtual std::ostream & print(std::ostream &os) const =0
Print basic information about the partitioning object.
virtual ~Partitioner()
Destructor.
Definition: Ifpack2_Partitioner.hpp:153
virtual bool isComputed() const =0
Return true if partitions have been computed successfully.
Ifpack2::Partitioner:
Definition: Ifpack2_Partitioner.hpp:146
virtual int numLocalParts() const =0
Number of computed local partitions.
virtual LocalOrdinal operator()(LocalOrdinal MyRow) const =0
The local (nonoverlapping) partition index of the specified local row.
virtual int overlappingLevel() const =0
The level of overlap.
virtual size_t numRowsInPart(const LocalOrdinal Part) const =0
The number of rows contained in the specified partition.
virtual void compute()=0
Compute the partitions.
virtual Teuchos::ArrayView< const LocalOrdinal > nonOverlappingPartition() const =0
The nonoverlapping partition indices of each local row.
virtual void setParameters(Teuchos::ParameterList &List)=0
Set all the parameters for the partitioner.