45 #ifndef THYRA_BELOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
46 #define THYRA_BELOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
49 #include "Thyra_BelosLinearOpWithSolveFactory_decl.hpp"
50 #include "Thyra_BelosLinearOpWithSolve.hpp"
51 #include "Thyra_ScaledAdjointLinearOpBase.hpp"
66 #include "Teuchos_VerboseObjectParameterListHelpers.hpp"
67 #include "Teuchos_StandardParameterEntryValidators.hpp"
68 #include "Teuchos_ParameterList.hpp"
69 #include "Teuchos_dyn_cast.hpp"
70 #include "Teuchos_ValidatorXMLConverterDB.hpp"
71 #include "Teuchos_StandardValidatorXMLConverters.hpp"
79 template<
class Scalar>
81 template<
class Scalar>
83 template<
class Scalar>
85 template<
class Scalar>
87 template<
class Scalar>
89 template<
class Scalar>
91 template<
class Scalar>
93 template<
class Scalar>
95 template<
class Scalar>
97 template<
class Scalar>
99 template<
class Scalar>
101 template<
class Scalar>
103 template<
class Scalar>
105 template<
class Scalar>
107 template<
class Scalar>
111 const std::string LeftPreconditionerIfUnspecified_name =
"Left Preconditioner If Unspecified";
117 template<
class Scalar>
119 :solverType_(SOLVER_TYPE_PSEUDO_BLOCK_GMRES),
120 convergenceTestFrequency_(1)
122 updateThisValidParamList();
126 template<
class Scalar>
128 const RCP<PreconditionerFactoryBase<Scalar> > &precFactory
130 :solverType_(SOLVER_TYPE_PSEUDO_BLOCK_GMRES)
139 template<
class Scalar>
146 template<
class Scalar>
148 const RCP<PreconditionerFactoryBase<Scalar> > &precFactory,
149 const std::string &precFactoryName
152 TEUCHOS_TEST_FOR_EXCEPT(!precFactory.get());
153 RCP<const Teuchos::ParameterList>
154 precFactoryValidPL = precFactory->getValidParameters();
155 const std::string _precFactoryName =
156 ( precFactoryName !=
""
158 : ( precFactoryValidPL.get() ? precFactoryValidPL->name() :
"GENERIC PRECONDITIONER FACTORY" )
160 precFactory_ = precFactory;
161 precFactoryName_ = _precFactoryName;
162 updateThisValidParamList();
166 template<
class Scalar>
167 RCP<PreconditionerFactoryBase<Scalar> >
174 template<
class Scalar>
176 RCP<PreconditionerFactoryBase<Scalar> > *precFactory,
177 std::string *precFactoryName
180 if(precFactory) *precFactory = precFactory_;
181 if(precFactoryName) *precFactoryName = precFactoryName_;
182 precFactory_ = Teuchos::null;
183 precFactoryName_ =
"";
184 updateThisValidParamList();
188 template<
class Scalar>
190 const LinearOpSourceBase<Scalar> &fwdOpSrc
193 if(precFactory_.get())
194 return precFactory_->isCompatible(fwdOpSrc);
199 template<
class Scalar>
200 RCP<LinearOpWithSolveBase<Scalar> >
207 template<
class Scalar>
209 const RCP<
const LinearOpSourceBase<Scalar> > &fwdOpSrc,
210 LinearOpWithSolveBase<Scalar> *Op,
211 const ESupportSolveUse supportSolveUse
215 initializeOpImpl(fwdOpSrc,
null,
null,
false,Op,supportSolveUse);
219 template<
class Scalar>
221 const RCP<
const LinearOpSourceBase<Scalar> > &fwdOpSrc,
222 LinearOpWithSolveBase<Scalar> *Op
226 initializeOpImpl(fwdOpSrc,
null,
null,
true,Op,SUPPORT_SOLVE_UNSPECIFIED);
230 template<
class Scalar>
232 const EPreconditionerInputType precOpType
235 if(precFactory_.get())
237 return (precOpType==PRECONDITIONER_INPUT_TYPE_AS_OPERATOR);
241 template<
class Scalar>
243 const RCP<
const LinearOpSourceBase<Scalar> > &fwdOpSrc,
244 const RCP<
const PreconditionerBase<Scalar> > &prec,
245 LinearOpWithSolveBase<Scalar> *Op,
246 const ESupportSolveUse supportSolveUse
250 initializeOpImpl(fwdOpSrc,
null,prec,
false,Op,supportSolveUse);
254 template<
class Scalar>
256 const RCP<
const LinearOpSourceBase<Scalar> > &fwdOpSrc,
257 const RCP<
const LinearOpSourceBase<Scalar> > &approxFwdOpSrc,
258 LinearOpWithSolveBase<Scalar> *Op,
259 const ESupportSolveUse supportSolveUse
263 initializeOpImpl(fwdOpSrc,approxFwdOpSrc,
null,
false,Op,supportSolveUse);
267 template<
class Scalar>
269 LinearOpWithSolveBase<Scalar> *Op,
270 RCP<
const LinearOpSourceBase<Scalar> > *fwdOpSrc,
271 RCP<
const PreconditionerBase<Scalar> > *prec,
272 RCP<
const LinearOpSourceBase<Scalar> > *approxFwdOpSrc,
273 ESupportSolveUse *supportSolveUse
277 TEUCHOS_TEST_FOR_EXCEPT(Op==NULL);
280 &belosOp = Teuchos::dyn_cast<BelosLinearOpWithSolve<Scalar> >(*Op);
281 RCP<const LinearOpSourceBase<Scalar> >
283 RCP<const PreconditionerBase<Scalar> >
288 RCP<const LinearOpSourceBase<Scalar> >
292 if(fwdOpSrc) *fwdOpSrc = _fwdOpSrc;
293 if(prec) *prec = _prec;
294 if(approxFwdOpSrc) *approxFwdOpSrc = _approxFwdOpSrc;
295 if(supportSolveUse) *supportSolveUse = _supportSolveUse;
302 template<
class Scalar>
304 RCP<Teuchos::ParameterList>
const& paramList
307 TEUCHOS_TEST_FOR_EXCEPT(paramList.get()==NULL);
308 paramList->validateParametersAndSetDefaults(*this->getValidParameters(), 1);
309 paramList_ = paramList;
311 Teuchos::getIntegralValue<EBelosSolverType>(*paramList_, SolverType_name);
312 convergenceTestFrequency_ =
313 Teuchos::getParameter<int>(*paramList_, ConvergenceTestFrequency_name);
314 Teuchos::readVerboseObjectSublist(&*paramList_,
this);
318 template<
class Scalar>
319 RCP<Teuchos::ParameterList>
326 template<
class Scalar>
327 RCP<Teuchos::ParameterList>
330 RCP<Teuchos::ParameterList> _paramList = paramList_;
331 paramList_ = Teuchos::null;
336 template<
class Scalar>
337 RCP<const Teuchos::ParameterList>
344 template<
class Scalar>
345 RCP<const Teuchos::ParameterList>
348 return thisValidParamList_;
355 template<
class Scalar>
358 std::ostringstream oss;
359 oss <<
"Thyra::BelosLinearOpWithSolveFactory";
370 template<
class Scalar>
371 RCP<const Teuchos::ParameterList>
375 using Teuchos::tuple;
376 using Teuchos::setStringToIntegralParameter;
377 Teuchos::ValidatorXMLConverterDB::addConverter(
378 Teuchos::DummyObjectGetter<
379 Teuchos::StringToIntegralParameterEntryValidator<EBelosSolverType>
381 Teuchos::DummyObjectGetter<Teuchos::StringToIntegralValidatorXMLConverter<
382 EBelosSolverType> >::getDummyObject());
384 typedef MultiVectorBase<Scalar> MV_t;
385 typedef LinearOpBase<Scalar> LO_t;
386 static RCP<Teuchos::ParameterList> validParamList;
387 if(validParamList.get()==NULL) {
388 validParamList = Teuchos::rcp(
new Teuchos::ParameterList(
"BelosLinearOpWithSolveFactory"));
389 setStringToIntegralParameter<EBelosSolverType>(
390 SolverType_name, SolverType_default,
391 "Type of linear solver algorithm to use.",
394 "Pseudo Block GMRES",
397 "Pseudo Block Stochastic CG",
406 "Block GMRES solver for nonsymmetric linear systems. It can also solve "
407 "single right-hand side systems, and can also perform Flexible GMRES "
408 "(where the preconditioner may change at every iteration, for example "
409 "for inner-outer iterations), by setting options in the \"Block GMRES\" "
412 "GMRES solver for nonsymmetric linear systems, that performs single "
413 "right-hand side solves on multiple right-hand sides at once. It "
414 "exploits operator multivector multiplication in order to amortize "
415 "global communication costs. Individual linear systems are deflated "
416 "out as they are solved.",
418 "Block CG solver for symmetric (Hermitian in complex arithmetic) "
419 "positive definite linear systems. It can also solve single "
420 "right-hand-side systems.",
422 "CG solver that performs single right-hand side CG on multiple right-hand "
423 "sides at once. It exploits operator multivector multiplication in order "
424 "to amortize global communication costs. Individual linear systems are "
425 "deflated out as they are solved.",
427 "stochastic CG solver that performs single right-hand side CG on multiple right-hand "
428 "sides at once. It exploits operator multivector multiplication in order "
429 "to amortize global communication costs. Individual linear systems are "
430 "deflated out as they are solved. [EXPERIMENTAL]",
432 "Variant of GMRES that performs subspace recycling to accelerate "
433 "convergence for sequences of solves with related linear systems. "
434 "Individual linear systems are deflated out as they are solved. "
435 "The current implementation only supports real-valued Scalar types.",
437 "CG solver for symmetric (Hermitian in complex arithmetic) positive "
438 "definite linear systems, that performs subspace recycling to "
439 "accelerate convergence for sequences of related linear systems.",
441 "MINRES solver for symmetric indefinite linear systems. It performs "
442 "single-right-hand-side solves on multiple right-hand sides sequentially.",
444 "TFQMR (Transpose-Free QMR) solver for nonsymmetric linear systems.",
446 "BiCGStab solver for nonsymmetric linear systems.",
448 "Fixed point iteration"
450 tuple<EBelosSolverType>(
451 SOLVER_TYPE_BLOCK_GMRES,
452 SOLVER_TYPE_PSEUDO_BLOCK_GMRES,
453 SOLVER_TYPE_BLOCK_CG,
454 SOLVER_TYPE_PSEUDO_BLOCK_CG,
455 SOLVER_TYPE_PSEUDO_BLOCK_STOCHASTIC_CG,
460 SOLVER_TYPE_BICGSTAB,
461 SOLVER_TYPE_FIXEDPOINT
465 validParamList->set(ConvergenceTestFrequency_name, as<int>(1),
466 "Number of linear solver iterations to skip between applying"
467 " user-defined convergence test.");
469 LeftPreconditionerIfUnspecified_name,
false,
470 "If the preconditioner does not specify if it is left or right, and this\n"
471 "option is set to true, put the preconditioner on the left side.\n"
472 "Historically, preconditioning is on the right. Some solvers may not\n"
473 "support left preconditioning.");
474 Teuchos::ParameterList
475 &solverTypesSL = validParamList->sublist(SolverTypes_name);
491 *mgr.getValidParameters()
496 solverTypesSL.sublist(PseudoBlockCG_name).setParameters(
497 *mgr.getValidParameters()
502 solverTypesSL.sublist(PseudoBlockStochasticCG_name).setParameters(
509 *mgr.getValidParameters()
514 solverTypesSL.sublist(RCG_name).setParameters(
515 *mgr.getValidParameters()
520 solverTypesSL.sublist(MINRES_name).setParameters(
543 return validParamList;
547 template<
class Scalar>
548 void BelosLinearOpWithSolveFactory<Scalar>::updateThisValidParamList()
550 thisValidParamList_ = Teuchos::rcp(
551 new Teuchos::ParameterList(*generateAndGetValidParameters())
553 Teuchos::setupVerboseObjectSublist(&*thisValidParamList_);
557 template<
class Scalar>
558 void BelosLinearOpWithSolveFactory<Scalar>::initializeOpImpl(
559 const RCP<
const LinearOpSourceBase<Scalar> > &fwdOpSrc,
560 const RCP<
const LinearOpSourceBase<Scalar> > &approxFwdOpSrc,
561 const RCP<
const PreconditionerBase<Scalar> > &prec_in,
562 const bool reusePrec,
563 LinearOpWithSolveBase<Scalar> *Op,
564 const ESupportSolveUse supportSolveUse
569 using Teuchos::set_extra_data;
570 typedef Teuchos::ScalarTraits<Scalar> ST;
571 typedef MultiVectorBase<Scalar> MV_t;
572 typedef LinearOpBase<Scalar> LO_t;
574 const RCP<Teuchos::FancyOStream> out = this->getOStream();
575 const Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
576 Teuchos::OSTab tab(out);
577 if(out.get() &&
static_cast<int>(verbLevel) >
static_cast<int>(Teuchos::VERB_LOW))
578 *out <<
"\nEntering Thyra::BelosLinearOpWithSolveFactory<"<<ST::name()<<
">::initializeOpImpl(...) ...\n";
585 TEUCHOS_TEST_FOR_EXCEPT(Op==NULL);
586 TEUCHOS_TEST_FOR_EXCEPT(fwdOpSrc.get()==NULL);
587 TEUCHOS_TEST_FOR_EXCEPT(fwdOpSrc->getOp().get()==NULL);
588 RCP<const LinearOpBase<Scalar> >
589 fwdOp = fwdOpSrc->getOp(),
590 approxFwdOp = ( approxFwdOpSrc.get() ? approxFwdOpSrc->getOp() : Teuchos::null );
596 BelosLinearOpWithSolve<Scalar>
597 *belosOp = &Teuchos::dyn_cast<BelosLinearOpWithSolve<Scalar> >(*Op);
603 RCP<PreconditionerBase<Scalar> > myPrec = Teuchos::null;
604 RCP<const PreconditionerBase<Scalar> > prec = Teuchos::null;
611 if(precFactory_.get()) {
613 ( !belosOp->isExternalPrec()
614 ? Teuchos::rcp_const_cast<PreconditionerBase<Scalar> >(belosOp->extract_prec())
617 bool hasExistingPrec =
false;
619 hasExistingPrec =
true;
624 hasExistingPrec =
false;
625 myPrec = precFactory_->createPrec();
627 if( hasExistingPrec && reusePrec ) {
632 if(approxFwdOp.get())
633 precFactory_->initializePrec(approxFwdOpSrc,&*myPrec);
635 precFactory_->initializePrec(fwdOpSrc,&*myPrec);
645 bool oldIsExternalPrec =
false;
646 RCP<Belos::LinearProblem<Scalar,MV_t,LO_t> > oldLP = Teuchos::null;
647 RCP<Belos::SolverManager<Scalar,MV_t,LO_t> > oldIterSolver = Teuchos::null;
648 RCP<const LinearOpSourceBase<Scalar> > oldFwdOpSrc = Teuchos::null;
649 RCP<const LinearOpSourceBase<Scalar> > oldApproxFwdOpSrc = Teuchos::null;
650 ESupportSolveUse oldSupportSolveUse = SUPPORT_SOLVE_UNSPECIFIED;
652 belosOp->uninitialize( &oldLP, NULL, &oldIterSolver, &oldFwdOpSrc,
653 NULL, &oldIsExternalPrec, &oldApproxFwdOpSrc, &oldSupportSolveUse );
662 if (oldLP != Teuchos::null) {
666 lp = rcp(
new LP_t());
673 lp->setOperator(fwdOp);
680 RCP<const LinearOpBase<Scalar> > unspecified = prec->getUnspecifiedPrecOp();
681 RCP<const LinearOpBase<Scalar> > left = prec->getLeftPrecOp();
682 RCP<const LinearOpBase<Scalar> > right = prec->getRightPrecOp();
683 TEUCHOS_TEST_FOR_EXCEPTION(
684 !( left.get() || right.get() || unspecified.get() ), std::logic_error
685 ,
"Error, at least one preconditoner linear operator objects must be set!"
687 if (nonnull(unspecified)) {
688 if (paramList_->get<
bool>(LeftPreconditionerIfUnspecified_name,
false))
689 lp->setLeftPrec(unspecified);
691 lp->setRightPrec(unspecified);
693 else if (nonnull(left)) {
694 lp->setLeftPrec(left);
696 else if (nonnull(right)) {
697 lp->setRightPrec(right);
701 TEUCHOS_TEST_FOR_EXCEPTION(
702 nonnull(left) && nonnull(right),std::logic_error
703 ,
"Error, we can not currently handle split preconditioners!"
708 set_extra_data<RCP<PreconditionerBase<Scalar> > >(myPrec,
"Belos::InternalPrec",
709 Teuchos::inOutArg(lp), Teuchos::POST_DESTROY,
false);
711 else if(prec.get()) {
712 set_extra_data<RCP<const PreconditionerBase<Scalar> > >(prec,
"Belos::ExternalPrec",
713 Teuchos::inOutArg(lp), Teuchos::POST_DESTROY,
false);
721 RCP<IterativeSolver_t> iterativeSolver = Teuchos::null;
722 RCP<Teuchos::ParameterList> solverPL = Teuchos::rcp(
new Teuchos::ParameterList() );
724 switch(solverType_) {
725 case SOLVER_TYPE_BLOCK_GMRES:
728 if(paramList_.get()) {
729 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
730 Teuchos::ParameterList &gmresPL = solverTypesPL.sublist(BlockGMRES_name);
731 solverPL = Teuchos::rcp( &gmresPL,
false );
734 if (oldIterSolver != Teuchos::null) {
735 iterativeSolver = oldIterSolver;
736 iterativeSolver->setProblem( lp );
737 iterativeSolver->setParameters( solverPL );
744 case SOLVER_TYPE_PSEUDO_BLOCK_GMRES:
747 if(paramList_.get()) {
748 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
749 Teuchos::ParameterList &pbgmresPL = solverTypesPL.sublist(PseudoBlockGMRES_name);
750 solverPL = Teuchos::rcp( &pbgmresPL,
false );
755 if (oldIterSolver != Teuchos::null) {
756 iterativeSolver = oldIterSolver;
757 iterativeSolver->setProblem( lp );
758 iterativeSolver->setParameters( solverPL );
765 case SOLVER_TYPE_BLOCK_CG:
768 if(paramList_.get()) {
769 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
770 Teuchos::ParameterList &cgPL = solverTypesPL.sublist(BlockCG_name);
771 solverPL = Teuchos::rcp( &cgPL,
false );
774 if (oldIterSolver != Teuchos::null) {
775 iterativeSolver = oldIterSolver;
776 iterativeSolver->setProblem( lp );
777 iterativeSolver->setParameters( solverPL );
784 case SOLVER_TYPE_PSEUDO_BLOCK_CG:
787 if(paramList_.get()) {
788 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
789 Teuchos::ParameterList &pbcgPL = solverTypesPL.sublist(PseudoBlockCG_name);
790 solverPL = Teuchos::rcp( &pbcgPL,
false );
795 if (oldIterSolver != Teuchos::null) {
796 iterativeSolver = oldIterSolver;
797 iterativeSolver->setProblem( lp );
798 iterativeSolver->setParameters( solverPL );
805 case SOLVER_TYPE_PSEUDO_BLOCK_STOCHASTIC_CG:
808 if(paramList_.get()) {
809 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
810 Teuchos::ParameterList &pbcgPL = solverTypesPL.sublist(PseudoBlockStochasticCG_name);
811 solverPL = Teuchos::rcp( &pbcgPL,
false );
816 if (oldIterSolver != Teuchos::null) {
817 iterativeSolver = oldIterSolver;
818 iterativeSolver->setProblem( lp );
819 iterativeSolver->setParameters( solverPL );
826 case SOLVER_TYPE_GCRODR:
829 if(paramList_.get()) {
830 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
831 Teuchos::ParameterList &gcrodrPL = solverTypesPL.sublist(GCRODR_name);
832 solverPL = Teuchos::rcp( &gcrodrPL,
false );
835 if (oldIterSolver != Teuchos::null) {
836 iterativeSolver = oldIterSolver;
837 iterativeSolver->setProblem( lp );
838 iterativeSolver->setParameters( solverPL );
845 case SOLVER_TYPE_RCG:
848 if(paramList_.get()) {
849 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
850 Teuchos::ParameterList &rcgPL = solverTypesPL.sublist(RCG_name);
851 solverPL = Teuchos::rcp( &rcgPL,
false );
854 if (oldIterSolver != Teuchos::null) {
855 iterativeSolver = oldIterSolver;
856 iterativeSolver->setProblem( lp );
857 iterativeSolver->setParameters( solverPL );
864 case SOLVER_TYPE_MINRES:
867 if(paramList_.get()) {
868 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
869 Teuchos::ParameterList &minresPL = solverTypesPL.sublist(MINRES_name);
870 solverPL = Teuchos::rcp( &minresPL,
false );
873 if (oldIterSolver != Teuchos::null) {
874 iterativeSolver = oldIterSolver;
875 iterativeSolver->setProblem( lp );
876 iterativeSolver->setParameters( solverPL );
883 case SOLVER_TYPE_TFQMR:
886 if(paramList_.get()) {
887 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
888 Teuchos::ParameterList &minresPL = solverTypesPL.sublist(TFQMR_name);
889 solverPL = Teuchos::rcp( &minresPL,
false );
892 if (oldIterSolver != Teuchos::null) {
893 iterativeSolver = oldIterSolver;
894 iterativeSolver->setProblem( lp );
895 iterativeSolver->setParameters( solverPL );
902 case SOLVER_TYPE_BICGSTAB:
905 if(paramList_.get()) {
906 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
907 Teuchos::ParameterList &bicgstabPL = solverTypesPL.sublist(BiCGStab_name);
908 solverPL = Teuchos::rcp( &bicgstabPL,
false );
911 if (oldIterSolver != Teuchos::null) {
912 iterativeSolver = oldIterSolver;
913 iterativeSolver->setProblem( lp );
914 iterativeSolver->setParameters( solverPL );
921 case SOLVER_TYPE_FIXEDPOINT:
924 if(paramList_.get()) {
925 Teuchos::ParameterList &solverTypesPL = paramList_->sublist(SolverTypes_name);
926 Teuchos::ParameterList &fixedPointPL = solverTypesPL.sublist(FixedPoint_name);
927 solverPL = Teuchos::rcp( &fixedPointPL,
false );
930 if (oldIterSolver != Teuchos::null) {
931 iterativeSolver = oldIterSolver;
932 iterativeSolver->setProblem( lp );
933 iterativeSolver->setParameters( solverPL );
943 TEUCHOS_TEST_FOR_EXCEPT(
true);
952 lp, solverPL, iterativeSolver,
953 fwdOpSrc, prec, myPrec.get()==NULL, approxFwdOpSrc,
954 supportSolveUse, convergenceTestFrequency_
956 belosOp->setOStream(out);
957 belosOp->setVerbLevel(verbLevel);
959 if(paramList_.get()) {
961 paramList_->validateParameters(*this->getValidParameters(),1);
964 if(out.get() &&
static_cast<int>(verbLevel) >
static_cast<int>(Teuchos::VERB_LOW))
965 *out <<
"\nLeaving Thyra::BelosLinearOpWithSolveFactory<"<<ST::name()<<
">::initializeOpImpl(...) ...\n";
Thyra specializations of MultiVecTraits and OperatorTraits.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
LinearOpWithSolveFactoryBase subclass implemented in terms of Belos.
void unsetPreconditionerFactory(Teuchos::RCP< PreconditionerFactoryBase< Scalar > > *precFactory, std::string *precFactoryName)
bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
bool isCompatible(const LinearOpSourceBase< Scalar > &fwdOpSrc) const
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList)
static const std::string TFQMR_name
static const std::string ConvergenceTestFrequency_name
static const std::string BlockGMRES_name
static const std::string SolverType_name
void initializePreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const Teuchos::RCP< const PreconditionerBase< Scalar > > &prec, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
std::string description() const
static const std::string SolverTypes_name
static const std::string MINRES_name
static const std::string SolverType_default
static const std::string BiCGStab_name
void setPreconditionerFactory(const Teuchos::RCP< PreconditionerFactoryBase< Scalar > > &precFactory, const std::string &precFactoryName)
static const std::string GCRODR_name
void initializeAndReuseOp(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op) const
static const std::string PseudoBlockCG_name
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
static const std::string RCG_name
static const std::string BlockCG_name
void initializeOp(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
bool acceptsPreconditionerFactory() const
Returns true .
static const std::string FixedPoint_name
void uninitializeOp(LinearOpWithSolveBase< Scalar > *Op, Teuchos::RCP< const LinearOpSourceBase< Scalar > > *fwdOpSrc, Teuchos::RCP< const PreconditionerBase< Scalar > > *prec, Teuchos::RCP< const LinearOpSourceBase< Scalar > > *approxFwdOpSrc, ESupportSolveUse *supportSolveUse) const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
BelosLinearOpWithSolveFactory()
Construct without preconditioner factory.
void initializeApproxPreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &approxFwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
Teuchos::RCP< LinearOpWithSolveBase< Scalar > > createOp() const
static const std::string PseudoBlockGMRES_name
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
static const std::string PseudoBlockStochasticCG_name
Teuchos::RCP< PreconditionerFactoryBase< Scalar > > getPreconditionerFactory() const
Concrete LinearOpWithSolveBase subclass in terms of Belos.
ESupportSolveUse supportSolveUse() const
RCP< const LinearOpSourceBase< Scalar > > extract_approxFwdOpSrc()
RCP< const PreconditionerBase< Scalar > > extract_prec()
bool isExternalPrec() const
RCP< const LinearOpSourceBase< Scalar > > extract_fwdOpSrc()