Ifpack Package Browser (Single Doxygen Collection) Development
Loading...
Searching...
No Matches
Ifpack.h
Go to the documentation of this file.
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"
49#include "Teuchos_iostream_helpers.hpp"
50
51
52#ifdef HAVE_HYPRE
53#include "Ifpack_Hypre.h"
54#endif
55
56
58
138class Ifpack {
139public:
140
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
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#if defined (HAVE_IFPACK_SUPPORTGRAPH) && defined (HAVE_IFPACK_AMESOS)
180 ,MSF_AMESOS
181#endif
182#ifdef HAVE_IFPACK_SUPPORTGRAPH
183 ,MSF_IC
184#endif
192 };
193
195 static const int numPrecTypes =
196 +7
197#ifdef HAVE_IFPACK_AMESOS
198 +4
199#endif
200 +8
201#ifdef HAVE_IFPACK_SPARSKIT
202 +1
203#endif
204#ifdef HAVE_IFPACK_HIPS
205 +1
206#endif
207#ifdef HAVE_HYPRE
208 +1
209#endif
210#ifdef HAVE_IFPACK_SUPERLU
211 +2
212#endif
213#if defined (HAVE_IFPACK_SUPPORTGRAPH) && defined (HAVE_IFPACK_AMESOS)
214 +1
215#endif
216#ifdef HAVE_IFPACK_SUPPORTGRAPH
217 +1
218#endif
219 +7
220 ;
221
223 static const EPrecType precTypeValues[numPrecTypes];
224
226 static const char* precTypeNames[numPrecTypes];
227
230 static const bool supportsUnsymmetric[numPrecTypes];
231
234 static const char* toString(const EPrecType precType)
235 { return precTypeNames[precType]; }
236
246 static Ifpack_Preconditioner* Create(
247 EPrecType PrecType, Epetra_RowMatrix* Matrix, const int overlap = 0, bool overrideSerialDefault = false
248 );
249
264 Ifpack_Preconditioner* Create(const std::string PrecType,
265 Epetra_RowMatrix* Matrix,
266 const int overlap = 0,
267 bool overrideSerialDefault = false);
268
276 int SetParameters(int argc, char* argv[],
277 Teuchos::ParameterList& List, std::string& PrecType,
278 int& Overlap);
279
280};
281
282
283TEUCHOS_ENUM_INPUT_STREAM_OPERATOR(Ifpack::EPrecType)
284
285
286#endif
Ifpack_Preconditioner: basic class for preconditioning in Ifpack.
static const int numPrecTypes
Definition Ifpack.h:195
EPrecType
Enum for the type of preconditioner.
Definition Ifpack.h:142
@ IC
Definition Ifpack.h:159
@ POINT_RELAXATION
Definition Ifpack.h:143
@ IHSS
Definition Ifpack.h:188
@ BLOCK_RELAXATION_STAND_ALONE_IC
Definition Ifpack.h:149
@ IC_STAND_ALONE
Definition Ifpack.h:160
@ POLYNOMIAL
Definition Ifpack.h:186
@ BLOCK_RELAXATION_STAND_ALONE
Definition Ifpack.h:146
@ ILU
Definition Ifpack.h:163
@ SORA
Definition Ifpack.h:189
@ TRIDI_RELAXATION_STAND_ALONE
Definition Ifpack.h:191
@ ILU_STAND_ALONE
Definition Ifpack.h:164
@ TRIDI_RELAXATION
Definition Ifpack.h:190
@ ILUT_STAND_ALONE
Definition Ifpack.h:166
@ ILUT
Definition Ifpack.h:165
@ ICT_STAND_ALONE
Definition Ifpack.h:162
@ BLOCK_RELAXATION_STAND_ALONE_ILU
Definition Ifpack.h:147
@ ICT
Definition Ifpack.h:161
@ KRYLOV
Definition Ifpack.h:187
@ BLOCK_RELAXATION
Definition Ifpack.h:145
@ POINT_RELAXATION_STAND_ALONE
Definition Ifpack.h:144
@ BLOCK_RELAXATION_STAND_ALONE_ILUT
Definition Ifpack.h:148
@ CHEBYSHEV
Definition Ifpack.h:185
static const bool supportsUnsymmetric[numPrecTypes]
List of bools that determines if the preconditioner type supports unsymmetric matrices.
Definition Ifpack.h:199
static const char * precTypeNames[numPrecTypes]
List of preconditioner types as std::string values.
Definition Ifpack.h:145
static const char * toString(const EPrecType precType)
Function that gives the std::string name for preconditioner given its enumerication value.
Definition Ifpack.h:234
static const EPrecType precTypeValues[numPrecTypes]
List of the preconditioner types as enum values .
Definition Ifpack.h:91