48 #include "Thyra_PreconditionerFactoryHelpers.hpp"
50 #include "Thyra_ScaledAdjointLinearOpBase.hpp"
53 #include "EpetraExt_ProductOperator.h"
63 const std::string AOOLOWSF_epetraPrecOp_str
64 =
"AOOLOWSF::epetraPrecOp";
65 const std::string AOOLOWSF_aztec_epetra_epetraFwdOp_str
66 =
"AOOLOWSF::aztec_epetra_epetraFwdOp";
67 const std::string AOOLOWSF_aztec_epetra_epetraAdjOp_str
68 =
"AOOLOWSF::aztec_epetra_epetraAdjOp";
69 const std::string AOOLOWSF_rowmatrix_epetraFwdOp_str
70 =
"AOOLOWSF::rowmatrix_epetraFwdOp";
71 const std::string AOOLOWSF_rowmatrix_epetraPrecOp_str
72 =
"AOOLOWSF::rowmatrix_epetraPrecOp";
73 const std::string AOOLOWSF_aztec_fwd_epetra_epetraPrecOp_str
74 =
"AOOLOWSF::aztec_fwd_epetra_epetraPrecOp";
75 const std::string AOOLOWSF_aztec_adj_epetra_epetraPrecOp_str
76 =
"AOOLOWSF::aztec_adj_epetra_epetraPrecOp";
77 const std::string AOOLOWSF_setPrecondtionerOperator_str
78 =
"AOOLOWSF::setPrecondtionerOperator";
79 const std::string AOOLOWSF_constructedAztecPreconditoner_str
80 =
"AOOLOWSF::constructedAztecPreconditoner";
83 const std::string ForwardSolve_name =
"Forward Solve";
84 const std::string AdjointSolve_name =
"Adjoint Solve";
85 const std::string MaxIterations_name =
"Max Iterations";
86 const int MaxIterations_default = 400;
87 const std::string Tolerance_name =
"Tolerance";
88 const double Tolerance_default = 1e-6;
89 const std::string OutputEveryRhs_name =
"Output Every RHS";
90 const bool OutputEveryRhs_default =
false;
91 const std::string AztecOO_Settings_name =
"AztecOO Settings";
107 ,defaultFwdMaxIterations_(MaxIterations_default)
108 ,defaultFwdTolerance_(Tolerance_default)
109 ,defaultAdjMaxIterations_(MaxIterations_default)
110 ,defaultAdjTolerance_(Tolerance_default)
111 ,outputEveryRhs_(OutputEveryRhs_default)
129 const Teuchos::RCP<PreconditionerFactoryBase<double> > &precFactory,
130 const std::string &precFactoryName
135 precFactoryValidPL = precFactory->getValidParameters();
136 const std::string _precFactoryName =
137 ( precFactoryName !=
""
139 : ( precFactoryValidPL.get()
140 ? precFactoryValidPL->name()
141 :
"GENERIC PRECONDITIONER FACTORY"
158 Teuchos::RCP<PreconditionerFactoryBase<double> > *precFactory,
159 std::string *precFactoryName
171 const LinearOpSourceBase<double> &fwdOpSrc
174 return epetraFwdOpViewExtractor_->isCompatible(*fwdOpSrc.getOp());
186 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
187 LinearOpWithSolveBase<double> *Op,
188 const ESupportSolveUse supportSolveUse
196 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
197 LinearOpWithSolveBase<double> *Op
205 const EPreconditionerInputType precOpType
212 "Aztec Preconditioner",
"none"
216 case PRECONDITIONER_INPUT_TYPE_AS_OPERATOR:
219 case PRECONDITIONER_INPUT_TYPE_AS_MATRIX:
225 return PRECONDITIONER_INPUT_TYPE_AS_OPERATOR;
230 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
231 const Teuchos::RCP<
const PreconditionerBase<double> > &prec,
232 LinearOpWithSolveBase<double> *Op,
233 const ESupportSolveUse supportSolveUse
242 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
243 const Teuchos::RCP<
const LinearOpSourceBase<double> > &approxFwdOpSrc,
244 LinearOpWithSolveBase<double> *Op,
245 const ESupportSolveUse supportSolveUse
255 LinearOpWithSolveBase<double> *Op,
256 Teuchos::RCP<
const LinearOpSourceBase<double> > *fwdOpSrc,
258 Teuchos::RCP<
const LinearOpSourceBase<double> > *approxFwdOpSrc,
259 ESupportSolveUse *supportSolveUse
271 if(fwdOpSrc) *fwdOpSrc = _fwdOpSrc;
272 if(approxFwdOpSrc) *approxFwdOpSrc = _approxFwdOpSrc;
279 if(prec) *prec = _prec;
320 if( nestedPFSublistExists || !alreadyHasSublist ) {
324 Teuchos::readVerboseObjectSublist(&*
paramList_,
this);
363 std::ostringstream oss;
364 oss <<
"Thyra::AztecOOLinearOpWithSolveFactory{";
365 oss <<
"precFactory=";
382 if(validParamList.
get()==NULL) {
386 OutputEveryRhs_name,OutputEveryRhs_default
387 ,
"Determines if output is created for each individual RHS (true or 1) or if output\n"
388 "is just created for an entire set of RHSs (false or 0)."
393 &fwdSolvePL = validParamList->
sublist(
394 ForwardSolve_name,
false
395 ,
"Gives the options for the forward solve."
398 Tolerance_name,Tolerance_default
399 ,
"The tolerence used in the convergence check (see the convergence test\n"
400 "in the sublist \"" + AztecOO_Settings_name +
"\")"
403 MaxIterations_name,MaxIterations_default
404 ,
"The maximum number of iterations the AztecOO solver is allowed to perform."
407 AztecOO_Settings_name,
false
408 ,
"Sets the parameters on the AztecOO object itself."
409 ).setParameters(*aztecParamList);
411 &adjSolvePL = validParamList->
sublist(
412 AdjointSolve_name,
false
413 ,
"The options for the adjoint solve.\n"
414 "If this sublist is missing then the parameters from the\n"
415 "\""+ForwardSolve_name+
"\" sublist are used instead."
420 return validParamList;
431 precFactoryValidParamList =
precFactory_->getValidParameters();
432 if(precFactoryValidParamList.
get()) {
434 *precFactoryValidParamList);
442 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
443 const Teuchos::RCP<
const PreconditionerBase<double> > &prec,
444 const Teuchos::RCP<
const LinearOpSourceBase<double> > &approxFwdOpSrc,
445 const bool reusePrec,
446 LinearOpWithSolveBase<double> *Op
452 using Teuchos::rcp_dynamic_cast;
453 using Teuchos::rcp_const_cast;
454 using Teuchos::set_extra_data;
455 using Teuchos::get_optional_extra_data;
456 using Teuchos::get_optional_nonconst_extra_data;
457 using Teuchos::outArg;
458 typedef EpetraExt::ProductOperator PO;
464 *out <<
"\nEntering Thyra::AztecOOLinearOpWithSolveFactory::initializeOp_impl(...) ...\n";
467 VOTSPF precFactoryOutputTempState(
precFactory_,out,verbLevel);
481 tmpFwdOp = fwdOpSrc->getOp(),
482 tmpApproxFwdOp = ( approxFwdOpSrc.get() ? approxFwdOpSrc->getOp() :
Teuchos::null );
485 if ( dynamic_cast<const EpetraLinearOpBase*>(tmpFwdOp.get())!=0 )
488 approxFwdOp = tmpApproxFwdOp;
492 fwdOp = makeEpetraWrapper(tmpFwdOp);
499 approxFwdOp = makeEpetraWrapper(tmpApproxFwdOp);
513 EOpTransp epetra_epetraFwdOpTransp;
516 double epetra_epetraFwdOpScalar;
517 epetraFwdOpViewExtractor_->getEpetraOpView(
519 outArg(epetra_epetraFwdOp), outArg(epetra_epetraFwdOpTransp),
520 outArg(epetra_epetraFwdOpApplyAs), outArg(epetra_epetraFwdOpAdjointSupport),
521 outArg(epetra_epetraFwdOpScalar)
524 epetra_epetraFwdOp.
get()==NULL, std::logic_error
525 ,
"Error, The input fwdOp object must be fully initialized "
526 "before calling this function!"
543 ? Teuchos::rcp_const_cast<PreconditionerBase<double> >(
562 if (precUsed.
get()) {
567 !( left.
get() || right.
get() || unspecified.
get() ), std::logic_error
568 ,
"Error, at least one preconditoner linear operator objects must be set!"
570 if(unspecified.
get()) {
571 rightPrecOp = unspecified;
576 left.
get(),std::logic_error
577 ,
"Error, we can not currently handle a left"
578 " preconditioner with the AztecOO/Thyra adapters!"
583 double wrappedPrecOpScalar = 0.0;
584 EOpTransp wrappedPrecOpTransp =
NOTRANS;
588 EOpTransp epetra_epetraPrecOpTransp;
591 EOpTransp overall_epetra_epetraPrecOpTransp;
592 if(rightPrecOp.
get()) {
595 rightPrecOp,&wrappedPrecOpScalar,&wrappedPrecOpTransp,&tmpWrappedPrecOp);
596 if( dynamic_cast<const EpetraLinearOpBase*>(&*tmpWrappedPrecOp) ) {
597 wrappedPrecOp = tmpWrappedPrecOp;
600 wrappedPrecOp = makeEpetraWrapper(tmpWrappedPrecOp);
604 epetraPrecOp->getEpetraOpView(
605 outArg(epetra_epetraPrecOp), outArg(epetra_epetraPrecOpTransp),
606 outArg(epetra_epetraPrecOpApplyAs), outArg(epetra_epetraPrecOpAdjointSupport));
608 epetra_epetraPrecOp.
get()==NULL,std::logic_error
609 ,
"Error, The input prec object and its embedded preconditioner"
610 " operator must be fully initialized before calling this function!"
619 overall_epetra_epetraPrecOpTransp
621 real_trans(wrappedPrecOpTransp),
622 real_trans(epetra_epetraPrecOpTransp)
630 if(approxFwdOp.
get()) {
633 unwrap(approxFwdOp,&wrappedPrecOpScalar,&wrappedPrecOpTransp,&wrappedPrecOp);
636 epetraPrecOp->getEpetraOpView(
637 outArg(epetra_epetraPrecOp), outArg(epetra_epetraPrecOpTransp),
638 outArg(epetra_epetraPrecOpApplyAs), outArg(epetra_epetraPrecOpAdjointSupport)
641 epetra_epetraPrecOp.
get()==NULL,std::logic_error
642 ,
"Error, The input approxFwdOp object must be fully initialized"
643 " before calling this function!"
653 overall_epetra_epetraPrecOpTransp
655 real_trans(wrappedPrecOpTransp),
656 real_trans(epetra_epetraPrecOpTransp)
665 rowmatrix_epetraFwdOp = rcp_dynamic_cast<
const Epetra_RowMatrix>(
667 rowmatrix_epetraPrecOp = rcp_dynamic_cast<const Epetra_RowMatrix>(
668 epetra_epetraPrecOp);
674 enum ELocalPrecType {
675 PT_NONE, PT_AZTEC_FROM_OP, PT_AZTEC_FROM_APPROX_FWD_MATRIX,
678 ELocalPrecType localPrecType;
681 localPrecType = PT_NONE;
686 localPrecType = PT_AZTEC_FROM_OP;
691 localPrecType = PT_AZTEC_FROM_APPROX_FWD_MATRIX;
693 else if( precUsed.
get() ) {
696 localPrecType = PT_FROM_PREC_OP;
712 bool old_isExternalPrec;
716 double old_aztecSolverScalar;
727 ,&old_aztecSolverScalar
729 if( old_aztecFwdSolver.
get()==NULL ) {
737 aztecFwdSolver = old_aztecFwdSolver;
738 aztecAdjSolver = old_aztecAdjSolver;
739 startingOver =
false;
742 Ptr<bool> constructedAztecPreconditioner;
746 !
is_null(constructedAztecPreconditioner = get_optional_nonconst_extra_data<bool>(
747 aztecFwdSolver,
"AOOLOWSF::constructedAztecPreconditoner") )
749 *constructedAztecPreconditioner
752 aztecFwdSolver->DestroyPreconditioner();
753 *constructedAztecPreconditioner =
false;
757 Ptr<bool> setPreconditionerOperator;
759 localPrecType != PT_FROM_PREC_OP
760 && !
is_null( setPreconditionerOperator = get_optional_nonconst_extra_data<bool>(
761 aztecFwdSolver,
"AOOLOWSF::setPreconditonerOperator") )
762 && *setPreconditionerOperator
778 aztecFwdSolver =
rcp(
new AztecOO());
779 aztecFwdSolver->SetAztecOption(AZ_diagnostics,AZ_none);
780 aztecFwdSolver->SetAztecOption(AZ_keep_info,1);
785 localPrecType!=PT_AZTEC_FROM_OP && localPrecType!=PT_AZTEC_FROM_APPROX_FWD_MATRIX
788 aztecAdjSolver =
rcp(
new AztecOO());
789 aztecAdjSolver->SetAztecOption(AZ_diagnostics,AZ_none);
814 aztec_epetra_epetraFwdOp,
815 aztec_epetra_epetraAdjOp;
819 = { epetra_epetraFwdOp };
826 ? PO::APPLY_MODE_APPLY
827 : PO::APPLY_MODE_APPLY_INVERSE };
831 epetraOpsApplyMode[0] == PO::APPLY_MODE_APPLY
834 aztec_epetra_epetraFwdOp = epetra_epetraFwdOp;
838 aztec_epetra_epetraFwdOp =
rcp(
839 new PO(1,epetraOps,epetraOpsTransp,epetraOpsApplyMode));
844 aztec_epetra_epetraFwdOp.
get() != aztecFwdSolver->GetUserOperator()
849 aztecFwdSolver->SetUserOperator(
850 const_cast<Epetra_Operator*>(&*aztec_epetra_epetraFwdOp));
852 aztec_epetra_epetraFwdOp, AOOLOWSF_aztec_epetra_epetraFwdOp_str,
857 if( aztecAdjSolver.
get() ) {
858 epetraOpsTransp[0] = (
859 epetra_epetraFwdOpTransp==
NOTRANS
866 epetraOpsApplyMode[0] == PO::APPLY_MODE_APPLY
869 aztec_epetra_epetraAdjOp = epetra_epetraFwdOp;
872 aztec_epetra_epetraAdjOp =
rcp(
873 new PO(1,epetraOps,epetraOpsTransp,epetraOpsApplyMode));
875 aztecAdjSolver->SetUserOperator(
876 const_cast<Epetra_Operator*>(&*aztec_epetra_epetraAdjOp));
878 aztec_epetra_epetraAdjOp, AOOLOWSF_aztec_epetra_epetraAdjOp_str,
887 aztec_fwd_epetra_epetraPrecOp,
888 aztec_adj_epetra_epetraPrecOp;
889 bool setAztecPreconditioner =
false;
890 switch(localPrecType) {
897 case PT_AZTEC_FROM_OP: {
902 if( startingOver || !reusePrec ) {
904 rowmatrix_epetraFwdOp.
get()==NULL, std::logic_error,
905 "AztecOOLinearOpWithSolveFactory::initializeOp_impl(...): "
906 "Error, There is no preconditioner given by client, but the client "
907 "passed in an Epetra_Operator for the forward operator of type \'"
908 <<
typeName(*epetra_epetraFwdOp)<<
"\' that does not "
909 "support the Epetra_RowMatrix interface!"
912 epetra_epetraFwdOpTransp!=
NOTRANS, std::logic_error,
913 "AztecOOLinearOpWithSolveFactory::initializeOp_impl(...):"
914 " Error, There is no preconditioner given by client and the client "
915 "passed in an Epetra_RowMatrix for the forward operator but the "
916 "overall transpose is not NOTRANS and therefore we can can just "
917 "hand this over to aztec without making a copy which is not supported here!"
919 aztecFwdSolver->SetPrecMatrix(
920 const_cast<Epetra_RowMatrix*>(&*rowmatrix_epetraFwdOp));
922 rowmatrix_epetraFwdOp, AOOLOWSF_rowmatrix_epetraFwdOp_str,
926 setAztecPreconditioner =
true;
929 case PT_AZTEC_FROM_APPROX_FWD_MATRIX: {
934 if( startingOver || !reusePrec ) {
936 rowmatrix_epetraPrecOp.get()==NULL, std::logic_error
937 ,
"AztecOOLinearOpWithSolveFactor::initializeOp_impl(...): The client "
938 "passed in an Epetra_Operator for the preconditioner matrix of type \'"
939 <<
typeName(*epetra_epetraPrecOp)<<
"\' that does not "
940 "support the Epetra_RowMatrix interface!"
943 overall_epetra_epetraPrecOpTransp!=
NOTRANS, std::logic_error
944 ,
"AztecOOLinearOpWithSolveFactor::initializeOp_impl(...): Error, The client "
945 "passed in an Epetra_RowMatrix for the preconditoner matrix but the overall "
946 "transpose is not NOTRANS and therefore we can can just "
947 "hand this over to aztec without making a copy which is not supported here!"
949 aztecFwdSolver->SetPrecMatrix(
950 const_cast<Epetra_RowMatrix*>(&*rowmatrix_epetraPrecOp));
952 rowmatrix_epetraPrecOp, AOOLOWSF_rowmatrix_epetraPrecOp_str,
956 setAztecPreconditioner =
true;
959 case PT_FROM_PREC_OP: {
966 = { epetra_epetraPrecOp };
969 = { overall_epetra_epetraPrecOpTransp==
NOTRANS
977 ? PO::APPLY_MODE_APPLY_INVERSE
978 : PO::APPLY_MODE_APPLY };
985 aztec_fwd_epetra_epetraPrecOp = epetra_epetraPrecOp;
988 aztec_fwd_epetra_epetraPrecOp =
rcp(
new PO(1,epetraOps,epetraOpsTransp,epetraOpsApplyMode));
990 aztecFwdSolver->SetPrecOperator(
991 const_cast<Epetra_Operator*>(&*aztec_fwd_epetra_epetraPrecOp));
993 aztec_fwd_epetra_epetraPrecOp, AOOLOWSF_aztec_fwd_epetra_epetraPrecOp_str,
1003 epetraOpsTransp[0] = (
1004 overall_epetra_epetraPrecOpTransp==
NOTRANS
1014 aztec_adj_epetra_epetraPrecOp = epetra_epetraPrecOp;
1017 aztec_adj_epetra_epetraPrecOp =
rcp(
1018 new PO(1,epetraOps,epetraOpsTransp,epetraOpsApplyMode));
1020 aztecAdjSolver->SetPrecOperator(
1021 const_cast<Epetra_Operator*>(&*aztec_adj_epetra_epetraPrecOp));
1023 aztec_adj_epetra_epetraPrecOp, AOOLOWSF_aztec_adj_epetra_epetraPrecOp_str,
1026 set_extra_data<bool>(
1027 true, AOOLOWSF_setPrecondtionerOperator_str,
1040 if(setAztecPreconditioner) {
1041 if( startingOver || !reusePrec ) {
1042 double condNumEst = -1.0;
1045 set_extra_data<bool>(
1046 true, AOOLOWSF_constructedAztecPreconditoner_str,
1058 if(aztecAdjSolver.
get() && aztecAdjSolver->GetPrecOperator()) {
1060 fwdOp, fwdOpSrc,precUsed, prec.
get()!=NULL, approxFwdOpSrc,
1061 aztecFwdSolver,
true, aztecAdjSolver,
true, epetra_epetraFwdOpScalar
1066 fwdOp, fwdOpSrc, precUsed, prec.
get()!=NULL, approxFwdOpSrc,
1067 aztecFwdSolver,
true, null,
false, epetra_epetraFwdOpScalar
1075 aztecOp->setOStream(this->getOStream());
1076 if(!
is_null(this->getOverridingOStream()))
1077 aztecOp->setOverridingOStream(this->getOverridingOStream());
1078 aztecOp->setVerbLevel(this->getVerbLevel());
1080 #ifdef TEUCHOS_DEBUG
1086 *out <<
"\nLeaving Thyra::AztecOOLinearOpWithSolveFactory::initializeOp_impl(...) ...\n";
void uninitializeOp(LinearOpWithSolveBase< double > *Op, Teuchos::RCP< const LinearOpSourceBase< double > > *fwdOpSrc, Teuchos::RCP< const PreconditionerBase< double > > *prec, Teuchos::RCP< const LinearOpSourceBase< double > > *approxFwdOpSrc, ESupportSolveUse *supportSolveUse) const
void setAztecOOParameters(Teuchos::ParameterList *pl, AztecOO *solver)
Setup an AztecOO solver object with a set of parameters.
Teuchos::RCP< Teuchos::ParameterList > paramList_
void initializeAndReuseOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, LinearOpWithSolveBase< double > *Op) const
std::string typeName(const T &t)
bool is_null(const boost::shared_ptr< T > &p)
void initializeOp_impl(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const PreconditionerBase< double > > &prec, const Teuchos::RCP< const LinearOpSourceBase< double > > &approxFwdOpSrc, const bool reusePrec, LinearOpWithSolveBase< double > *Op) const
bool acceptsPreconditionerFactory() const
Returns true .
Teuchos::RCP< Teuchos::ParameterList > thisValidParamList_
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
T & get(ParameterList &l, const std::string &name)
double defaultFwdTolerance_
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Teuchos::RCP< PreconditionerFactoryBase< double > > precFactory_
RCP< const LinearOpSourceBase< double > > extract_fwdOpSrc()
Extract the forward LinearOpBase<double> object so that it can be modified.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
bool isExternalPrec() const
Determine if the preconditioner was external or not.
AztecOOLinearOpWithSolveFactory(Teuchos::RCP< Teuchos::ParameterList > const ¶mList=Teuchos::null)
Construct uninitialized.
void initializeApproxPreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const LinearOpSourceBase< double > > &approxFwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
RCP< ParameterList > sublist(const RCP< ParameterList > ¶mList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
void updateThisValidParamList()
bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
int defaultFwdMaxIterations_
double defaultAdjTolerance_
std::string description() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
bool isCompatible(const LinearOpSourceBase< double > &fwdOpSrc) const
bool isSublist(const std::string &name) const
T_To & dyn_cast(T_From &from)
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
void unsetPreconditionerFactory(Teuchos::RCP< PreconditionerFactoryBase< double > > *precFactory, std::string *precFactoryName)
void initializeOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
T * getPtr(const std::string &name)
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList)
Teuchos::RCP< PreconditionerFactoryBase< double > > getPreconditionerFactory() const
void validateParameters(ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const
ParameterList & setParameters(const ParameterList &source)
std::string precFactoryName_
void initializePreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const PreconditionerBase< double > > &prec, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
void uninitialize(RCP< const LinearOpBase< double > > *fwdOp=NULL, RCP< const LinearOpSourceBase< double > > *fwdOpSrc=NULL, RCP< const PreconditionerBase< double > > *prec=NULL, bool *isExternalPrec=NULL, RCP< const LinearOpSourceBase< double > > *approxFwdOpSrc=NULL, RCP< AztecOO > *aztecFwdSolver=NULL, bool *allowInexactFwdSolve=NULL, RCP< AztecOO > *aztecAdjSolver=NULL, bool *allowInexactAdjSolve=NULL, double *aztecSolverScalar=NULL)
Uninitialize.
RCP< const PreconditionerBase< double > > extract_prec()
Extract the preconditioner.
int defaultAdjMaxIterations_
void initialize(const RCP< const LinearOpBase< double > > &fwdOp, const RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const RCP< const PreconditionerBase< double > > &prec, const bool isExternalPrec, const RCP< const LinearOpSourceBase< double > > &approxFwdOpSrc, const RCP< AztecOO > &aztecFwdSolver, const bool allowInexactFwdSolve=false, const RCP< AztecOO > &aztecAdjSolver=Teuchos::null, const bool allowInexactAdjSolve=false, const double aztecSolverScalar=1.0)
Sets up this object.
Teuchos::RCP< const Teuchos::ParameterList > getValidAztecOOParameters()
Return the list of all valid AztecOO parameters (to validate against).
void setPreconditionerFactory(const Teuchos::RCP< PreconditionerFactoryBase< double > > &precFactory, const std::string &precFactoryName)
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
Teuchos::RCP< LinearOpWithSolveBase< double > > createOp() const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Concrete LinearOpWithSolveBase subclass implemented using AztecOO.
static Teuchos::RCP< const Teuchos::ParameterList > generateAndGetValidParameters()
RCP< const LinearOpSourceBase< double > > extract_approxFwdOpSrc()
Extract the approximate forward LinearOpBase<double> object used to build the preconditioner.