Stratimikos Version of the Day
Loading...
Searching...
No Matches
Stratimikos_LinearSolverBuilder_def.hpp
1// @HEADER
2// *****************************************************************************
3// Stratimikos: Thyra-based strategies for linear solvers
4//
5// Copyright 2006 NTESS and the Stratimikos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef STRATIMIKOS_LINEARSOLVERBUILDER_DEF_HPP
11#define STRATIMIKOS_LINEARSOLVERBUILDER_DEF_HPP
12
13//#define THYRA_DEFAULT_REAL_LINEAR_SOLVER_BUILDER_DUMP
14
15#include "Stratimikos_InternalConfig.h"
16#include "Thyra_DelayedLinearOpWithSolveFactory.hpp"
17#include "Teuchos_AbstractFactoryStd.hpp"
18#include "Teuchos_CommandLineProcessor.hpp"
19#include "Teuchos_XMLParameterListHelpers.hpp"
20#include "Teuchos_GlobalMPISession.hpp"
21
22#ifdef HAVE_STRATIMIKOS_AMESOS
23# include "Thyra_AmesosLinearOpWithSolveFactory.hpp"
24#endif
25#ifdef HAVE_STRATIMIKOS_AMESOS2
26# include "Thyra_Amesos2LinearOpWithSolveFactory.hpp"
27#endif
28#if defined(HAVE_STRATIMIKOS_EPETRAEXT) && defined(HAVE_STRATIMIKOS_AZTECOO)
29# include "Thyra_AztecOOLinearOpWithSolveFactory.hpp"
30#endif
31#ifdef HAVE_STRATIMIKOS_BELOS
32# include "Thyra_BelosLinearOpWithSolveFactory.hpp"
33#endif
34#ifdef HAVE_STRATIMIKOS_IFPACK
35# include "Thyra_IfpackPreconditionerFactory.hpp"
36#endif
37#if defined(HAVE_STRATIMIKOS_IFPACK2) && defined(HAVE_STRATIMIKOS_THYRATPETRAADAPTERS)
38# include "Thyra_Ifpack2PreconditionerFactory.hpp"
39# include "Tpetra_CrsMatrix.hpp"
40#endif
41#ifdef HAVE_STRATIMIKOS_ML
42# include "Thyra_MLPreconditionerFactory.hpp"
43#endif
44
45
46namespace {
47
48
49const std::string LinearSolverType_name = "Linear Solver Type";
50const std::string LinearSolverTypes_name = "Linear Solver Types";
51const std::string PreconditionerType_name = "Preconditioner Type";
52const std::string PreconditionerTypes_name = "Preconditioner Types";
53const std::string None_name = "None";
54const std::string EnableDelayedSolverConstruction_name = "Enable Delayed Solver Construction";
55const bool EnableDelayedSolverConstruction_default = false;
56
57
58} // namespace
59
60
61namespace Stratimikos {
62
63
64// Constructors/Initializers/Accessors
65
66
67template<class Scalar>
69 const std::string &paramsXmlFileName_in,
70 const std::string &extraParamsXmlString_in,
71 const std::string &paramsUsedXmlOutFileName_in,
72 const std::string &paramsXmlFileNameOption_in,
73 const std::string &extraParamsXmlStringOption_in,
74 const std::string &paramsUsedXmlOutFileNameOption_in,
75 const bool &replaceDuplicateFactories_in
76 )
77 :paramsXmlFileName_(paramsXmlFileName_in)
78 ,extraParamsXmlString_(extraParamsXmlString_in)
79 ,paramsUsedXmlOutFileName_(paramsUsedXmlOutFileName_in)
80 ,paramsXmlFileNameOption_(paramsXmlFileNameOption_in)
81 ,extraParamsXmlStringOption_(extraParamsXmlStringOption_in)
82 ,paramsUsedXmlOutFileNameOption_(paramsUsedXmlOutFileNameOption_in)
83 ,replaceDuplicateFactories_(replaceDuplicateFactories_in)
84 ,enableDelayedSolverConstruction_(EnableDelayedSolverConstruction_default)
85{
86 this->initializeDefaults();
87}
88
89
90template<class Scalar>
92{
93#ifdef TEUCHOS_DEBUG
94 // Validate that we read the parameters correctly!
95 if (nonnull(paramList_)) {
96 paramList_->validateParameters(*this->getValidParameters());
97 }
98#endif
99}
100
101
102template<class Scalar>
104 const RCP<const AbstractFactory<Thyra::LinearOpWithSolveFactoryBase<Scalar> > >
105 &solveStrategyFactory,
106 const std::string &solveStrategyName,
107 const bool makeDefault
108 )
109{
110 const int existingNameIdx =
111 this->getAndAssertExistingFactoryNameIdx("setLinearSolveStrategyFactory()",
112 validLowsfNames_(), solveStrategyName);
113 if (existingNameIdx >= 0) {
114 validLowsfNames_[existingNameIdx] = solveStrategyName;
115 lowsfArray_[existingNameIdx] = solveStrategyFactory;
116 }
117 else {
118 validLowsfNames_.push_back(solveStrategyName);
119 lowsfArray_.push_back(solveStrategyFactory);
120 }
121 validParamList_ = Teuchos::null;
122 if (makeDefault) {
123 setDefaultLinearSolveStrategyFactoryName(solveStrategyName);
124 }
125}
126
127
128template<class Scalar>
130 const std::string &solveStrategyName)
131{
132 defaultLOWSF_ = solveStrategyName;
133}
134
135
136template<class Scalar>
138 const RCP<const AbstractFactory<Thyra::PreconditionerFactoryBase<Scalar>>>
139 &precStrategyFactory,
140 const std::string &precStrategyName,
141 const bool makeDefault
142 )
143{
144 const int existingNameIdx =
145 this->getAndAssertExistingFactoryNameIdx("setPreconditioningStrategyFactory()",
146 validPfNames_(), precStrategyName);
147 if (existingNameIdx >= 0) {
148 validPfNames_[existingNameIdx] = precStrategyName;
149 pfArray_[existingNameIdx-1] = precStrategyFactory; // We offset by -1 since "None" is first!
150 }
151 else {
152 validPfNames_.push_back(precStrategyName);
153 pfArray_.push_back(precStrategyFactory);
154 }
155 validParamList_ = Teuchos::null;
156 if (makeDefault) {
157 setDefaultPreconditioningStrategyFactoryName(precStrategyName);
158 }
159}
160
161
162template<class Scalar>
164 const std::string &precStrategyName)
165{
166 defaultPF_ = precStrategyName;
167}
168
169
170template<class Scalar>
171void LinearSolverBuilder<Scalar>::setupCLP( Teuchos::CommandLineProcessor *clp )
172{
173 TEUCHOS_TEST_FOR_EXCEPT(clp==NULL);
174 clp->setOption(
175 paramsXmlFileNameOption().c_str(),&paramsXmlFileName_
176 ,"Name of an XML file containing parameters for linear solver "
177 "options to be appended first."
178 );
179 clp->setOption(
180 extraParamsXmlStringOption().c_str(),&extraParamsXmlString_
181 ,"An XML string containing linear solver parameters to be appended second."
182 );
183 clp->setOption(
184 paramsUsedXmlOutFileNameOption().c_str(),&paramsUsedXmlOutFileName_
185 ,"Name of an XML file that can be written with the parameter list after it "
186 "has been used on completion of this program."
187 );
188}
189
190
191template<class Scalar>
193{
194 using Teuchos::parameterList;
195 using Teuchos::ptr;
196 using Teuchos::updateParametersFromXmlFile;
197 using Teuchos::updateParametersFromXmlString;
198 using std::endl;
199
200 if (!paramList_.get()) {
201 paramList_ = parameterList("LinearSolverBuilder");
202 }
203 if (paramsXmlFileName().length()) {
204 if (out) {
205 *out << endl << "Reading parameters from XML file \""
206 << paramsXmlFileName() << "\" ..." << endl;
207 }
208 updateParametersFromXmlFile (paramsXmlFileName (), paramList_.ptr());
209 }
210 if (extraParamsXmlString().length()) {
211 if (out) {
212 *out << endl << "Appending extra parameters from the XML string \""
213 << extraParamsXmlString() << "\" ..." << endl;
214 }
215 updateParametersFromXmlString (extraParamsXmlString (), paramList_.ptr());
216 }
217 setParameterList(paramList_);
218}
219
220
221template<class Scalar>
223 const Thyra::LinearOpWithSolveFactoryBase<Scalar> &/* lowsFactory */,
224 const std::string &outputXmlFileName
225 ) const
226{
227 justInTimeInitialize();
228 const std::string xmlOutputFile =
229 ( outputXmlFileName.length() ? outputXmlFileName : paramsUsedXmlOutFileName() );
230 if (xmlOutputFile.length()) {
231 Teuchos::writeParameterListToXmlFile(*paramList_, xmlOutputFile);
232 }
233}
234
235
236template<class Scalar>
237std::string
239{
240 justInTimeInitialize();
241 return lowsfValidator_->getStringValue(*paramList_, LinearSolverType_name,
242 defaultLOWSF_);
243}
244
245
246template<class Scalar>
247std::string
249{
250 justInTimeInitialize();
251 return pfValidator_->getStringValue(*paramList_, PreconditionerType_name,
252 defaultPF_);
253}
254
255
256// Overridden from ParameterListAcceptor
257
258
259template<class Scalar>
261 RCP<Teuchos::ParameterList> const& paramList
262 )
263{
264 TEUCHOS_TEST_FOR_EXCEPT(is_null(paramList));
265 paramList->validateParameters(*this->getValidParameters());
266 paramList_ = paramList;
267 enableDelayedSolverConstruction_ = paramList_->get(
268 EnableDelayedSolverConstruction_name, EnableDelayedSolverConstruction_default );
269}
270
271
272template<class Scalar>
273RCP<Teuchos::ParameterList>
278
279
280template<class Scalar>
281RCP<Teuchos::ParameterList>
283{
284 RCP<Teuchos::ParameterList> _paramList = paramList_;
285 paramList_ = Teuchos::null;
286 return _paramList;
287}
288
289
290template<class Scalar>
291RCP<const Teuchos::ParameterList>
293{
294 return paramList_;
295}
296
297
298template<class Scalar>
299RCP<const Teuchos::ParameterList>
301{
302 using Teuchos::rcp_implicit_cast;
303 typedef Teuchos::ParameterEntryValidator PEV;
304 if (is_null(validParamList_)) {
305 RCP<Teuchos::ParameterList>
306 validParamList = Teuchos::rcp(new Teuchos::ParameterList);
307 // Linear Solver Types
308 lowsfValidator_ = Teuchos::rcp(
309 new Teuchos::StringToIntegralParameterEntryValidator<int>(
310 validLowsfNames_,LinearSolverType_name
311 )
312 );
313 validParamList->set(
314 LinearSolverType_name, defaultLOWSF_,
315 (std::string("Determines the type of linear solver that will be used.\n")
316 + "The parameters for each solver type are specified in the sublist \""
317 + LinearSolverTypes_name + "\"").c_str(),
318 rcp_implicit_cast<const PEV>(lowsfValidator_)
319 );
320 Teuchos::ParameterList &linearSolverTypesSL = validParamList->sublist(
321 LinearSolverTypes_name,false,
322 "Sublists for each of the linear solver types set using the parameter\n"
323 "\"" + LinearSolverType_name + "\". Note that the options for each\n"
324 "linear solver type given below will only be used if linear solvers\n"
325 "of that type are created. It is fine to list parameter sublists for\n"
326 "linear solver types that are not used."
327 );
328 for( int i = 0; i < static_cast<int>(lowsfArray_.size()); ++i ) {
329 const std::string
330 &lsname = validLowsfNames_[i];
331 const RCP<Thyra::LinearOpWithSolveFactoryBase<Scalar> >
332 lowsf = lowsfArray_[i]->create();
333 linearSolverTypesSL.sublist(lsname).setParameters(*lowsf->getValidParameters()
334 ).disableRecursiveValidation();
335 }
336 // Preconditioner Type
337 pfValidator_ = Teuchos::rcp(
338 new Teuchos::StringToIntegralParameterEntryValidator<int>(
339 validPfNames_, PreconditionerType_name ) );
340 validParamList->set(
341 PreconditionerType_name, defaultPF_,
342 (std::string("Determines the type of preconditioner that will be used.\n")
343 + "This option is only meaningful for linear solvers that accept preconditioner"
344 + " factory objects!\n"
345 + "The parameters for each preconditioner are specified in the sublist \""
346 + PreconditionerTypes_name + "\"").c_str(),
347 rcp_implicit_cast<const PEV>(pfValidator_)
348 );
349 Teuchos::ParameterList &precTypesSL = validParamList->sublist(
350 PreconditionerTypes_name,false,
351 "Sublists for each of the preconditioner types set using the parameter\n"
352 "\"" + PreconditionerType_name + "\". Note that the options for each\n"
353 "preconditioner type given below will only be used if preconditioners\n"
354 "of that type are created. It is fine to list parameter sublists for\n"
355 "preconditioner types that are not used."
356 );
357 for( int i = 0; i < static_cast<int>(pfArray_.size()); ++i ) {
358 const std::string
359 &pfname = validPfNames_[i+1]; // "None" is the 0th entry!
360 const RCP<Thyra::PreconditionerFactoryBase<Scalar> >
361 pf = pfArray_[i]->create();
362 precTypesSL.sublist(pfname).setParameters(*pf->getValidParameters()
363 ).disableRecursiveValidation();
364 }
365 //
366 validParamList->set(
367 EnableDelayedSolverConstruction_name, EnableDelayedSolverConstruction_default,
368 "When this option is set to true, the linear solver factory will be wrapped\n"
369 "in a delayed evaluation Decorator factory object. This results in a delay\n"
370 "in the creation of a linear solver (and the associated preconditioner) until\n"
371 "the first solve is actually performed. This helps in cases where it is not\n"
372 "known a-priori if a linear solve will be needed on a given linear operator and\n"
373 "therefore can significantly improve performance for some types of algorithms\n"
374 "such as NOX and LOCA."
375 );
376 //
377 validParamList_ = validParamList;
378 }
379 return validParamList_;
380}
381
382
383// Overridden from LinearSolverBuilderBase.
384
385
386template<class Scalar>
387RCP<Thyra::LinearOpWithSolveFactoryBase<Scalar> >
389 const std::string &linearSolveStrategyName
390 ) const
391{
392 justInTimeInitialize();
393
394 // Get the name of the linear solve strategy
395#ifdef THYRA_DEFAULT_REAL_LINEAR_SOLVER_BUILDER_DUMP
396 std::cout << "\nEntering LinearSolverBuilder"
397 << "::createLinearSolveStrategy(...) ...\n";
398 std::cout << "\nlinearSolveStrategyName = \""
399 << linearSolveStrategyName << "\"\n";
400 std::cout << "\nlinearSolveStrategyName.length() = "
401 << linearSolveStrategyName.length() << "\n";
402 std::cout << "\ndefaultLOWSF_ = \"" << defaultLOWSF_ << "\"\n";
403 std::cout << "\nthis->getLinearSolveStrategyName() = \""
404 << this->getLinearSolveStrategyName() << "\"\n";
405#endif
406 const std::string
407 lsname = ( linearSolveStrategyName.length()
408 ? linearSolveStrategyName
409 : this->getLinearSolveStrategyName() );
410#ifdef THYRA_DEFAULT_REAL_LINEAR_SOLVER_BUILDER_DUMP
411 std::cout << "\nlsname = \"" << lsname << "\"\n";
412#endif
413
414 // Get the index of this linear solver strategy (this will validate!)
415 const int
416 ls_idx = lowsfValidator_->getIntegralValue(lsname, LinearSolverType_name);
417
418 // Create the uninitialized LOWSFB object
419 RCP<Thyra::LinearOpWithSolveFactoryBase<Scalar> >
420 lowsf = lowsfArray_[ls_idx]->create();
421
422 // First, set the preconditioner factory and its parameters
423 if(lowsf->acceptsPreconditionerFactory()) {
424 const std::string &pfName = this->getPreconditionerStrategyName();
425 RCP<Thyra::PreconditionerFactoryBase<Scalar> >
426 pf = this->createPreconditioningStrategy(pfName);
427 if(pf.get())
428 lowsf->setPreconditionerFactory(pf,pfName);
429 }
430
431 // Now set the parameters for the linear solver (some of which might
432 // override some preconditioner factory parameters).
433 lowsf->setParameterList(
434 sublist(sublist(paramList_, LinearSolverTypes_name), lsname));
435 //
436 if (enableDelayedSolverConstruction_) {
437 return Teuchos::rcp(
438 new Thyra::DelayedLinearOpWithSolveFactory<Scalar>(lowsf)
439 );
440 }
441
442 return lowsf;
443
444}
445
446
447template<class Scalar>
448RCP<Thyra::PreconditionerFactoryBase<Scalar> >
450 const std::string &preconditioningStrategyName
451 ) const
452{
453 justInTimeInitialize();
454
455 // Get the name of the preconditioning strategy
456 const std::string
457 pfname = ( preconditioningStrategyName.length()
458 ? preconditioningStrategyName
459 : this->getPreconditionerStrategyName() );
460 RCP<Thyra::PreconditionerFactoryBase<Scalar> >
461 pf = Teuchos::null;
462
463 // Get the index of this preconditioning strategy (this will validate!)
464 const int
465 pf_idx = pfValidator_->getIntegralValue(pfname, PreconditionerType_name);
466 if( pf_idx != 0 ) {
467 pf = pfArray_[pf_idx-1]->create(); // We offset by -1 since "None" is first!
468 pf->setParameterList(
469 sublist(sublist(paramList_, PreconditionerTypes_name), pfname));
470 }
471
472 return pf;
473
474}
475
476
477// private
478
479template<class Scalar>
481{
482
483 using Teuchos::rcp;
484 using Teuchos::abstractFactoryStd;
485
486 defaultLOWSF_ = "";
487 defaultPF_ = None_name;
488 validLowsfNames_.resize(0);
489 validPfNames_.resize(0);
490 validPfNames_.push_back(None_name); // This will offset everything!
491
492 //
493 // Linear Solvers
494 //
495
496#ifdef HAVE_STRATIMIKOS_AMESOS2
497 setLinearSolveStrategyFactory(
498 abstractFactoryStd<Thyra::LinearOpWithSolveFactoryBase<Scalar>,
499 Thyra::Amesos2LinearOpWithSolveFactory<Scalar>>(),
500 "Amesos2", true
501 );
502#endif
503
504#ifdef HAVE_STRATIMIKOS_BELOS
505 setLinearSolveStrategyFactory(
506 abstractFactoryStd<Thyra::LinearOpWithSolveFactoryBase<Scalar>,
508 "Belos", true
509 );
510#endif
511
512#if defined(HAVE_STRATIMIKOS_IFPACK2) && defined(HAVE_STRATIMIKOS_THYRATPETRAADAPTERS)
513 setPreconditioningStrategyFactory(
514 abstractFactoryStd<Thyra::PreconditionerFactoryBase<Scalar>,
515 Thyra::Ifpack2PreconditionerFactory<Tpetra::CrsMatrix<Scalar>>>(),
516 "Ifpack2", true
517 );
518#endif
519
520
521 // Note: Above, the last PF object set will be the default!
522
523}
524
525template<>
526void LinearSolverBuilder<double>::initializeDefaults()
527{
528 using Scalar = double;
529 using Teuchos::rcp;
530 using Teuchos::abstractFactoryStd;
531
532 defaultLOWSF_ = "";
533 defaultPF_ = None_name;
534 validLowsfNames_.resize(0);
535 validPfNames_.resize(0);
536 validPfNames_.push_back(None_name); // This will offset everything!
537
538 //
539 // Linear Solvers
540 //
541
542#ifdef HAVE_STRATIMIKOS_AMESOS2
543 setLinearSolveStrategyFactory(
544 abstractFactoryStd<Thyra::LinearOpWithSolveFactoryBase<Scalar>,
545 Thyra::Amesos2LinearOpWithSolveFactory<Scalar>>(),
546 "Amesos2", true
547 );
548#endif
549
550#ifdef HAVE_STRATIMIKOS_BELOS
551 setLinearSolveStrategyFactory(
552 abstractFactoryStd<Thyra::LinearOpWithSolveFactoryBase<Scalar>,
554 "Belos", true
555 );
556#endif
557
558#ifdef HAVE_STRATIMIKOS_AMESOS
559 setLinearSolveStrategyFactory(
560 abstractFactoryStd<Thyra::LinearOpWithSolveFactoryBase<Scalar>,
562 "Amesos", true
563 );
564#endif
565
566#if defined(HAVE_STRATIMIKOS_EPETRAEXT) && defined(HAVE_STRATIMIKOS_AZTECOO)
567 setLinearSolveStrategyFactory(
568 abstractFactoryStd<Thyra::LinearOpWithSolveFactoryBase<Scalar>,
570 "AztecOO", true
571 );
572#endif
573
574 // Note: Above, the last LOWSF object set will be the default!
575 // (unless we have only one processor, see below:)
576
577#ifdef HAVE_STRATIMIKOS_AMESOS
578 if (Teuchos::GlobalMPISession::getNProc() == 1) {
579 setDefaultLinearSolveStrategyFactoryName("Amesos");
580 }
581#endif
582
583 //
584 // Preconditioners
585 //
586
587#ifdef HAVE_STRATIMIKOS_ML
588 setPreconditioningStrategyFactory(
589 abstractFactoryStd<Thyra::PreconditionerFactoryBase<Scalar>,
591 "ML", true
592 );
593#endif
594
595#if defined(HAVE_STRATIMIKOS_IFPACK2) && defined(HAVE_STRATIMIKOS_THYRATPETRAADAPTERS)
596 setPreconditioningStrategyFactory(
597 abstractFactoryStd<Thyra::PreconditionerFactoryBase<Scalar>,
598 Thyra::Ifpack2PreconditionerFactory<Tpetra::CrsMatrix<Scalar>>>(),
599 "Ifpack2", true
600 );
601#endif
602
603#ifdef HAVE_STRATIMIKOS_IFPACK
604 setPreconditioningStrategyFactory(
605 abstractFactoryStd<Thyra::PreconditionerFactoryBase<Scalar>,
607 "Ifpack", true
608 );
609#endif
610
611 // Note: Above, the last PF object set will be the default!
612
613}
614
615
616template<class Scalar>
617void LinearSolverBuilder<Scalar>::justInTimeInitialize() const
618{
619 paramList_.assert_not_null();
620 if (is_null(validParamList_)) {
621 // Create the validators
622 this->getValidParameters();
623 }
624}
625
626
627template<class Scalar>
628int LinearSolverBuilder<Scalar>::getAndAssertExistingFactoryNameIdx(
629 const std::string &setFunctionName, const Teuchos::ArrayView<std::string> namesArray,
630 const std::string &name) const
631{
632 const int existingNameIdx =
633 LinearSolverBuilderHelpers::existingNameIndex(namesArray, name);
634 TEUCHOS_TEST_FOR_EXCEPTION(
635 (!replaceDuplicateFactories_ && existingNameIdx >= 0), std::logic_error,
636 "ERROR: "<<setFunctionName<<": the name='"<<name<<"' already exists"
637 << " at index="<<existingNameIdx<<"!\n"
638 << "\n"
639 << "TIP: To allow duplicates, change the property replaceDuplicateFactories from"
640 << " false to true by calling <thisObject>.replaceDuplicateFactories(true)"
641 << " where <thisObject> is of type Stratimikos::LinearSolverBuilder<Scalar>!");
642 return existingNameIdx;
643}
644
645
646//
647// Explicit instantiation macro
648//
649// Must be expanded from within the Stratimikos namespace!
650//
651
652
653#define STRATIMIKOS_LINEARSOLVERBUILDER_INSTANT(SCALAR) \
654 \
655 template class LinearSolverBuilder<SCALAR >;
656
657
658
659} // namespace Stratimikos
660
661#endif // STRATIMIKOS_LINEARSOLVERBUILDER_DEF_HPP
Concrete subclass of Thyra::LinearSolverBuilderBase for creating Thyra::LinearOpWithSolveFactoryBase ...
void setLinearSolveStrategyFactory(const RCP< const AbstractFactory< Thyra::LinearOpWithSolveFactoryBase< Scalar > > > &solveStrategyFactory, const std::string &solveStrategyName, const bool makeDefault=false)
Set a new linear solver strategy factory object.
RCP< Thyra::PreconditionerFactoryBase< Scalar > > createPreconditioningStrategy(const std::string &preconditioningStrategyName) const
RCP< const ParameterList > getParameterList() const
std::string getLinearSolveStrategyName() const
Get the name of the linear solver strategy that will be created on the next call to this->createLinea...
void setDefaultPreconditioningStrategyFactoryName(const std::string &precStrategyName)
Set the default linear solver factory name.
RCP< const ParameterList > getValidParameters() const
LinearSolverBuilder(const std::string &paramsXmlFileName="", const std::string &extraParamsXmlString="", const std::string &paramsUsedXmlOutFileName="", const std::string &paramsXmlFileNameOption="linear-solver-params-file", const std::string &extraParamsXmlStringOption="extra-linear-solver-params", const std::string &paramsUsedXmlOutFileNameOption="linear-solver-params-used-file", const bool &replaceDuplicateFactories=true)
Construct with default parameters.
RCP< Thyra::LinearOpWithSolveFactoryBase< Scalar > > createLinearSolveStrategy(const std::string &linearSolveStrategyName) const
std::string getPreconditionerStrategyName() const
Get the name of the preconditioner strategy that will be created on the next call to this->createPrec...
void setParameterList(RCP< ParameterList > const &paramList)
void setDefaultLinearSolveStrategyFactoryName(const std::string &solveStrategyName)
Set the default linear solver factory name.
void setupCLP(Teuchos::CommandLineProcessor *clp)
Setup the command-line processor to read in the needed data to extra the parameters from.
void readParameters(std::ostream *out)
Force the parameters to be read from a file and/or an extra XML string.
void setPreconditioningStrategyFactory(const RCP< const AbstractFactory< Thyra::PreconditionerFactoryBase< Scalar > > > &precStrategyFactory, const std::string &precStrategyName, const bool makeDefault=false)
Set a new preconditioner strategy factory object.
void writeParamsFile(const Thyra::LinearOpWithSolveFactoryBase< Scalar > &lowsFactory, const std::string &outputXmlFileName="") const
Write the parameters list for a LinearOpWithSolveFactoryBase object to a file after the parameters ar...
Concrete LinearOpWithSolveFactoryBase adapter subclass that uses Amesos direct solvers.
LinearOpWithSolveFactoryBase subclass implemented in terms of AztecOO.
LinearOpWithSolveFactoryBase subclass implemented in terms of Belos.
Concrete preconditioner factory subclass based on Ifpack.
Concrete preconditioner factory subclass based on ML.

Generated for Stratimikos by doxygen 1.9.8