Ifpack Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ifpack_ValidParameters.cpp
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 #include "Ifpack_ValidParameters.h"
44 
46 {
47  Teuchos::ParameterList List; // empty list
48 
49  // ============================================================ //
50  // Parameters are reported from each used file in IFPACK. Files //
51  // are listed in alphabetical order, first all *.cpp, then *.h. //
52  // Some options not very tested or documented anywhere //
53  // are not reported here. //
54  // ============================================================ //
55 
56  // Ifpack_Amesos.cpp
57  List.set("amesos: solver type", "Amesos_Klu");
58 
59  // Ifpack_IC.cpp
60  List.set("fact: level-of-fill", (int)1);
61  List.set("fact: absolute threshold", (double)0.0);
62  List.set("fact: relative threshold", (double)0.0);
63  List.set("fact: drop tolerance", (double)0.0);
64 
65  // Ifpack_ICT.cpp
66  List.set("fact: ict level-of-fill", (double)1.0);
67  List.set("fact: absolute threshold", (double)0.0);
68  List.set("fact: relative threshold", (double)1.0);
69  List.set("fact: relax value", (double)0.0);
70  List.set("fact: drop tolerance", (double)0.0);
71 
72  // Ifpack_ILU.cpp
73  List.set("fact: level-of-fill", (int)0);
74  List.set("fact: absolute threshold", (double)0.0);
75  List.set("fact: relative threshold", (double)1.0);
76  List.set("fact: relax value", (double)0.0);
77 
78  // Ifpack_ILUT.cpp
79  List.set("fact: ilut level-of-fill", (double)1.0);
80  List.set("fact: absolute threshold", (double)0.0);
81  List.set("fact: relative threshold", (double)1.0);
82  List.set("fact: relax value", (double)0.0);
83 
84 #ifdef HAVE_IFPACK_SUPERLU
85  // Ifpack_SILU.cpp
86  List.set("fact: drop tolerance",1e-4);
87  List.set("fact: zero pivot threshold",1e-2);
88  List.set("fact: maximum fill factor",10.0);
89  List.set("fact: silu drop rule",9);
90 #endif
91 
92  // Ifpack_METISPartitioner.cpp
93  List.set("partitioner: local parts", (int)1);
94  List.set("partitioner: overlap", (int)0);
95  List.set("partitioner: print level", (int)0);
96 
97  // Ifpack_PointRelaxation.cpp
98  List.set("relaxation: type", "Jacobi");
99  List.set("relaxation: sweeps", (int)1);
100  List.set("relaxation: damping factor", (double)1.0);
101  List.set("relaxation: min diagonal value", (double)1.0);
102  List.set("relaxation: zero starting solution", true);
103  List.set("relaxation: backward mode",false);
104  List.set("relaxation: use l1",false);
105  List.set("relaxation: l1 eta",(double)1.5);
106 
107  // Ifpack_SPARSKIT.cpp
108  List.set("fact: sparskit: lfil", (int)0);
109  List.set("fact: sparskit: tol", (double)0.0);
110  List.set("fact: sparskit: droptol", (double)0.0);
111  List.set("fact: sparskit: permtol", (double)0.1);
112  List.set("fact: sparskit: alph", (double)0.0);
113  List.set("fact: sparskit: mbloc", (int)(-1));
114  List.set("fact: sparskit: type", ("ILUT"));
115 
116  // Additive Schwarz preconditioner
117  List.set("schwarz: compute condest", true);
118  List.set("schwarz: combine mode", "Zero"); // use std::string mode for this
119  List.set("schwarz: reordering type", "none");
120  List.set("schwarz: filter singletons", false);
121 
122  // Ifpack_BlockRelaxation.h
123  // List.set("relaxation: type", "Jacobi"); // already set
124  // List.set("relaxation: sweeps", 1); // already set
125  // List.get("relaxation: damping factor", 1.0); // already set
126  // List.get("relaxation: zero starting solution", true); // already set
127  List.set("partitioner: type", "greedy");
128  List.set("partitioner: local parts", (int)1);
129  List.set("partitioner: overlap", (int)0);
130  List.set("partitioner: keep singletons",false);
131 
132  // Ifpack_METISPartitioner.h
133  List.set("partitioner: use symmetric graph", true);
134 
135  // Krylov smoother
136  List.set("krylov: iterations",(int)5);
137  List.set("krylov: tolerance",(double)0.001);
138  List.set("krylov: solver",(int)1);
139  List.set("krylov: preconditioner",(int)0);
140  List.set("krylov: number of sweeps",(int)1);
141  List.set("krylov: block size",(int)1);
142  List.set("krylov: damping parameter",(double)1.0);
143  List.set("krylov: zero starting solution",true);
144 
145  // Ifpack_Hypre.cpp
146  List.set("hypre: Solver", "PCG");
147  List.set("hypre: Preconditioner", "Euclid");
148  List.set("hypre: SolveOrPrecondition", "Solver");
149  List.sublist("hypre: Solver functions").disableRecursiveValidation();
150 
151  List.sublist("hypre: Preconditioner functions").disableRecursiveValidation();
152  List.sublist("Operators").disableRecursiveValidation();
153  List.sublist("Coordinates").disableRecursiveValidation();
154  List.set("hypre: Dump", false);
155  List.set("hypre: SetPreconditioner", false);
156  List.set("hypre: NumFunctions", 0);
157 
158 
159  return(List);
160 }
161 
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
RCP< ParameterList > sublist(const RCP< ParameterList > &paramList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
Teuchos::ParameterList Ifpack_GetValidParameters()
Returns a list which contains all the parameters possibly used by IFPACK.