IFPACK  Development
 All Classes 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 
47 #include "Ifpack_ConfigDefs.h"
48 #include "Ifpack_Preconditioner.h"
49 #include "Teuchos_iostream_helpers.hpp"
50 
51 
52 #ifdef HAVE_HYPRE
53 #include "Ifpack_Hypre.h"
54 #endif
55 
56 
58 
138 class Ifpack {
139 public:
140 
142  enum EPrecType {
143  POINT_RELAXATION
144  ,POINT_RELAXATION_STAND_ALONE
145  ,BLOCK_RELAXATION
146  ,BLOCK_RELAXATION_STAND_ALONE
147  ,BLOCK_RELAXATION_STAND_ALONE_ILU
148  ,BLOCK_RELAXATION_STAND_ALONE_ILUT
149  ,BLOCK_RELAXATION_STAND_ALONE_IC
150 #ifdef HAVE_IFPACK_SUPERLU
151  ,BLOCK_RELAXATION_STAND_ALONE_SILU
152 #endif
153 #ifdef HAVE_IFPACK_AMESOS
154  ,BLOCK_RELAXATION_STAND_ALONE_AMESOS
155  ,BLOCK_RELAXATION_AMESOS
156  ,AMESOS
157  ,AMESOS_STAND_ALONE
158 #endif // HAVE_IFPACK_AMESOS
159  ,IC
160  ,IC_STAND_ALONE
161  ,ICT
162  ,ICT_STAND_ALONE
163  ,ILU
164  ,ILU_STAND_ALONE
165  ,ILUT
166  ,ILUT_STAND_ALONE
167 #ifdef HAVE_IFPACK_SPARSKIT
168  ,SPARSKIT
169 #endif // HAVE_IFPACK_SPARSKIT
170 #ifdef HAVE_IFPACK_HIPS
171  ,HIPS
172 #endif
173 #ifdef HAVE_HYPRE
174  ,HYPRE
175 #endif
176 #ifdef HAVE_IFPACK_SUPERLU
177  ,SILU
178 #endif
179  ,CHEBYSHEV
180  ,POLYNOMIAL
181  ,KRYLOV
182  ,IHSS
183  ,SORA
184  };
185 
187  static const int numPrecTypes =
188  +7
189 #ifdef HAVE_IFPACK_AMESOS
190  +4
191 #endif
192  +8
193 #ifdef HAVE_IFPACK_SPARSKIT
194  +1
195 #endif
196 #ifdef HAVE_IFPACK_HIPS
197  +1
198 #endif
199 #ifdef HAVE_HYPRE
200  +1
201 #endif
202 #ifdef HAVE_IFPACK_SUPERLU
203  +2
204 #endif
205  +5
206  ;
207 
210 
212  static const char* precTypeNames[numPrecTypes];
213 
216  static const bool supportsUnsymmetric[numPrecTypes];
217 
220  static const char* toString(const EPrecType precType)
221  { return precTypeNames[precType]; }
222 
233  EPrecType PrecType, Epetra_RowMatrix* Matrix, const int overlap = 0, bool overrideSerialDefault = false
234  );
235 
250  Ifpack_Preconditioner* Create(const string PrecType,
251  Epetra_RowMatrix* Matrix,
252  const int overlap = 0,
253  bool overrideSerialDefault = false);
254 
262  int SetParameters(int argc, char* argv[],
263  Teuchos::ParameterList& List, string& PrecType,
264  int& Overlap);
265 
266 };
267 
268 
269 TEUCHOS_ENUM_INPUT_STREAM_OPERATOR(Ifpack::EPrecType)
270 
271 
272 #endif
static const int numPrecTypes
Definition: Ifpack.h:187
static const EPrecType precTypeValues[numPrecTypes]
List of the preconditioner types as enum values .
Definition: Ifpack.h:209
EPrecType
Enum for the type of preconditioner.
Definition: Ifpack.h:142
static const char * toString(const EPrecType precType)
Function that gives the string name for preconditioner given its enumerication value.
Definition: Ifpack.h:220
int SetParameters(int argc, char *argv[], Teuchos::ParameterList &List, string &PrecType, int &Overlap)
Sets the options in List from the command line.
Definition: Ifpack.cpp:359
static const char * precTypeNames[numPrecTypes]
List of preconditioner types as string values.
Definition: Ifpack.h:212
Ifpack_Preconditioner: basic class for preconditioning in Ifpack.
Ifpack: a function class to define Ifpack preconditioners.
Definition: Ifpack.h:138
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:226
static const bool supportsUnsymmetric[numPrecTypes]
List of bools that determines if the preconditioner type supports unsymmetric matrices.
Definition: Ifpack.h:216