IFPACK  Development
 All Classes Namespaces Files Functions Variables Enumerations Friends Pages
Ifpack_Partitioner.h
1 /*
2 //@HEADER
3 // ***********************************************************************
4 //
5 // Ifpack: Object-Oriented Algebraic Preconditioner Package
6 // Copyright (2002) Sandia Corporation
7 //
8 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9 // license for use of this work by or on behalf of the U.S. Government.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ***********************************************************************
41 //@HEADER
42 */
43 
44 #ifndef IFPACK_PARTITIONER_H
45 #define IFPACK_PARTITIONER_H
46 
47 #include "Ifpack_ConfigDefs.h"
48 #include "Teuchos_ParameterList.hpp"
49 class Epetra_Comm;
50 class Ifpack_Graph;
51 class Epetra_Map;
52 class Epetra_BlockMap;
53 class Epetra_Import;
54 
56 
163 
164 public:
165 
167  virtual ~Ifpack_Partitioner() {};
168 
170  virtual int NumLocalParts() const = 0;
171 
173  virtual int OverlappingLevel() const = 0;
174 
176 
183  virtual int operator() (int MyRow) const = 0;
184 
186  virtual int operator() (int i, int j) const = 0;
187 
189  virtual int NumRowsInPart(const int Part) const = 0;
190 
192  virtual int RowsInPart(const int Part, int* List) const = 0;
193 
195  virtual const int* NonOverlappingPartition() const = 0;
196 
198  virtual int SetParameters(Teuchos::ParameterList& List) = 0;
199 
201  virtual int Compute() = 0;
202 
204  virtual bool IsComputed() = 0;
205 
207  virtual std::ostream& Print(std::ostream& os) const = 0;
208 
209 }; // class Ifpack_Partitioner
210 
211 inline std::ostream& operator<<(std::ostream& os, const Ifpack_Partitioner& obj)
212 {
213  return(obj.Print(os));
214 }
215 
216 #endif // IFPACK_PARTITIONER_H
Ifpack_Partitioner: A class to decompose local Ifpack_Graph&#39;s.
virtual int operator()(int MyRow) const =0
Returns the local non-overlapping partition ID of the specified row.
virtual int NumLocalParts() const =0
Returns the number of computed local partitions.
virtual int Compute()=0
Computes the partitions. Returns 0 if successful.
virtual int SetParameters(Teuchos::ParameterList &List)=0
Sets all the parameters for the partitioner.
virtual int OverlappingLevel() const =0
Returns the overlapping level.
Ifpack_Graph: a pure virtual class that defines graphs for IFPACK.
Definition: Ifpack_Graph.h:61
virtual bool IsComputed()=0
Returns true if partitions have been computed successfully.
virtual int NumRowsInPart(const int Part) const =0
Returns the number of rows contained in specified partition.
virtual ~Ifpack_Partitioner()
Destructor.
virtual std::ostream & Print(std::ostream &os) const =0
Prints basic information about the partitioning object.
virtual int RowsInPart(const int Part, int *List) const =0
Copies into List the rows in the (overlapping) partition Part.
virtual const int * NonOverlappingPartition() const =0
Returns a pointer to the integer vector containing the non-overlapping partition ID of each local row...