MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_Facade_BGS2x2_def.hpp
Go to the documentation of this file.
1// @HEADER
2//
3// ***********************************************************************
4//
5// MueLu: A package for multigrid based preconditioning
6// Copyright 2012 Sandia Corporation
7//
8// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9// the U.S. Government retains certain rights in this software.
10//
11// Redistribution and use in source and binary forms, with or without
12// modification, are permitted provided that the following conditions are
13// met:
14//
15// 1. Redistributions of source code must retain the above copyright
16// notice, this list of conditions and the following disclaimer.
17//
18// 2. Redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution.
21//
22// 3. Neither the name of the Corporation nor the names of the
23// contributors may be used to endorse or promote products derived from
24// this software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact
39// Jonathan Hu (jhu@sandia.gov)
40// Andrey Prokopenko (aprokop@sandia.gov)
41// Ray Tuminaro (rstumin@sandia.gov)
42// Tobias Wiesner (tawiesn@sandia.gov)
43//
44// ***********************************************************************
45//
46// @HEADER
47#ifndef PACKAGES_MUELU_SRC_INTERFACE_FACADECLASSES_BGS2x2_DEF_HPP_
48#define PACKAGES_MUELU_SRC_INTERFACE_FACADECLASSES_BGS2x2_DEF_HPP_
49
50#include <Teuchos_XMLParameterListHelpers.hpp>
51#include <Teuchos_XMLParameterListCoreHelpers.hpp>
52
53
54#include "MueLu_Exceptions.hpp"
55
57
58namespace MueLu {
59
60 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
62 }
63
64
65 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
66 Teuchos::RCP<Teuchos::ParameterList> FacadeBGS2x2<Scalar, LocalOrdinal, GlobalOrdinal, Node>::SetParameterList(const ParameterList& paramList) {
67
68 // obtain ParameterList with default input parameters for this facade class
69 // Note all parameters are of type string (we use it for string replacement)
70 std::string defaultString =
71"<ParameterList name=\"Input\">"
72"<Parameter name=\"MueLu preconditioner\" type=\"string\" value=\"undefined\"/>"
73"<Parameter name=\"Block 1: dofs per node\" type=\"int\" value=\"1\"/>"
74 "<Parameter name=\"Block 2: dofs per node\" type=\"int\" value=\"1\"/>"
75 "<Parameter name=\"Block 1: smoother\" type=\"string\" value=\"Symmetric Gauss-Seidel\"/>"
76 "<Parameter name=\"Block 1: level-of-fill\" type=\"int\" value=\"0\"/>"
77 "<Parameter name=\"Block 1: relaxation: sweeps\" type=\"int\" value=\"1\"/>"
78 "<Parameter name=\"Block 1: relaxation: damping factor\" type=\"double\" value=\"1.0\"/>"
79 "<Parameter name=\"Block 1: transfer smoothing\" type=\"bool\" value=\"true\"/>"
80 "<Parameter name=\"Block 2: smoother\" type=\"string\" value=\"Symmetric Gauss-Seidel\"/>"
81 "<Parameter name=\"Block 2: level-of-fill\" type=\"int\" value=\"0\"/>"
82 "<Parameter name=\"Block 2: relaxation: sweeps\" type=\"int\" value=\"1\"/>"
83 "<Parameter name=\"Block 2: relaxation: damping factor\" type=\"double\" value=\"1.0\"/>"
84 "<Parameter name=\"Block 2: transfer smoothing\" type=\"bool\" value=\"true\"/>"
85 "<Parameter name=\"BGS: damping factor\" type=\"double\" value=\"1.0\"/>"
86 "<Parameter name=\"max levels\" type=\"int\" value=\"5\"/>"
87 "<Parameter name=\"coarse: max size\" type=\"int\" value=\"25000\"/>"
88 "<Parameter name=\"verbosity\" type=\"string\" value=\"High\"/>"
89 "</ParameterList>"
90;
91 Teuchos::RCP<ParameterList> defaultList = Teuchos::getParametersFromXmlString(defaultString);
92 // validate user input parameters (and set defaults if necessary)
93 Teuchos::ParameterList inputParameters = paramList;
94 inputParameters.validateParametersAndSetDefaults(*defaultList);
95 TEUCHOS_TEST_FOR_EXCEPTION(inputParameters.get<std::string>("MueLu preconditioner") == "undefined", MueLu::Exceptions::RuntimeError, "FacadeBGS2x2: undefined MueLu preconditioner. Set the \"MueLu preconditioner\" parameter correctly in your input file.");
96
97 // create copy of template string which is updated with in-place string replacements
98 // template string for preconditioner layout (factory based parameters)
99 std::string finalString =
100
101"<ParameterList name=\"MueLu\">"
102" <ParameterList name=\"Factories\">"
103" <ParameterList name=\"mySubBlockAFactory1\">"
104" <Parameter name=\"factory\" type=\"string\" value=\"SubBlockAFactory\"/>"
105" <Parameter name=\"block row\" type=\"int\" value=\"0\"/>"
106" <Parameter name=\"block col\" type=\"int\" value=\"0\"/>"
107" <Parameter name=\"Range map: Striding info\" type=\"string\" value=\"{ XXXBlock 1: dofs per nodeYYY }\"/>"
108" <Parameter name=\"Domain map: Striding info\" type=\"string\" value=\"{ XXXBlock 1: dofs per nodeYYY }\"/>"
109" </ParameterList>"
110""
111" <ParameterList name=\"myAggFact1\">"
112" <Parameter name=\"factory\" type=\"string\" value=\"UncoupledAggregationFactory\"/>"
113" <Parameter name=\"aggregation: min agg size\" type=\"int\" value=\"5\"/>"
114" <Parameter name=\"aggregation: max selected neighbors\" type=\"int\" value=\"1\"/>"
115" </ParameterList>"
116""
117" <!-- tell the tentative prolongator that we have 2 DOFs per node on the coarse levels -->"
118" <ParameterList name=\"myCoarseMap1\">"
119" <Parameter name=\"factory\" type=\"string\" value=\"CoarseMapFactory\"/>"
120" <Parameter name=\"Striding info\" type=\"string\" value=\"{ XXXBlock 1: dofs per nodeYYY }\"/>"
121" <Parameter name=\"Strided block id\" type=\"int\" value=\"-1\"/>"
122" </ParameterList>"
123""
124" <ParameterList name=\"myTentativePFact1\">"
125" <Parameter name=\"factory\" type=\"string\" value=\"TentativePFactory\"/>"
126" <Parameter name=\"A\" type=\"string\" value=\"mySubBlockAFactory1\"/>"
127" <Parameter name=\"Aggregates\" type=\"string\" value=\"myAggFact1\"/>"
128" <Parameter name=\"CoarseMap\" type=\"string\" value=\"myCoarseMap1\"/>"
129" </ParameterList>"
130""
131" <ParameterList name=\"myPFact1\">"
132" <Parameter name=\"factory\" type=\"string\" value=\"PgPFactory\"/>"
133" <Parameter name=\"A\" type=\"string\" value=\"mySubBlockAFactory1\"/>"
134" <Parameter name=\"P\" type=\"string\" value=\"myTentativePFact1\"/>"
135" </ParameterList>"
136""
137" <ParameterList name=\"myRFact1\">"
138" <Parameter name=\"factory\" type=\"string\" value=\"GenericRFactory\"/>"
139" <Parameter name=\"P\" type=\"string\" value=\"myPFact1\"/>"
140" </ParameterList>"
141""
142" <!-- We have to use Nullspace1 here. If \"Nullspace1\" is not set the"
143" Factory creates the default null space containing of constant"
144" vectors -->"
145" <ParameterList name=\"myNspFact1\">"
146" <Parameter name=\"factory\" type=\"string\" value=\"NullspaceFactory\"/>"
147" <Parameter name=\"Fine level nullspace\" type=\"string\" value=\"Nullspace1\"/>"
148" <Parameter name=\"Nullspace1\" type=\"string\" value=\"myTentativePFact1\"/>"
149" </ParameterList>"
150""
151" <!-- BLOCK 2 (for submatrix A_{11}) PRESSURE PART -->"
152" <ParameterList name=\"mySubBlockAFactory2\">"
153" <Parameter name=\"factory\" type=\"string\" value=\"SubBlockAFactory\"/>"
154" <Parameter name=\"block row\" type=\"int\" value=\"1\"/>"
155" <Parameter name=\"block col\" type=\"int\" value=\"1\"/>"
156" <Parameter name=\"Range map: Striding info\" type=\"string\" value=\"{ XXXBlock 2: dofs per nodeYYY }\"/>"
157" <Parameter name=\"Domain map: Striding info\" type=\"string\" value=\"{ XXXBlock 2: dofs per nodeYYY }\"/>"
158" </ParameterList>"
159""
160" <!-- tell the tentative prolongator that we have 2 DOFs per node on the coarse levels -->"
161" <ParameterList name=\"myCoarseMap2\">"
162" <Parameter name=\"factory\" type=\"string\" value=\"CoarseMapFactory\"/>"
163" <Parameter name=\"Striding info\" type=\"string\" value=\"{ XXXBlock 2: dofs per nodeYYY }\"/>"
164" <Parameter name=\"Strided block id\" type=\"int\" value=\"-1\"/>"
165" </ParameterList>"
166""
167" <ParameterList name=\"myTentativePFact2\">"
168" <Parameter name=\"factory\" type=\"string\" value=\"TentativePFactory\"/>"
169" <Parameter name=\"A\" type=\"string\" value=\"mySubBlockAFactory2\"/>"
170" <Parameter name=\"Aggregates\" type=\"string\" value=\"myAggFact1\"/>"
171" <Parameter name=\"CoarseMap\" type=\"string\" value=\"myCoarseMap2\"/>"
172" </ParameterList>"
173""
174" <ParameterList name=\"myPFact2\">"
175" <Parameter name=\"factory\" type=\"string\" value=\"SaPFactory\"/>"
176" <Parameter name=\"A\" type=\"string\" value=\"mySubBlockAFactory2\"/>"
177" <Parameter name=\"P\" type=\"string\" value=\"myTentativePFact2\"/>"
178" </ParameterList>"
179""
180" <ParameterList name=\"myRFact2\">"
181" <Parameter name=\"factory\" type=\"string\" value=\"TransPFactory\"/>"
182" <Parameter name=\"P\" type=\"string\" value=\"myPFact2\"/>"
183" </ParameterList>"
184""
185" <ParameterList name=\"myNspFact2\">"
186" <Parameter name=\"factory\" type=\"string\" value=\"NullspaceFactory\"/>"
187" <Parameter name=\"Fine level nullspace\" type=\"string\" value=\"Nullspace2\"/>"
188" <Parameter name=\"Nullspace2\" type=\"string\" value=\"myTentativePFact2\"/>"
189" </ParameterList>"
190""
191" <!-- FACTORY MANAGERS -->"
192""
193" <!-- Multigrid setup for velocity block (A_{00}) -->"
194" <ParameterList name=\"myFirstGroup\">"
195" <Parameter name=\"group\" type=\"string\" value=\"FactoryManager\"/>"
196" <Parameter name=\"A\" type=\"string\" value=\"mySubBlockAFactory1\"/>"
197" <Parameter name=\"P\" type=\"string\" value=\"myPFact1\"/>"
198" <Parameter name=\"R\" type=\"string\" value=\"myRFact1\"/>"
199" <Parameter name=\"Aggregates\" type=\"string\" value=\"myAggFact1\"/>"
200" <Parameter name=\"Nullspace\" type=\"string\" value=\"myNspFact1\"/>"
201" <Parameter name=\"CoarseMap\" type=\"string\" value=\"myCoarseMap1\"/>"
202" </ParameterList>"
203""
204" <!-- Multigrid setup for pressure block (A_{11}) -->"
205" <ParameterList name=\"mySecondGroup\">"
206" <Parameter name=\"group\" type=\"string\" value=\"FactoryManager\"/>"
207" <Parameter name=\"A\" type=\"string\" value=\"mySubBlockAFactory2\"/>"
208" <Parameter name=\"P\" type=\"string\" value=\"myPFact2\"/>"
209" <Parameter name=\"R\" type=\"string\" value=\"myRFact2\"/>"
210" <Parameter name=\"Aggregates\" type=\"string\" value=\"myAggFact1\"/><!-- reuse aggs from PRESSURE block! -->"
211" <Parameter name=\"Nullspace\" type=\"string\" value=\"myNspFact2\"/>"
212" <Parameter name=\"CoarseMap\" type=\"string\" value=\"myCoarseMap2\"/>"
213" </ParameterList>"
214""
215" <!-- BLOCK TRANSFER operators -->"
216""
217" <ParameterList name=\"myBlockedPFact\">"
218" <Parameter name=\"factory\" type=\"string\" value=\"BlockedPFactory\"/>"
219" <!-- factory manager for block 1 -->"
220" <ParameterList name=\"block1\">"
221" <Parameter name=\"group\" type=\"string\" value=\"myFirstGroup\"/>"
222" </ParameterList>"
223" <!-- factory manager for block 2 -->"
224" <ParameterList name=\"block2\">"
225" <Parameter name=\"group\" type=\"string\" value=\"mySecondGroup\"/>"
226" </ParameterList>"
227" </ParameterList>"
228""
229" <ParameterList name=\"myBlockedRFact\">"
230" <Parameter name=\"factory\" type=\"string\" value=\"GenericRFactory\"/>"
231" <Parameter name=\"P\" type=\"string\" value=\"myBlockedPFact\"/>"
232" </ParameterList>"
233""
234" <ParameterList name=\"myBlockedRAPFact\">"
235" <Parameter name=\"factory\" type=\"string\" value=\"BlockedRAPFactory\"/>"
236" <Parameter name=\"P\" type=\"string\" value=\"myBlockedPFact\"/>"
237" <Parameter name=\"R\" type=\"string\" value=\"myBlockedRFact\"/>"
238" </ParameterList>"
239""
240" <!-- BLOCK SMOOTHERS -->"
241" <ParameterList name=\"mySmooFact1\">"
242" <Parameter name=\"factory\" type=\"string\" value=\"TrilinosSmoother\"/>"
243" <Parameter name=\"type\" type=\"string\" value=\"RELAXATION\"/>"
244" <ParameterList name=\"ParameterList\">"
245" <Parameter name=\"relaxation: type\" type=\"string\" value=\"XXXBlock 1: relaxation: typeYYY\"/>"
246" <Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"XXXBlock 1: relaxation: sweepsYYY\"/>"
247" <Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"XXXBlock 1: relaxation: damping factorYYY\"/>"
248" </ParameterList>"
249" </ParameterList>"
250""
251" <ParameterList name=\"mySmooILUFact1\">"
252" <Parameter name=\"factory\" type=\"string\" value=\"TrilinosSmoother\"/>"
253" <Parameter name=\"type\" type=\"string\" value=\"ILU\"/>"
254" <ParameterList name=\"ParameterList\">"
255" <Parameter name=\"fact: level-of-fill\" type=\"int\" value=\"XXXBlock 1: level-of-fillYYY\"/>"
256" </ParameterList>"
257" </ParameterList>"
258""
259" <ParameterList name=\"mySmooDirectFact1\">"
260" <Parameter name=\"factory\" type=\"string\" value=\"DirectSolver\"/>"
261" </ParameterList>"
262""
263" <ParameterList name=\"mySmooFact2\">"
264" <Parameter name=\"factory\" type=\"string\" value=\"TrilinosSmoother\"/>"
265" <Parameter name=\"type\" type=\"string\" value=\"RELAXATION\"/>"
266" <ParameterList name=\"ParameterList\">"
267" <Parameter name=\"relaxation: type\" type=\"string\" value=\"XXXBlock 2: relaxation: typeYYY\"/>"
268" <Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"XXXBlock 2: relaxation: sweepsYYY\"/>"
269" <Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"XXXBlock 2: relaxation: damping factorYYY\"/>"
270" </ParameterList>"
271" </ParameterList>"
272""
273" <ParameterList name=\"mySmooILUFact2\">"
274" <Parameter name=\"factory\" type=\"string\" value=\"TrilinosSmoother\"/>"
275" <Parameter name=\"type\" type=\"string\" value=\"ILU\"/>"
276" <ParameterList name=\"ParameterList\">"
277" <Parameter name=\"fact: level-of-fill\" type=\"int\" value=\"XXXBlock 2: level-of-fillYYY\"/>"
278" </ParameterList>"
279" </ParameterList>"
280""
281" <ParameterList name=\"mySmooDirectFact2\">"
282" <Parameter name=\"factory\" type=\"string\" value=\"DirectSolver\"/>"
283" </ParameterList>"
284""
285" <ParameterList name=\"myBlockSmoother\">"
286" <Parameter name=\"factory\" type=\"string\" value=\"BlockedGaussSeidelSmoother\"/>"
287" <Parameter name=\"Sweeps\" type=\"int\" value=\"1\"/>"
288" <Parameter name=\"Damping factor\" type=\"double\" value=\"XXXBGS: damping factorYYY\"/>"
289" <!-- factory manager for block 1 -->"
290" <ParameterList name=\"block1\">"
291" <Parameter name=\"A\" type=\"string\" value=\"mySubBlockAFactory1\"/>"
292" <Parameter name=\"Smoother\" type=\"string\" value=\"XYZSmoother1XYZ\"/>"
293" </ParameterList>"
294" <!-- factory manager for block 2 -->"
295" <ParameterList name=\"block2\">"
296" <Parameter name=\"A\" type=\"string\" value=\"mySubBlockAFactory2\"/>"
297" <Parameter name=\"Smoother\" type=\"string\" value=\"XYZSmoother2XYZ\"/>"
298" </ParameterList>"
299" </ParameterList>"
300""
301" </ParameterList>"
302" <!-- end Factories -->"
303""
304" <!-- Definition of the multigrid preconditioner -->"
305" <ParameterList name=\"Hierarchy\">"
306""
307" <Parameter name=\"max levels\" type=\"int\" value=\"XXXmax levelsYYY\"/>"
308" <Parameter name=\"coarse: max size\" type=\"int\" value=\"XXXcoarse: max sizeYYY\"/>"
309" <Parameter name=\"verbosity\" type=\"string\" value=\"XXXverbosityYYY\"/>"
310""
311" <ParameterList name=\"AllLevel\">"
312" <Parameter name=\"startLevel\" type=\"int\" value=\"0\"/>"
313" <Parameter name=\"Smoother\" type=\"string\" value=\"myBlockSmoother\"/>"
314" <Parameter name=\"CoarseSolver\" type=\"string\" value=\"myBlockSmoother\"/>"
315" <Parameter name=\"P\" type=\"string\" value=\"myBlockedPFact\"/>"
316" <Parameter name=\"R\" type=\"string\" value=\"myBlockedRFact\"/>"
317" <Parameter name=\"A\" type=\"string\" value=\"myBlockedRAPFact\"/>"
318" </ParameterList>"
319""
320" </ParameterList>"
321"</ParameterList>"
322 ;
323
324 // logical code for more complicated distinctions
325
326
327 std::string smoother1 = inputParameters.get<std::string>("Block 1: smoother");
328 if(smoother1 == "ILU") {
329 this->ReplaceString(finalString, "XYZSmoother1XYZ", "mySmooILUFact1");
330 } else if (smoother1 == "Symmetric Gauss-Seidel" || smoother1 == "SGS") {
331 this->ReplaceString(finalString, "XXXBlock 1: relaxation: typeYYY", "Symmetric Gauss-Seidel");
332 this->ReplaceString(finalString, "XYZSmoother1XYZ", "mySmooFact1");
333 } else if (smoother1 == "Symmetric Gauss-Seidel" || smoother1 == "GS") {
334 this->ReplaceString(finalString, "XXXBlock 1: relaxation: typeYYY", "Gauss-Seidel");
335 this->ReplaceString(finalString, "XYZSmoother1XYZ", "mySmooFact1");
336 } else if (smoother1 == "Jacobi") {
337 this->ReplaceString(finalString, "XXXBlock 1: relaxation: typeYYY", "Jacobi");
338 this->ReplaceString(finalString, "XYZSmoother1XYZ", "mySmooFact1");
339 } else if (smoother1 == "Direct") {
340 this->ReplaceString(finalString, "XYZSmoother1XYZ", "mySmooDirectFact1");
341 } else {
342 this->GetOStream(Errors) << "Invalid smoother type for block 1: " << smoother1 << ". Valid options are: \"SGS\", \"GS\", \"Jacobi\", \"ILU\" or \"Direct\"." << std::endl;
343 }
344
345 std::string smoother2 = inputParameters.get<std::string>("Block 2: smoother");
346 if(smoother2 == "ILU") {
347 this->ReplaceString(finalString, "XYZSmoother2XYZ", "mySmooILUFact2");
348 } else if (smoother2 == "Symmetric Gauss-Seidel" || smoother2 == "SGS") {
349 this->ReplaceString(finalString, "XXXBlock 2: relaxation: typeYYY", "Symmetric Gauss-Seidel");
350 this->ReplaceString(finalString, "XYZSmoother2XYZ", "mySmooFact2");
351 } else if (smoother2 == "Symmetric Gauss-Seidel" || smoother2 == "GS") {
352 this->ReplaceString(finalString, "XXXBlock 2: relaxation: typeYYY", "Gauss-Seidel");
353 this->ReplaceString(finalString, "XYZSmoother2XYZ", "mySmooFact2");
354 } else if (smoother2 == "Jacobi") {
355 this->ReplaceString(finalString, "XXXBlock 2: relaxation: typeYYY", "Gauss-Seidel");
356 this->ReplaceString(finalString, "XYZSmoother2XYZ", "mySmooFact2");
357 } else if (smoother2 == "Direct") {
358 this->ReplaceString(finalString, "XYZSmoother2XYZ", "mySmooDirectFact2");
359 } else {
360 this->GetOStream(Errors) << "Invalid smoother type for block 2: " << smoother2 << ". Valid options are: \"SGS\", \"GS\", \"Jacobi\", \"ILU\" or \"Direct\"." << std::endl;
361 }
362
363 if(inputParameters.get<bool>("Block 1: transfer smoothing") == true) {
364 this->ReplaceString(finalString, "XXXBlock 1: prolongatorYYY", "myPFact1");
365 this->ReplaceString(finalString, "XXXBlock 1: restrictor YYY", "myRFact1");
366 } else {
367 this->ReplaceString(finalString, "XXXBlock 1: prolongatorYYY", "myTentativePFact1");
368 this->ReplaceString(finalString, "XXXBlock 1: restrictor YYY", "myTransPFact1");
369 }
370 if(inputParameters.get<bool>("Block 2: transfer smoothing") == true) {
371 this->ReplaceString(finalString, "XXXBlock 2: prolongatorYYY", "myPFact2");
372 this->ReplaceString(finalString, "XXXBlock 2: restrictor YYY", "myRFact2");
373 } else {
374 this->ReplaceString(finalString, "XXXBlock 2: prolongatorYYY", "myTentativePFact2");
375 this->ReplaceString(finalString, "XXXBlock 2: restrictor YYY", "myTransPFact2");
376 }
377
378 // end logical code
379
380 // loop over all input parameters
381 for(Teuchos::ParameterList::ConstIterator it = inputParameters.begin(); it != inputParameters.end(); it++) {
382 // form replacement string
383 std::string par_name = inputParameters.name(it);
384 std::stringstream ss;
385 ss << "XXX" << par_name << "YYY";
386
387 // update final string with parameters
388 Teuchos::ParameterEntry par_entry = inputParameters.entry(it);
389 this->ReplaceString(finalString,
390 ss.str(), Teuchos::toString(par_entry.getAny()));
391 }
392
393 Teuchos::RCP<ParameterList> ret = Teuchos::getParametersFromXmlString(finalString);
394 return ret;
395 }
396
397} // end namespace MueLu
398#endif // PACKAGES_MUELU_SRC_INTERFACE_FACADECLASSES_BGS2x2_DEF_HPP_
Exception throws to report errors in the internal logical of the program.
Teuchos::RCP< Teuchos::ParameterList > SetParameterList(const Teuchos::ParameterList &paramList)
Set parameter list for FacadeClass interpreter.
Namespace for MueLu classes and methods.
@ Errors
Errors.