IFPACK  Development
 All Classes Files Functions Variables Enumerations Friends Pages
Ifpack_IlukGraph.h
1 /*@HEADER
2 // ***********************************************************************
3 //
4 // Ifpack: Object-Oriented Algebraic Preconditioner Package
5 // Copyright (2002) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ***********************************************************************
40 //@HEADER
41 */
42 
43 #ifndef _IFPACK_ILUK_GRAPH_H_
44 #define _IFPACK_ILUK_GRAPH_H_
45 
46 #include "Ifpack_ConfigDefs.h"
47 #include "Epetra_Object.h"
48 #include "Epetra_CrsGraph.h"
49 #include "Epetra_Import.h"
50 
51 #include "Teuchos_RefCountPtr.hpp"
52 
53 namespace Teuchos {
54  class ParameterList;
55 }
56 
58 
78 
79  // Give ostream << function some access to private and protected data/functions.
80 
81  friend ostream& operator << (ostream& os, const Ifpack_IlukGraph& A);
82 
83  public:
84 
86 
99  Ifpack_IlukGraph(const Epetra_CrsGraph & Graph_in, int LevelFill_in, int LevelOverlap_in);
100 
102  Ifpack_IlukGraph(const Ifpack_IlukGraph & Graph_in);
103 
105  virtual ~Ifpack_IlukGraph();
106 
108  /* This method is only available if the Teuchos package is enabled.
109  This method recogizes two parameter names: Level_fill and Level_overlap.
110  Both are case insensitive, and in both cases the ParameterEntry must
111  have type int.
112  */
113  int SetParameters(const Teuchos::ParameterList& parameterlist,
114  bool cerr_warning_if_unused=false);
115 
117  /*
118  \return Integer error code, set to 0 if successful.
119 
120  */
121  virtual int ConstructFilledGraph();
122 
124  /*
125  \return Integer error code, set to 0 if successful.
126 
127  */
128  virtual int ConstructOverlapGraph();
129 
131  virtual int LevelFill() const {return(LevelFill_);};
132 
134  virtual int LevelOverlap() const {return(LevelOverlap_);};
135 
137  int NumGlobalBlockRows() const {return(NumGlobalBlockRows_);};
138 
140  int NumGlobalBlockCols() const {return(NumGlobalBlockCols_);};
141 
142 
144  int NumGlobalRows() const {return(NumGlobalRows_);};
145 
147  int NumGlobalCols() const {return(NumGlobalCols_);};
149  int NumGlobalNonzeros() const {return(NumGlobalNonzeros_);};
150 
152  virtual int NumGlobalBlockDiagonals() const {return(NumGlobalBlockDiagonals_);};
153 
155  int NumMyBlockRows() const {return(NumMyBlockRows_);};
156 
158  int NumMyBlockCols() const {return(NumMyBlockCols_);};
159 
160 
162  int NumMyRows() const {return(NumMyRows_);};
163 
165  int NumMyCols() const {return(NumMyCols_);};
166 
168  int NumMyNonzeros() const {return(NumMyNonzeros_);};
169 
171  virtual int NumMyBlockDiagonals() const {return(NumMyBlockDiagonals_);};
172 
174  int IndexBase() const {return(IndexBase_);};
175 
177  virtual Epetra_CrsGraph & L_Graph() {return(*L_Graph_);};
178 
180  virtual Epetra_CrsGraph & U_Graph() {return(*U_Graph_);};
181 
183  virtual Epetra_CrsGraph & L_Graph() const {return(*L_Graph_);};
184 
186  virtual Epetra_CrsGraph & U_Graph() const {return(*U_Graph_);};
187 
189  virtual Epetra_Import * OverlapImporter() const {return(&*OverlapImporter_);};
190 
192  virtual Epetra_CrsGraph * OverlapGraph() const {return(&*OverlapGraph_);};
193 
195  virtual const Epetra_BlockMap & DomainMap() const {return(DomainMap_);};
196 
198  virtual const Epetra_BlockMap & RangeMap() const{return(RangeMap_);};
199 
201  virtual const Epetra_Comm & Comm() const{return(Comm_);};
202 
203  private:
204 
205 
206  const Epetra_CrsGraph & Graph_;
207  const Epetra_BlockMap & DomainMap_;
208  const Epetra_BlockMap & RangeMap_;
209  const Epetra_Comm & Comm_;
210  Teuchos::RefCountPtr<Epetra_CrsGraph> OverlapGraph_;
211  Teuchos::RefCountPtr<Epetra_BlockMap> OverlapRowMap_;
212  Teuchos::RefCountPtr<Epetra_Import> OverlapImporter_;
213  int LevelFill_;
214  int LevelOverlap_;
215  Teuchos::RefCountPtr<Epetra_CrsGraph> L_Graph_;
216  Teuchos::RefCountPtr<Epetra_CrsGraph> U_Graph_;
217  int IndexBase_;
218  int NumGlobalRows_;
219  int NumGlobalCols_;
220  int NumGlobalBlockRows_;
221  int NumGlobalBlockCols_;
222  int NumGlobalBlockDiagonals_;
223  int NumGlobalNonzeros_;
224  int NumGlobalEntries_;
225  int NumMyBlockRows_;
226  int NumMyBlockCols_;
227  int NumMyRows_;
228  int NumMyCols_;
229  int NumMyBlockDiagonals_;
230  int NumMyNonzeros_;
231  int NumMyEntries_;
232 
233 
234  };
235 
237 ostream& operator << (ostream& os, const Ifpack_IlukGraph& A);
238 
239 #endif /* _IFPACK_ILUK_GRAPH_H_ */
virtual const Epetra_Comm & Comm() const
Returns the Epetra_BlockMap object associated with the range of this matrix operator.
virtual Epetra_CrsGraph & L_Graph() const
Returns the graph of lower triangle of the ILU(k) graph as a Epetra_CrsGraph.
Ifpack_IlukGraph(const Epetra_CrsGraph &Graph_in, int LevelFill_in, int LevelOverlap_in)
Ifpack_IlukGraph constuctor.
int NumMyCols() const
Returns the number of local matrix columns.
int NumMyBlockCols() const
Returns the number of local matrix columns.
virtual Epetra_CrsGraph & L_Graph()
Returns the graph of lower triangle of the ILU(k) graph as a Epetra_CrsGraph.
virtual Epetra_CrsGraph * OverlapGraph() const
Returns the the overlapped graph.
int SetParameters(const Teuchos::ParameterList &parameterlist, bool cerr_warning_if_unused=false)
Set parameters using Teuchos::ParameterList object.
int NumMyRows() const
Returns the number of local matrix rows.
Ifpack_IlukGraph: A class for constructing level filled graphs for use with ILU(k) class precondition...
int NumMyNonzeros() const
Returns the number of nonzero entries in the local graph.
int NumGlobalBlockCols() const
Returns the number of global matrix columns.
virtual const Epetra_BlockMap & RangeMap() const
Returns the Epetra_BlockMap object associated with the range of this matrix operator.
int IndexBase() const
Returns the index base for row and column indices for this graph.
virtual const Epetra_BlockMap & DomainMap() const
Returns the Epetra_BlockMap object associated with the domain of this matrix operator.
virtual int LevelFill() const
Returns the level of fill used to construct this graph.
virtual int ConstructOverlapGraph()
Does the actual construction of the overlap matrix graph.
virtual Epetra_CrsGraph & U_Graph()
Returns the graph of upper triangle of the ILU(k) graph as a Epetra_CrsGraph.
virtual int NumGlobalBlockDiagonals() const
Returns the number of diagonal entries found in the global input graph.
virtual int LevelOverlap() const
Returns the level of overlap used to construct this graph.
int NumGlobalRows() const
Returns the number of global matrix rows.
virtual Epetra_Import * OverlapImporter() const
Returns the importer used to create the overlapped graph.
int NumGlobalCols() const
Returns the number of global matrix columns.
virtual int NumMyBlockDiagonals() const
Returns the number of diagonal entries found in the local input graph.
friend ostream & operator<<(ostream &os, const Ifpack_IlukGraph &A)
&lt;&lt; operator will work for Ifpack_IlukGraph.
int NumGlobalNonzeros() const
Returns the number of nonzero entries in the global graph.
virtual Epetra_CrsGraph & U_Graph() const
Returns the graph of upper triangle of the ILU(k) graph as a Epetra_CrsGraph.
int NumGlobalBlockRows() const
Returns the number of global matrix rows.
virtual ~Ifpack_IlukGraph()
Ifpack_IlukGraph Destructor.
virtual int ConstructFilledGraph()
Does the actual construction of the graph.
int NumMyBlockRows() const
Returns the number of local matrix rows.