Ifpack2 Templated Preconditioning Package Version 1.0
Loading...
Searching...
No Matches
Ifpack2_Details_Chebyshev_Weights.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
4//
5// Copyright 2009 NTESS and the Ifpack2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef IFPACK2_DETAILS_CHEBYSHEV_WEIGHTS_HPP
11#define IFPACK2_DETAILS_CHEBYSHEV_WEIGHTS_HPP
12
13#include <stdexcept>
14#include <vector>
15#include "Teuchos_StandardParameterEntryValidators.hpp"
16
24
25
26namespace Ifpack2 {
27namespace Details {
28
39 template<typename ScalarType>
40 std::vector<ScalarType>
41 optimalWeightsImpl (const int chebyOrder)
42 {
43 if (chebyOrder == 0){
44 return {};
45 }
46 if (chebyOrder == 1){
47 return {
48 1.12500000000000,
49 };
50 }
51
52 if (chebyOrder == 2){
53 return {
54 1.02387287570313,
55 1.26408905371085,
56 };
57 }
58
59 if (chebyOrder == 3){
60 return {
61 1.00842544782028,
62 1.08867839208730,
63 1.33753125909618,
64 };
65 }
66
67 if (chebyOrder == 4){
68 return {
69 1.00391310427285,
70 1.04035811188593,
71 1.14863498546254,
72 1.38268869241000,
73 };
74 }
75
76 if (chebyOrder == 5){
77 return {
78 1.00212930146164,
79 1.02173711549260,
80 1.07872433192603,
81 1.19810065292663,
82 1.41322542791682,
83 };
84 }
85
86 if (chebyOrder == 6){
87 return {
88 1.00128517255940,
89 1.01304293035233,
90 1.04678215124113,
91 1.11616489419675,
92 1.23829020218444,
93 1.43524297106744,
94 };
95 }
96
97 if (chebyOrder == 7){
98 return {
99 1.00083464397912,
100 1.00843949430122,
101 1.03008707768713,
102 1.07408384092003,
103 1.15036186707366,
104 1.27116474046139,
105 1.45186658649364,
106 };
107 }
108
109 if (chebyOrder == 8){
110 return {
111 1.00057246631197,
112 1.00577427662415,
113 1.02050187922941,
114 1.05019803444565,
115 1.10115572984941,
116 1.18086042806856,
117 1.29838585382576,
118 1.46486073151099,
119 };
120 }
121
122 if (chebyOrder == 9){
123 return {
124 1.00040960072832,
125 1.00412439506106,
126 1.01460212148266,
127 1.03561113626671,
128 1.07139972529194,
129 1.12688273710962,
130 1.20785219140729,
131 1.32121930716746,
132 1.47529642820699,
133 };
134 }
135
136 if (chebyOrder == 10){
137 return {
138 1.00030312229652,
139 1.00304840660796,
140 1.01077022715387,
141 1.02619011597640,
142 1.05231724933755,
143 1.09255743207549,
144 1.15083376663972,
145 1.23172250870894,
146 1.34060802024460,
147 1.48386124407011,
148 };
149 }
150
151 if (chebyOrder == 11){
152 return {
153 1.00023058595209,
154 1.00231675024028,
155 1.00817245396304,
156 1.01982986566342,
157 1.03950210235324,
158 1.06965042700541,
159 1.11305754295742,
160 1.17290876275564,
161 1.25288300576792,
162 1.35725579919519,
163 1.49101672564139,
164 };
165 }
166
167 if (chebyOrder == 12){
168 return {
169 1.00017947200828,
170 1.00180189139619,
171 1.00634861907307,
172 1.01537864566306,
173 1.03056942830760,
174 1.05376019693943,
175 1.08699862592072,
176 1.13259183097913,
177 1.19316273358172,
178 1.27171293675110,
179 1.37169337969799,
180 1.49708418575562,
181 };
182 }
183
184 if (chebyOrder == 13){
185 return {
186 1.00014241921559,
187 1.00142906932629,
188 1.00503028986298,
189 1.01216910518495,
190 1.02414874342792,
191 1.04238158880820,
192 1.06842008128700,
193 1.10399010936759,
194 1.15102748242645,
195 1.21171811910125,
196 1.28854264865128,
197 1.38432619380991,
198 1.50229418757368,
199 };
200 }
201
202 if (chebyOrder == 14){
203 return {
204 1.00011490538261,
205 1.00115246376914,
206 1.00405357333264,
207 1.00979590573153,
208 1.01941300472994,
209 1.03401425035436,
210 1.05480599606629,
211 1.08311420301813,
212 1.12040891660892,
213 1.16833095655446,
214 1.22872122288238,
215 1.30365305707817,
216 1.39546814053678,
217 1.50681646209583,
218 };
219 }
220
221 if (chebyOrder == 15){
222 return {
223 1.00009404750752,
224 1.00094291696343,
225 1.00331449056444,
226 1.00800294833816,
227 1.01584236259140,
228 1.02772083317705,
229 1.04459535422831,
230 1.06750761206125,
231 1.09760092545889,
232 1.13613855366157,
233 1.18452361426236,
234 1.24432087304475,
235 1.31728069083392,
236 1.40536543893560,
237 1.51077872501845,
238 };
239 }
240
241 if (chebyOrder == 16){
242 return {
243 1.00007794828179,
244 1.00078126847253,
245 1.00274487974401,
246 1.00662291017015,
247 1.01309858836971,
248 1.02289448329337,
249 1.03678321409983,
250 1.05559875719896,
251 1.08024848405560,
252 1.11172607131497,
253 1.15112543431072,
254 1.19965584614973,
255 1.25865841744946,
256 1.32962412656664,
257 1.41421360695576,
258 1.51427891730346,
259 };
260 }
261
262 TEUCHOS_TEST_FOR_EXCEPTION(
263 true, std::runtime_error, "Ifpack2::Details::optimalWeightsImpl::"
264 "Requested Chebyshev order exceeds maximum of 16."
265 );
266 }
267
268} // namespace Details
269} // namespace Ifpack2
270
271#endif // IFPACK2_DETAILS_CHEBYSHEV_WEIGHTS_HPP
std::vector< ScalarType > optimalWeightsImpl(const int chebyOrder)
Generate optimal weights for using the fourth kind Chebyshev polynomials see: https://arxiv....
Definition Ifpack2_Details_Chebyshev_Weights.hpp:41
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:41