00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef _IFPACK_ILUK_GRAPH_H_
00044 #define _IFPACK_ILUK_GRAPH_H_
00045
00046 #include "Ifpack_ConfigDefs.h"
00047 #include "Epetra_Object.h"
00048 #include "Epetra_CrsGraph.h"
00049 #include "Epetra_Import.h"
00050
00051 #include "Teuchos_RefCountPtr.hpp"
00052
00053 namespace Teuchos {
00054 class ParameterList;
00055 }
00056
00058
00077 class Ifpack_IlukGraph {
00078
00079
00080
00081 friend ostream& operator << (ostream& os, const Ifpack_IlukGraph& A);
00082
00083 public:
00084
00086
00099 Ifpack_IlukGraph(const Epetra_CrsGraph & Graph_in, int LevelFill_in, int LevelOverlap_in);
00100
00102 Ifpack_IlukGraph(const Ifpack_IlukGraph & Graph_in);
00103
00105 virtual ~Ifpack_IlukGraph();
00106
00108
00109
00110
00111
00112
00113 int SetParameters(const Teuchos::ParameterList& parameterlist,
00114 bool cerr_warning_if_unused=false);
00115
00117
00118
00119
00120
00121 virtual int ConstructFilledGraph();
00122
00124
00125
00126
00127
00128 virtual int ConstructOverlapGraph();
00129
00131 virtual int LevelFill() const {return(LevelFill_);};
00132
00134 virtual int LevelOverlap() const {return(LevelOverlap_);};
00135
00136 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
00137
00138 int NumGlobalBlockRows() const {
00139 if(Graph_.RowMap().GlobalIndicesInt())
00140 return (int)(NumGlobalBlockRows_);
00141 else
00142 throw "Ifpack_IlukGraph::NumGlobalBlockRows: GlobalIndices not int.";
00143 }
00144
00146 int NumGlobalBlockCols() const {
00147 if(Graph_.RowMap().GlobalIndicesInt())
00148 return (int)(NumGlobalBlockCols_);
00149 else
00150 throw "Ifpack_IlukGraph::NumGlobalBlockCols: GlobalIndices not int.";
00151 }
00152
00154 int NumGlobalRows() const {
00155 if(Graph_.RowMap().GlobalIndicesInt())
00156 return (int)(NumGlobalRows_);
00157 else
00158 throw "Ifpack_IlukGraph::NumGlobalRows: GlobalIndices not int.";
00159 }
00160
00162 int NumGlobalCols() const {
00163 if(Graph_.RowMap().GlobalIndicesInt())
00164 return (int)(NumGlobalCols_);
00165 else
00166 throw "Ifpack_IlukGraph::NumGlobalCols: GlobalIndices not int.";
00167 }
00169 int NumGlobalNonzeros() const {
00170 if(Graph_.RowMap().GlobalIndicesInt())
00171 return (int)(NumGlobalNonzeros_);
00172 else
00173 throw "Ifpack_IlukGraph::NumGlobalNonzeros: GlobalIndices not int.";
00174 }
00175
00177 virtual int NumGlobalBlockDiagonals() const {
00178 if(Graph_.RowMap().GlobalIndicesInt())
00179 return (int)(NumGlobalBlockDiagonals_);
00180 else
00181 throw "Ifpack_IlukGraph::NumGlobalBlockDiagonals: GlobalIndices not int.";
00182 }
00183 #endif
00184
00186 long long NumGlobalBlockRows64() const {return(NumGlobalBlockRows_);};
00187
00189 long long NumGlobalBlockCols64() const {return(NumGlobalBlockCols_);};
00190
00192 long long NumGlobalRows64() const {return(NumGlobalRows_);};
00193
00195 long long NumGlobalCols64() const {return(NumGlobalCols_);};
00197 long long NumGlobalNonzeros64() const {return(NumGlobalNonzeros_);};
00198
00200 virtual long long NumGlobalBlockDiagonals64() const {return(NumGlobalBlockDiagonals_);};
00201
00203 int NumMyBlockRows() const {return(NumMyBlockRows_);};
00204
00206 int NumMyBlockCols() const {return(NumMyBlockCols_);};
00207
00208
00210 int NumMyRows() const {return(NumMyRows_);};
00211
00213 int NumMyCols() const {return(NumMyCols_);};
00214
00216 int NumMyNonzeros() const {return(NumMyNonzeros_);};
00217
00219 virtual int NumMyBlockDiagonals() const {return(NumMyBlockDiagonals_);};
00220
00222 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
00223 int IndexBase() const {
00224 if(Graph_.RowMap().GlobalIndicesInt())
00225 return (int) IndexBase64();
00226 throw "Ifpack_IlukGraph::IndexBase: GlobalIndices not int.";
00227 }
00228 #endif
00229 long long IndexBase64() const {return(IndexBase_);};
00230
00232 virtual Epetra_CrsGraph & L_Graph() {return(*L_Graph_);};
00233
00235 virtual Epetra_CrsGraph & U_Graph() {return(*U_Graph_);};
00236
00238 virtual Epetra_CrsGraph & L_Graph() const {return(*L_Graph_);};
00239
00241 virtual Epetra_CrsGraph & U_Graph() const {return(*U_Graph_);};
00242
00244 virtual Epetra_Import * OverlapImporter() const {return(&*OverlapImporter_);};
00245
00247 virtual Epetra_CrsGraph * OverlapGraph() const {return(&*OverlapGraph_);};
00248
00250 virtual const Epetra_BlockMap & DomainMap() const {return(DomainMap_);};
00251
00253 virtual const Epetra_BlockMap & RangeMap() const{return(RangeMap_);};
00254
00256 virtual const Epetra_Comm & Comm() const{return(Comm_);};
00257
00258 private:
00259
00260
00261 const Epetra_CrsGraph & Graph_;
00262 const Epetra_BlockMap & DomainMap_;
00263 const Epetra_BlockMap & RangeMap_;
00264 const Epetra_Comm & Comm_;
00265 Teuchos::RefCountPtr<Epetra_CrsGraph> OverlapGraph_;
00266 Teuchos::RefCountPtr<Epetra_BlockMap> OverlapRowMap_;
00267 Teuchos::RefCountPtr<Epetra_Import> OverlapImporter_;
00268 int LevelFill_;
00269 int LevelOverlap_;
00270 Teuchos::RefCountPtr<Epetra_CrsGraph> L_Graph_;
00271 Teuchos::RefCountPtr<Epetra_CrsGraph> U_Graph_;
00272 long long IndexBase_;
00273 long long NumGlobalRows_;
00274 long long NumGlobalCols_;
00275 long long NumGlobalBlockRows_;
00276 long long NumGlobalBlockCols_;
00277 long long NumGlobalBlockDiagonals_;
00278 long long NumGlobalNonzeros_;
00279 long long NumGlobalEntries_;
00280 int NumMyBlockRows_;
00281 int NumMyBlockCols_;
00282 int NumMyRows_;
00283 int NumMyCols_;
00284 int NumMyBlockDiagonals_;
00285 int NumMyNonzeros_;
00286 int NumMyEntries_;
00287
00288
00289 };
00290
00292 ostream& operator << (ostream& os, const Ifpack_IlukGraph& A);
00293
00294 #endif