10 #ifndef THYRA_BELOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
11 #define THYRA_BELOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
14 #include "Thyra_BelosLinearOpWithSolveFactory_decl.hpp"
15 #include "Thyra_BelosLinearOpWithSolve.hpp"
16 #include "Thyra_ScaledAdjointLinearOpBase.hpp"
31 #if defined(HAVE_BELOS_TPETRA) && defined(HAVE_STRATIMIKOS_THYRATPETRAADAPTERS)
32 #include "Thyra_BelosTpetrasSolverAdapter.hpp"
35 #include "Teuchos_VerboseObjectParameterListHelpers.hpp"
36 #include "Teuchos_StandardParameterEntryValidators.hpp"
37 #include "Teuchos_ParameterList.hpp"
38 #include "Teuchos_dyn_cast.hpp"
39 #include "Teuchos_ValidatorXMLConverterDB.hpp"
40 #include "Teuchos_StandardValidatorXMLConverters.hpp"
48 template<
class Scalar>
49 const std::string BelosLinearOpWithSolveFactory<Scalar>::SolverType_name =
"Solver Type";
50 template<
class Scalar>
51 const std::string BelosLinearOpWithSolveFactory<Scalar>::SolverType_default =
"Pseudo Block GMRES";
52 template<
class Scalar>
53 const std::string BelosLinearOpWithSolveFactory<Scalar>::SolverTypes_name =
"Solver Types";
54 template<
class Scalar>
55 const std::string BelosLinearOpWithSolveFactory<Scalar>::BlockGMRES_name =
"Block GMRES";
56 template<
class Scalar>
57 const std::string BelosLinearOpWithSolveFactory<Scalar>::PseudoBlockGMRES_name =
"Pseudo Block GMRES";
58 template<
class Scalar>
59 const std::string BelosLinearOpWithSolveFactory<Scalar>::BlockCG_name =
"Block CG";
60 template<
class Scalar>
61 const std::string BelosLinearOpWithSolveFactory<Scalar>::PseudoBlockCG_name =
"Pseudo Block CG";
62 template<
class Scalar>
63 const std::string BelosLinearOpWithSolveFactory<Scalar>::PseudoBlockStochasticCG_name =
"Pseudo Block Stochastic CG";
64 template<
class Scalar>
65 const std::string BelosLinearOpWithSolveFactory<Scalar>::GCRODR_name =
"GCRODR";
66 template<
class Scalar>
67 const std::string BelosLinearOpWithSolveFactory<Scalar>::RCG_name =
"RCG";
68 template<
class Scalar>
69 const std::string BelosLinearOpWithSolveFactory<Scalar>::MINRES_name =
"MINRES";
70 template<
class Scalar>
71 const std::string BelosLinearOpWithSolveFactory<Scalar>::TFQMR_name =
"TFQMR";
72 template<
class Scalar>
73 const std::string BelosLinearOpWithSolveFactory<Scalar>::BiCGStab_name =
"BiCGStab";
74 template<
class Scalar>
75 const std::string BelosLinearOpWithSolveFactory<Scalar>::FixedPoint_name =
"Fixed Point";
77 #if defined(HAVE_BELOS_TPETRA) && defined(HAVE_STRATIMIKOS_THYRATPETRAADAPTERS)
78 template<
class Scalar>
79 const std::string BelosLinearOpWithSolveFactory<Scalar>::TpetraGmres_name =
"TPETRA GMRES";
80 template<
class Scalar>
81 const std::string BelosLinearOpWithSolveFactory<Scalar>::TpetraGmresPipeline_name =
"TPETRA GMRES PIPELINE";
82 template<
class Scalar>
83 const std::string BelosLinearOpWithSolveFactory<Scalar>::TpetraGmresSingleReduce_name =
"TPETRA GMRES SINGLE REDUCE";
84 template<
class Scalar>
85 const std::string BelosLinearOpWithSolveFactory<Scalar>::TpetraGmresSstep_name =
"TPETRA GMRES S-STEP";
88 template<
class Scalar>
89 const std::string BelosLinearOpWithSolveFactory<Scalar>::ConvergenceTestFrequency_name =
"Convergence Test Frequency";
92 const std::string LeftPreconditionerIfUnspecified_name =
"Left Preconditioner If Unspecified";
98 template<
class Scalar>
100 :solverType_(SOLVER_TYPE_PSEUDO_BLOCK_GMRES),
101 convergenceTestFrequency_(1)
103 updateThisValidParamList();
107 template<
class Scalar>
111 :solverType_(SOLVER_TYPE_PSEUDO_BLOCK_GMRES)
120 template<
class Scalar>
127 template<
class Scalar>
130 const std::string &precFactoryName
135 precFactoryValidPL = precFactory->getValidParameters();
136 const std::string _precFactoryName =
137 ( precFactoryName !=
""
139 : ( precFactoryValidPL.get() ? precFactoryValidPL->name() :
"GENERIC PRECONDITIONER FACTORY" )
141 precFactory_ = precFactory;
142 precFactoryName_ = _precFactoryName;
143 updateThisValidParamList();
147 template<
class Scalar>
155 template<
class Scalar>
158 std::string *precFactoryName
161 if(precFactory) *precFactory = precFactory_;
162 if(precFactoryName) *precFactoryName = precFactoryName_;
163 precFactory_ = Teuchos::null;
164 precFactoryName_ =
"";
165 updateThisValidParamList();
169 template<
class Scalar>
174 if(precFactory_.get())
175 return precFactory_->isCompatible(fwdOpSrc);
180 template<
class Scalar>
188 template<
class Scalar>
196 initializeOpImpl(fwdOpSrc,null,null,
false,Op,supportSolveUse);
200 template<
class Scalar>
211 template<
class Scalar>
216 if(precFactory_.get())
222 template<
class Scalar>
231 initializeOpImpl(fwdOpSrc,null,prec,
false,Op,supportSolveUse);
235 template<
class Scalar>
244 initializeOpImpl(fwdOpSrc,approxFwdOpSrc,null,
false,Op,supportSolveUse);
248 template<
class Scalar>
273 if(fwdOpSrc) *fwdOpSrc = _fwdOpSrc;
274 if(prec) *prec = _prec;
275 if(approxFwdOpSrc) *approxFwdOpSrc = _approxFwdOpSrc;
276 if(supportSolveUse) *supportSolveUse = _supportSolveUse;
283 template<
class Scalar>
290 paramList_ = paramList;
292 Teuchos::getIntegralValue<EBelosSolverType>(*paramList_, SolverType_name);
293 convergenceTestFrequency_ =
294 Teuchos::getParameter<int>(*paramList_, ConvergenceTestFrequency_name);
295 Teuchos::readVerboseObjectSublist(&*paramList_,
this);
299 template<
class Scalar>
307 template<
class Scalar>
312 paramList_ = Teuchos::null;
317 template<
class Scalar>
325 template<
class Scalar>
329 return thisValidParamList_;
336 template<
class Scalar>
339 std::ostringstream oss;
343 oss << precFactory_->description();
353 template<
class Scalar>
358 using Teuchos::tuple;
359 using Teuchos::setStringToIntegralParameter;
365 EBelosSolverType> >::getDummyObject());
370 if(validParamList.
get()==NULL) {
372 setStringToIntegralParameter<EBelosSolverType>(
373 SolverType_name, SolverType_default,
374 "Type of linear solver algorithm to use.",
377 "Pseudo Block GMRES",
380 "Pseudo Block Stochastic CG",
387 #if defined(HAVE_BELOS_TPETRA) && defined(HAVE_STRATIMIKOS_THYRATPETRAADAPTERS)
389 "TPETRA GMRES PIPELINE",
390 "TPETRA GMRES SINGLE REDUCE",
391 "TPETRA GMRES S-STEP"
395 "Block GMRES solver for nonsymmetric linear systems. It can also solve "
396 "single right-hand side systems, and can also perform Flexible GMRES "
397 "(where the preconditioner may change at every iteration, for example "
398 "for inner-outer iterations), by setting options in the \"Block GMRES\" "
401 "GMRES solver for nonsymmetric linear systems, that performs single "
402 "right-hand side solves on multiple right-hand sides at once. It "
403 "exploits operator multivector multiplication in order to amortize "
404 "global communication costs. Individual linear systems are deflated "
405 "out as they are solved.",
407 "Block CG solver for symmetric (Hermitian in complex arithmetic) "
408 "positive definite linear systems. It can also solve single "
409 "right-hand-side systems.",
411 "CG solver that performs single right-hand side CG on multiple right-hand "
412 "sides at once. It exploits operator multivector multiplication in order "
413 "to amortize global communication costs. Individual linear systems are "
414 "deflated out as they are solved.",
416 "stochastic CG solver that performs single right-hand side CG on multiple right-hand "
417 "sides at once. It exploits operator multivector multiplication in order "
418 "to amortize global communication costs. Individual linear systems are "
419 "deflated out as they are solved. [EXPERIMENTAL]",
421 "Variant of GMRES that performs subspace recycling to accelerate "
422 "convergence for sequences of solves with related linear systems. "
423 "Individual linear systems are deflated out as they are solved. "
424 "The current implementation only supports real-valued Scalar types.",
426 "CG solver for symmetric (Hermitian in complex arithmetic) positive "
427 "definite linear systems, that performs subspace recycling to "
428 "accelerate convergence for sequences of related linear systems.",
430 "MINRES solver for symmetric indefinite linear systems. It performs "
431 "single-right-hand-side solves on multiple right-hand sides sequentially.",
433 "TFQMR (Transpose-Free QMR) solver for nonsymmetric linear systems.",
435 "BiCGStab solver for nonsymmetric linear systems.",
437 "Fixed point iteration"
439 #
if defined(HAVE_BELOS_TPETRA) && defined(HAVE_STRATIMIKOS_THYRATPETRAADAPTERS)
440 ,
"Native Tpetra implementation of GMRES",
442 "Native Tpetra implementation of pipeline GMRES",
444 "Native Tpetra implementation of single-reduce GMRES",
446 "Native Tpetra implementation of s-step GMRES"
449 tuple<EBelosSolverType>(
450 SOLVER_TYPE_BLOCK_GMRES,
451 SOLVER_TYPE_PSEUDO_BLOCK_GMRES,
452 SOLVER_TYPE_BLOCK_CG,
453 SOLVER_TYPE_PSEUDO_BLOCK_CG,
454 SOLVER_TYPE_PSEUDO_BLOCK_STOCHASTIC_CG,
459 SOLVER_TYPE_BICGSTAB,
460 SOLVER_TYPE_FIXEDPOINT
461 #
if defined(HAVE_BELOS_TPETRA) && defined(HAVE_STRATIMIKOS_THYRATPETRAADAPTERS)
462 ,SOLVER_TYPE_TPETRA_GMRES,
463 SOLVER_TYPE_TPETRA_GMRES_PIPELINE,
464 SOLVER_TYPE_TPETRA_GMRES_SINGLE_REDUCE,
465 SOLVER_TYPE_TPETRA_GMRES_SSTEP
470 validParamList->
set(ConvergenceTestFrequency_name, as<int>(1),
471 "Number of linear solver iterations to skip between applying"
472 " user-defined convergence test.");
474 LeftPreconditionerIfUnspecified_name,
false,
475 "If the preconditioner does not specify if it is left or right, and this\n"
476 "option is set to true, put the preconditioner on the left side.\n"
477 "Historically, preconditioning is on the right. Some solvers may not\n"
478 "support left preconditioning.");
480 &solverTypesSL = validParamList->
sublist(SolverTypes_name);
497 if (lapackSupportsScalar) {
500 *mgr.getValidParameters()
503 if (lapackSupportsScalar) {
506 *mgr.getValidParameters()
515 if (lapackSupportsScalar) {
518 *mgr.getValidParameters()
521 if (lapackSupportsScalar && scalarIsReal) {
524 *mgr.getValidParameters()
551 #if defined(HAVE_BELOS_TPETRA) && defined(HAVE_STRATIMIKOS_THYRATPETRAADAPTERS)
553 Thyra::BelosTpetraGmres<Scalar,MV_t,LO_t> mgr;
555 *mgr.getValidParameters()
559 Thyra::BelosTpetraGmresPipeline<Scalar,MV_t,LO_t> mgr;
561 *mgr.getValidParameters()
565 Thyra::BelosTpetraGmresSingleReduce<Scalar,MV_t,LO_t> mgr;
567 *mgr.getValidParameters()
571 Thyra::BelosTpetraGmresSstep<Scalar,MV_t,LO_t> mgr;
573 *mgr.getValidParameters()
578 return validParamList;
582 template<
class Scalar>
583 void BelosLinearOpWithSolveFactory<Scalar>::updateThisValidParamList()
588 Teuchos::setupVerboseObjectSublist(&*thisValidParamList_);
592 template<
class Scalar>
593 void BelosLinearOpWithSolveFactory<Scalar>::initializeOpImpl(
594 const RCP<
const LinearOpSourceBase<Scalar> > &fwdOpSrc,
595 const RCP<
const LinearOpSourceBase<Scalar> > &approxFwdOpSrc,
596 const RCP<
const PreconditionerBase<Scalar> > &prec_in,
597 const bool reusePrec,
598 LinearOpWithSolveBase<Scalar> *Op,
604 using Teuchos::set_extra_data;
606 typedef MultiVectorBase<Scalar> MV_t;
607 typedef LinearOpBase<Scalar> LO_t;
609 const RCP<Teuchos::FancyOStream> out = this->getOStream();
612 if(out.get() &&
static_cast<int>(verbLevel) > static_cast<int>(
Teuchos::VERB_LOW))
613 *out <<
"\nEntering Thyra::BelosLinearOpWithSolveFactory<"<<ST::name()<<
">::initializeOpImpl(...) ...\n";
623 RCP<const LinearOpBase<Scalar> >
624 fwdOp = fwdOpSrc->getOp(),
625 approxFwdOp = ( approxFwdOpSrc.get() ? approxFwdOpSrc->getOp() : Teuchos::null );
631 BelosLinearOpWithSolve<Scalar>
638 RCP<PreconditionerBase<Scalar> > myPrec = Teuchos::null;
639 RCP<const PreconditionerBase<Scalar> > prec = Teuchos::null;
646 if(precFactory_.get()) {
648 ( !belosOp->isExternalPrec()
649 ? Teuchos::rcp_const_cast<PreconditionerBase<Scalar> >(belosOp->extract_prec())
652 bool hasExistingPrec =
false;
654 hasExistingPrec =
true;
659 hasExistingPrec =
false;
660 myPrec = precFactory_->createPrec();
662 if( hasExistingPrec && reusePrec ) {
667 if(approxFwdOp.get())
668 precFactory_->initializePrec(approxFwdOpSrc,&*myPrec);
670 precFactory_->initializePrec(fwdOpSrc,&*myPrec);
680 bool oldIsExternalPrec =
false;
681 RCP<Belos::LinearProblem<Scalar,MV_t,LO_t> > oldLP = Teuchos::null;
682 RCP<Belos::SolverManager<Scalar,MV_t,LO_t> > oldIterSolver = Teuchos::null;
683 RCP<const LinearOpSourceBase<Scalar> > oldFwdOpSrc = Teuchos::null;
684 RCP<const LinearOpSourceBase<Scalar> > oldApproxFwdOpSrc = Teuchos::null;
687 belosOp->uninitialize( &oldLP, NULL, &oldIterSolver, &oldFwdOpSrc,
688 NULL, &oldIsExternalPrec, &oldApproxFwdOpSrc, &oldSupportSolveUse );
697 if (oldLP != Teuchos::null) {
701 lp =
rcp(
new LP_t());
708 lp->setOperator(fwdOp);
715 RCP<const LinearOpBase<Scalar> > unspecified = prec->getUnspecifiedPrecOp();
716 RCP<const LinearOpBase<Scalar> > left = prec->getLeftPrecOp();
717 RCP<const LinearOpBase<Scalar> > right = prec->getRightPrecOp();
719 !( left.get() || right.get() || unspecified.get() ), std::logic_error
720 ,
"Error, at least one preconditoner linear operator objects must be set!"
723 if (paramList_->get<
bool>(LeftPreconditionerIfUnspecified_name,
false))
724 lp->setLeftPrec(unspecified);
726 lp->setRightPrec(unspecified);
729 lp->setLeftPrec(left);
732 lp->setRightPrec(right);
738 ,
"Error, we can not currently handle split preconditioners!"
743 set_extra_data<RCP<PreconditionerBase<Scalar> > >(myPrec,
"Belos::InternalPrec",
744 Teuchos::inOutArg(lp), Teuchos::POST_DESTROY,
false);
746 else if(prec.get()) {
747 set_extra_data<RCP<const PreconditionerBase<Scalar> > >(prec,
"Belos::ExternalPrec",
748 Teuchos::inOutArg(lp), Teuchos::POST_DESTROY,
false);
756 RCP<IterativeSolver_t> iterativeSolver = Teuchos::null;
759 switch(solverType_) {
760 case SOLVER_TYPE_BLOCK_GMRES:
763 if(paramList_.get()) {
769 if (oldIterSolver != Teuchos::null) {
770 iterativeSolver = oldIterSolver;
771 iterativeSolver->setProblem( lp );
772 iterativeSolver->setParameters( solverPL );
779 case SOLVER_TYPE_PSEUDO_BLOCK_GMRES:
782 if(paramList_.get()) {
790 if (oldIterSolver != Teuchos::null) {
791 iterativeSolver = oldIterSolver;
792 iterativeSolver->setProblem( lp );
793 iterativeSolver->setParameters( solverPL );
800 case SOLVER_TYPE_BLOCK_CG:
803 if(paramList_.get()) {
809 if (oldIterSolver != Teuchos::null) {
810 iterativeSolver = oldIterSolver;
811 iterativeSolver->setProblem( lp );
812 iterativeSolver->setParameters( solverPL );
819 case SOLVER_TYPE_PSEUDO_BLOCK_CG:
822 if(paramList_.get()) {
830 if (oldIterSolver != Teuchos::null) {
831 iterativeSolver = oldIterSolver;
832 iterativeSolver->setProblem( lp );
833 iterativeSolver->setParameters( solverPL );
840 case SOLVER_TYPE_PSEUDO_BLOCK_STOCHASTIC_CG:
843 if(paramList_.get()) {
851 if (oldIterSolver != Teuchos::null) {
852 iterativeSolver = oldIterSolver;
853 iterativeSolver->setProblem( lp );
854 iterativeSolver->setParameters( solverPL );
861 case SOLVER_TYPE_GCRODR:
864 if(paramList_.get()) {
870 if (oldIterSolver != Teuchos::null) {
871 iterativeSolver = oldIterSolver;
872 iterativeSolver->setProblem( lp );
873 iterativeSolver->setParameters( solverPL );
880 case SOLVER_TYPE_RCG:
883 if(paramList_.get()) {
889 if (oldIterSolver != Teuchos::null) {
890 iterativeSolver = oldIterSolver;
891 iterativeSolver->setProblem( lp );
892 iterativeSolver->setParameters( solverPL );
899 case SOLVER_TYPE_MINRES:
902 if(paramList_.get()) {
908 if (oldIterSolver != Teuchos::null) {
909 iterativeSolver = oldIterSolver;
910 iterativeSolver->setProblem( lp );
911 iterativeSolver->setParameters( solverPL );
918 case SOLVER_TYPE_TFQMR:
921 if(paramList_.get()) {
927 if (oldIterSolver != Teuchos::null) {
928 iterativeSolver = oldIterSolver;
929 iterativeSolver->setProblem( lp );
930 iterativeSolver->setParameters( solverPL );
937 case SOLVER_TYPE_BICGSTAB:
940 if(paramList_.get()) {
946 if (oldIterSolver != Teuchos::null) {
947 iterativeSolver = oldIterSolver;
948 iterativeSolver->setProblem( lp );
949 iterativeSolver->setParameters( solverPL );
956 case SOLVER_TYPE_FIXEDPOINT:
959 if(paramList_.get()) {
965 if (oldIterSolver != Teuchos::null) {
966 iterativeSolver = oldIterSolver;
967 iterativeSolver->setProblem( lp );
968 iterativeSolver->setParameters( solverPL );
975 #if defined(HAVE_BELOS_TPETRA) && defined(HAVE_STRATIMIKOS_THYRATPETRAADAPTERS)
976 case SOLVER_TYPE_TPETRA_GMRES:
979 if(paramList_.get()) {
985 iterativeSolver =
rcp(
new Thyra::BelosTpetraGmres<Scalar,MV_t,LO_t>());
987 iterativeSolver->setProblem( lp );
988 iterativeSolver->setParameters( solverPL );
991 case SOLVER_TYPE_TPETRA_GMRES_PIPELINE:
994 if(paramList_.get()) {
997 solverPL =
Teuchos::rcp( &tpetraGmresPipelinePL,
false );
1000 iterativeSolver =
rcp(
new Thyra::BelosTpetraGmresPipeline<Scalar,MV_t,LO_t>());
1002 iterativeSolver->setProblem( lp );
1003 iterativeSolver->setParameters( solverPL );
1006 case SOLVER_TYPE_TPETRA_GMRES_SINGLE_REDUCE:
1009 if(paramList_.get()) {
1012 solverPL =
Teuchos::rcp( &tpetraGmresSingleReducePL,
false );
1015 iterativeSolver =
rcp(
new Thyra::BelosTpetraGmresSingleReduce<Scalar,MV_t,LO_t>());
1017 iterativeSolver->setProblem( lp );
1018 iterativeSolver->setParameters( solverPL );
1021 case SOLVER_TYPE_TPETRA_GMRES_SSTEP:
1024 if(paramList_.get()) {
1030 iterativeSolver =
rcp(
new Thyra::BelosTpetraGmresSstep<Scalar,MV_t,LO_t>());
1032 iterativeSolver->setProblem( lp );
1033 iterativeSolver->setParameters( solverPL );
1047 belosOp->initialize(
1048 lp, solverPL, iterativeSolver,
1049 fwdOpSrc, prec, myPrec.get()==NULL, approxFwdOpSrc,
1050 supportSolveUse, convergenceTestFrequency_
1052 belosOp->setOStream(out);
1053 belosOp->setVerbLevel(verbLevel);
1054 #ifdef TEUCHOS_DEBUG
1055 if(paramList_.get()) {
1057 paramList_->validateParameters(*this->getValidParameters(),1);
1060 if(out.get() &&
static_cast<int>(verbLevel) > static_cast<int>(
Teuchos::VERB_LOW))
1061 *out <<
"\nLeaving Thyra::BelosLinearOpWithSolveFactory<"<<ST::name()<<
">::initializeOpImpl(...) ...\n";
1069 #endif // THYRA_BELOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
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
RCP< const LinearOpSourceBase< Scalar > > extract_approxFwdOpSrc()
static void addConverter(RCP< const ParameterEntryValidator > validator, RCP< ValidatorXMLConverter > converterToAdd)
Concrete LinearOpWithSolveBase subclass in terms of Belos.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
RCP< const PreconditionerBase< Scalar > > extract_prec()
T_To & dyn_cast(T_From &from)
void initializeAndReuseOp(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op) const
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
bool isExternalPrec() const
void unsetPreconditionerFactory(Teuchos::RCP< PreconditionerFactoryBase< Scalar > > *precFactory, std::string *precFactoryName)
Thyra specializations of MultiVecTraits and OperatorTraits.
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList)
bool isCompatible(const LinearOpSourceBase< Scalar > &fwdOpSrc) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
bool acceptsPreconditionerFactory() const
Returns true .
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
virtual std::string description() const
void initializeOp(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
std::string description() const
void validateParametersAndSetDefaults(ParameterList const &validParamList, int const depth=1000)
void setPreconditionerFactory(const Teuchos::RCP< PreconditionerFactoryBase< Scalar > > &precFactory, const std::string &precFactoryName)
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
LinearOpWithSolveFactoryBase subclass implemented in terms of Belos.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
ESupportSolveUse supportSolveUse() const
ParameterList & setParameters(const ParameterList &source)
bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
RCP< const LinearOpSourceBase< Scalar > > extract_fwdOpSrc()
bool nonnull(const boost::shared_ptr< T > &p)
Teuchos::RCP< PreconditionerFactoryBase< Scalar > > getPreconditionerFactory() const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
void initializeApproxPreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &approxFwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
TypeTo as(const TypeFrom &t)
void initializePreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const Teuchos::RCP< const PreconditionerBase< Scalar > > &prec, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
Teuchos::RCP< LinearOpWithSolveBase< Scalar > > createOp() const
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
BelosLinearOpWithSolveFactory()
Construct without preconditioner factory.
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)