IFPACK  Development
 All Classes Namespaces Files Functions Variables Enumerations Friends Pages
Ifpack.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_H
44 #define IFPACK_H
45 
46 #if defined(Ifpack_SHOW_DEPRECATED_WARNINGS)
47 #ifdef __GNUC__
48 #warning "The Ifpack package is deprecated"
49 #endif
50 #endif
51 
52 
53 #include "Ifpack_ConfigDefs.h"
54 #include "Ifpack_Preconditioner.h"
55 #include "Teuchos_iostream_helpers.hpp"
56 
57 
58 #ifdef HAVE_HYPRE
59 #include "Ifpack_Hypre.h"
60 #endif
61 
62 
64 
144 class Ifpack {
145 public:
146 
148  enum EPrecType {
149  POINT_RELAXATION
150  ,POINT_RELAXATION_STAND_ALONE
151  ,BLOCK_RELAXATION
152  ,BLOCK_RELAXATION_STAND_ALONE
153  ,BLOCK_RELAXATION_STAND_ALONE_ILU
154  ,BLOCK_RELAXATION_STAND_ALONE_ILUT
155  ,BLOCK_RELAXATION_STAND_ALONE_IC
156 #ifdef HAVE_IFPACK_SUPERLU
157  ,BLOCK_RELAXATION_STAND_ALONE_SILU
158 #endif
159 #ifdef HAVE_IFPACK_AMESOS
160  ,BLOCK_RELAXATION_STAND_ALONE_AMESOS
161  ,BLOCK_RELAXATION_AMESOS
162  ,AMESOS
163  ,AMESOS_STAND_ALONE
164 #endif // HAVE_IFPACK_AMESOS
165  ,IC
166  ,IC_STAND_ALONE
167  ,ICT
168  ,ICT_STAND_ALONE
169  ,ILU
170  ,ILU_STAND_ALONE
171  ,ILUT
172  ,ILUT_STAND_ALONE
173 #ifdef HAVE_IFPACK_SPARSKIT
174  ,SPARSKIT
175 #endif // HAVE_IFPACK_SPARSKIT
176 #ifdef HAVE_IFPACK_HIPS
177  ,HIPS
178 #endif
179 #ifdef HAVE_HYPRE
180  ,HYPRE
181 #endif
182 #ifdef HAVE_IFPACK_SUPERLU
183  ,SILU
184 #endif
185 #if defined (HAVE_IFPACK_SUPPORTGRAPH) && defined (HAVE_IFPACK_AMESOS)
186  ,MSF_AMESOS
187 #endif
188 #ifdef HAVE_IFPACK_SUPPORTGRAPH
189  ,MSF_IC
190 #endif
191  ,CHEBYSHEV
192  ,POLYNOMIAL
193  ,KRYLOV
194  ,IHSS
195  ,SORA
196  ,TRIDI_RELAXATION
197  ,TRIDI_RELAXATION_STAND_ALONE
198  };
199 
201  static const int numPrecTypes =
202  +7
203 #ifdef HAVE_IFPACK_AMESOS
204  +4
205 #endif
206  +8
207 #ifdef HAVE_IFPACK_SPARSKIT
208  +1
209 #endif
210 #ifdef HAVE_IFPACK_HIPS
211  +1
212 #endif
213 #ifdef HAVE_HYPRE
214  +1
215 #endif
216 #ifdef HAVE_IFPACK_SUPERLU
217  +2
218 #endif
219 #if defined (HAVE_IFPACK_SUPPORTGRAPH) && defined (HAVE_IFPACK_AMESOS)
220  +1
221 #endif
222 #ifdef HAVE_IFPACK_SUPPORTGRAPH
223  +1
224 #endif
225  +7
226  ;
227 
230 
232  static const char* precTypeNames[numPrecTypes];
233 
236  static const bool supportsUnsymmetric[numPrecTypes];
237 
240  static const char* toString(const EPrecType precType)
241  { return precTypeNames[precType]; }
242 
253  EPrecType PrecType, Epetra_RowMatrix* Matrix, const int overlap = 0, bool overrideSerialDefault = false
254  );
255 
270  Ifpack_Preconditioner* Create(const std::string PrecType,
271  Epetra_RowMatrix* Matrix,
272  const int overlap = 0,
273  bool overrideSerialDefault = false);
274 
282  int SetParameters(int argc, char* argv[],
283  Teuchos::ParameterList& List, std::string& PrecType,
284  int& Overlap);
285 
286 };
287 
288 
289 TEUCHOS_ENUM_INPUT_STREAM_OPERATOR(Ifpack::EPrecType)
290 
291 
292 #endif
static const int numPrecTypes
Definition: Ifpack.h:201
static const EPrecType precTypeValues[numPrecTypes]
List of the preconditioner types as enum values .
Definition: Ifpack.h:229
int SetParameters(int argc, char *argv[], Teuchos::ParameterList &List, std::string &PrecType, int &Overlap)
Sets the options in List from the command line.
Definition: Ifpack.cpp:413
EPrecType
Enum for the type of preconditioner.
Definition: Ifpack.h:148
static const char * toString(const EPrecType precType)
Function that gives the std::string name for preconditioner given its enumerication value...
Definition: Ifpack.h:240
static const char * precTypeNames[numPrecTypes]
List of preconditioner types as std::string values.
Definition: Ifpack.h:232
Ifpack_Preconditioner: basic class for preconditioning in Ifpack.
Ifpack: a function class to define Ifpack preconditioners.
Definition: Ifpack.h:144
static Ifpack_Preconditioner * Create(EPrecType PrecType, Epetra_RowMatrix *Matrix, const int overlap=0, bool overrideSerialDefault=false)
Creates an instance of Ifpack_Preconditioner given the enum value of the preconditioner type (can not...
Definition: Ifpack.cpp:253
static const bool supportsUnsymmetric[numPrecTypes]
List of bools that determines if the preconditioner type supports unsymmetric matrices.
Definition: Ifpack.h:236