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)
112 ,useAztecPrec_(false)
130 const Teuchos::RCP<PreconditionerFactoryBase<double> > &precFactory,
131 const std::string &precFactoryName
136 precFactoryValidPL = precFactory->getValidParameters();
137 const std::string _precFactoryName =
138 ( precFactoryName !=
"" 140 : ( precFactoryValidPL.get()
141 ? precFactoryValidPL->name()
142 :
"GENERIC PRECONDITIONER FACTORY" 159 Teuchos::RCP<PreconditionerFactoryBase<double> > *precFactory,
160 std::string *precFactoryName
172 const LinearOpSourceBase<double> &fwdOpSrc
175 return epetraFwdOpViewExtractor_->isCompatible(*fwdOpSrc.getOp());
187 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
188 LinearOpWithSolveBase<double> *Op,
189 const ESupportSolveUse supportSolveUse
197 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
198 LinearOpWithSolveBase<double> *Op
206 const EPreconditionerInputType precOpType
213 "Aztec Preconditioner",
"none" 217 case PRECONDITIONER_INPUT_TYPE_AS_OPERATOR:
220 case PRECONDITIONER_INPUT_TYPE_AS_MATRIX:
226 return PRECONDITIONER_INPUT_TYPE_AS_OPERATOR;
231 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
232 const Teuchos::RCP<
const PreconditionerBase<double> > &prec,
233 LinearOpWithSolveBase<double> *Op,
234 const ESupportSolveUse supportSolveUse
243 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
244 const Teuchos::RCP<
const LinearOpSourceBase<double> > &approxFwdOpSrc,
245 LinearOpWithSolveBase<double> *Op,
246 const ESupportSolveUse supportSolveUse
256 LinearOpWithSolveBase<double> *Op,
257 Teuchos::RCP<
const LinearOpSourceBase<double> > *fwdOpSrc,
259 Teuchos::RCP<
const LinearOpSourceBase<double> > *approxFwdOpSrc,
260 ESupportSolveUse *supportSolveUse
272 if(fwdOpSrc) *fwdOpSrc = _fwdOpSrc;
273 if(approxFwdOpSrc) *approxFwdOpSrc = _approxFwdOpSrc;
280 if(prec) *prec = _prec;
321 if( nestedPFSublistExists || !alreadyHasSublist ) {
325 Teuchos::readVerboseObjectSublist(&*
paramList_,
this);
364 std::ostringstream oss;
365 oss <<
"Thyra::AztecOOLinearOpWithSolveFactory{";
366 oss <<
"precFactory=";
383 if(validParamList.
get()==NULL) {
387 OutputEveryRhs_name,OutputEveryRhs_default
388 ,
"Determines if output is created for each individual RHS (true or 1) or if output\n" 389 "is just created for an entire set of RHSs (false or 0)." 394 &fwdSolvePL = validParamList->
sublist(
395 ForwardSolve_name,
false 396 ,
"Gives the options for the forward solve." 399 Tolerance_name,Tolerance_default
400 ,
"The tolerence used in the convergence check (see the convergence test\n" 401 "in the sublist \"" + AztecOO_Settings_name +
"\")" 404 MaxIterations_name,MaxIterations_default
405 ,
"The maximum number of iterations the AztecOO solver is allowed to perform." 408 AztecOO_Settings_name,
false 409 ,
"Sets the parameters on the AztecOO object itself." 410 ).setParameters(*aztecParamList);
412 &adjSolvePL = validParamList->
sublist(
413 AdjointSolve_name,
false 414 ,
"The options for the adjoint solve.\n" 415 "If this sublist is missing then the parameters from the\n" 416 "\""+ForwardSolve_name+
"\" sublist are used instead." 421 return validParamList;
432 precFactoryValidParamList =
precFactory_->getValidParameters();
433 if(precFactoryValidParamList.
get()) {
435 *precFactoryValidParamList);
443 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
444 const Teuchos::RCP<
const PreconditionerBase<double> > &prec,
445 const Teuchos::RCP<
const LinearOpSourceBase<double> > &approxFwdOpSrc,
446 const bool reusePrec,
447 LinearOpWithSolveBase<double> *Op
453 using Teuchos::rcp_dynamic_cast;
454 using Teuchos::rcp_const_cast;
455 using Teuchos::set_extra_data;
456 using Teuchos::get_optional_extra_data;
457 using Teuchos::get_optional_nonconst_extra_data;
458 using Teuchos::outArg;
459 typedef EpetraExt::ProductOperator PO;
465 *out <<
"\nEntering Thyra::AztecOOLinearOpWithSolveFactory::initializeOp_impl(...) ...\n";
468 VOTSPF precFactoryOutputTempState(
precFactory_,out,verbLevel);
482 tmpFwdOp = fwdOpSrc->getOp(),
483 tmpApproxFwdOp = ( approxFwdOpSrc.get() ? approxFwdOpSrc->getOp() : Teuchos::null );
486 if ( dynamic_cast<const EpetraLinearOpBase*>(tmpFwdOp.get())!=0 )
489 approxFwdOp = tmpApproxFwdOp;
493 fwdOp = makeEpetraWrapper(tmpFwdOp);
500 approxFwdOp = makeEpetraWrapper(tmpApproxFwdOp);
514 EOpTransp epetra_epetraFwdOpTransp;
517 double epetra_epetraFwdOpScalar;
518 epetraFwdOpViewExtractor_->getEpetraOpView(
520 outArg(epetra_epetraFwdOp), outArg(epetra_epetraFwdOpTransp),
521 outArg(epetra_epetraFwdOpApplyAs), outArg(epetra_epetraFwdOpAdjointSupport),
522 outArg(epetra_epetraFwdOpScalar)
525 epetra_epetraFwdOp.
get()==NULL, std::logic_error
526 ,
"Error, The input fwdOp object must be fully initialized " 527 "before calling this function!" 544 ? Teuchos::rcp_const_cast<PreconditionerBase<double> >(
563 if (precUsed.
get()) {
568 !( left.
get() || right.
get() || unspecified.
get() ), std::logic_error
569 ,
"Error, at least one preconditoner linear operator objects must be set!" 571 if(unspecified.
get()) {
572 rightPrecOp = unspecified;
577 left.
get(),std::logic_error
578 ,
"Error, we can not currently handle a left" 579 " preconditioner with the AztecOO/Thyra adapters!" 584 double wrappedPrecOpScalar = 0.0;
585 EOpTransp wrappedPrecOpTransp =
NOTRANS;
589 EOpTransp epetra_epetraPrecOpTransp;
592 EOpTransp overall_epetra_epetraPrecOpTransp;
593 if(rightPrecOp.
get()) {
596 rightPrecOp,&wrappedPrecOpScalar,&wrappedPrecOpTransp,&tmpWrappedPrecOp);
597 if( dynamic_cast<const EpetraLinearOpBase*>(&*tmpWrappedPrecOp) ) {
598 wrappedPrecOp = tmpWrappedPrecOp;
601 wrappedPrecOp = makeEpetraWrapper(tmpWrappedPrecOp);
605 epetraPrecOp->getEpetraOpView(
606 outArg(epetra_epetraPrecOp), outArg(epetra_epetraPrecOpTransp),
607 outArg(epetra_epetraPrecOpApplyAs), outArg(epetra_epetraPrecOpAdjointSupport));
609 epetra_epetraPrecOp.
get()==NULL,std::logic_error
610 ,
"Error, The input prec object and its embedded preconditioner" 611 " operator must be fully initialized before calling this function!" 620 overall_epetra_epetraPrecOpTransp
622 real_trans(wrappedPrecOpTransp),
623 real_trans(epetra_epetraPrecOpTransp)
631 if(approxFwdOp.
get()) {
634 unwrap(approxFwdOp,&wrappedPrecOpScalar,&wrappedPrecOpTransp,&wrappedPrecOp);
637 epetraPrecOp->getEpetraOpView(
638 outArg(epetra_epetraPrecOp), outArg(epetra_epetraPrecOpTransp),
639 outArg(epetra_epetraPrecOpApplyAs), outArg(epetra_epetraPrecOpAdjointSupport)
642 epetra_epetraPrecOp.
get()==NULL,std::logic_error
643 ,
"Error, The input approxFwdOp object must be fully initialized" 644 " before calling this function!" 654 overall_epetra_epetraPrecOpTransp
656 real_trans(wrappedPrecOpTransp),
657 real_trans(epetra_epetraPrecOpTransp)
666 rowmatrix_epetraFwdOp = rcp_dynamic_cast<
const Epetra_RowMatrix>(
668 rowmatrix_epetraPrecOp = rcp_dynamic_cast<const Epetra_RowMatrix>(
669 epetra_epetraPrecOp);
675 enum ELocalPrecType {
676 PT_NONE, PT_AZTEC_FROM_OP, PT_AZTEC_FROM_APPROX_FWD_MATRIX,
677 PT_FROM_PREC_OP, PT_UPPER_BOUND
679 ELocalPrecType localPrecType = PT_UPPER_BOUND;
682 localPrecType = PT_NONE;
687 localPrecType = PT_AZTEC_FROM_OP;
692 localPrecType = PT_AZTEC_FROM_APPROX_FWD_MATRIX;
694 else if( precUsed.
get() ) {
697 localPrecType = PT_FROM_PREC_OP;
700 (localPrecType == PT_UPPER_BOUND, std::logic_error,
701 "AztecOOLinearOpWithSolveFactory::initializeOp_impl(...): " 702 "localPrecType == PT_UPPER_BOUND. This means that previously, " 703 "this value might have been used uninitialized. " 704 "Please report this bug to the Stratimikos developers.");
719 bool old_isExternalPrec;
723 double old_aztecSolverScalar;
734 ,&old_aztecSolverScalar
736 if( old_aztecFwdSolver.
get()==NULL ) {
744 aztecFwdSolver = old_aztecFwdSolver;
745 aztecAdjSolver = old_aztecAdjSolver;
746 startingOver =
false;
749 Ptr<bool> constructedAztecPreconditioner;
753 !
is_null(constructedAztecPreconditioner = get_optional_nonconst_extra_data<bool>(
754 aztecFwdSolver,
"AOOLOWSF::constructedAztecPreconditoner") )
756 *constructedAztecPreconditioner
759 aztecFwdSolver->DestroyPreconditioner();
760 *constructedAztecPreconditioner =
false;
764 Ptr<bool> setPreconditionerOperator;
766 localPrecType != PT_FROM_PREC_OP
767 && !
is_null( setPreconditionerOperator = get_optional_nonconst_extra_data<bool>(
768 aztecFwdSolver,
"AOOLOWSF::setPreconditonerOperator") )
769 && *setPreconditionerOperator
785 aztecFwdSolver =
rcp(
new AztecOO());
786 aztecFwdSolver->SetAztecOption(AZ_diagnostics,AZ_none);
787 aztecFwdSolver->SetAztecOption(AZ_keep_info,1);
792 localPrecType!=PT_AZTEC_FROM_OP && localPrecType!=PT_AZTEC_FROM_APPROX_FWD_MATRIX
795 aztecAdjSolver =
rcp(
new AztecOO());
796 aztecAdjSolver->SetAztecOption(AZ_diagnostics,AZ_none);
821 aztec_epetra_epetraFwdOp,
822 aztec_epetra_epetraAdjOp;
826 = { epetra_epetraFwdOp };
833 ? PO::APPLY_MODE_APPLY
834 : PO::APPLY_MODE_APPLY_INVERSE };
838 epetraOpsApplyMode[0] == PO::APPLY_MODE_APPLY
841 aztec_epetra_epetraFwdOp = epetra_epetraFwdOp;
845 aztec_epetra_epetraFwdOp =
rcp(
846 new PO(1,epetraOps,epetraOpsTransp,epetraOpsApplyMode));
851 aztec_epetra_epetraFwdOp.
get() != aztecFwdSolver->GetUserOperator()
856 aztecFwdSolver->SetUserOperator(
857 const_cast<Epetra_Operator*>(&*aztec_epetra_epetraFwdOp));
859 aztec_epetra_epetraFwdOp, AOOLOWSF_aztec_epetra_epetraFwdOp_str,
864 if( aztecAdjSolver.
get() ) {
865 epetraOpsTransp[0] = (
866 epetra_epetraFwdOpTransp==
NOTRANS 873 epetraOpsApplyMode[0] == PO::APPLY_MODE_APPLY
876 aztec_epetra_epetraAdjOp = epetra_epetraFwdOp;
879 aztec_epetra_epetraAdjOp =
rcp(
880 new PO(1,epetraOps,epetraOpsTransp,epetraOpsApplyMode));
882 aztecAdjSolver->SetUserOperator(
883 const_cast<Epetra_Operator*>(&*aztec_epetra_epetraAdjOp));
885 aztec_epetra_epetraAdjOp, AOOLOWSF_aztec_epetra_epetraAdjOp_str,
894 aztec_fwd_epetra_epetraPrecOp,
895 aztec_adj_epetra_epetraPrecOp;
896 bool setAztecPreconditioner =
false;
897 switch(localPrecType) {
904 case PT_AZTEC_FROM_OP: {
909 if( startingOver || !reusePrec ) {
911 rowmatrix_epetraFwdOp.
get()==NULL, std::logic_error,
912 "AztecOOLinearOpWithSolveFactory::initializeOp_impl(...): " 913 "Error, There is no preconditioner given by client, but the client " 914 "passed in an Epetra_Operator for the forward operator of type \'" 915 <<
typeName(*epetra_epetraFwdOp)<<
"\' that does not " 916 "support the Epetra_RowMatrix interface!" 919 epetra_epetraFwdOpTransp!=
NOTRANS, std::logic_error,
920 "AztecOOLinearOpWithSolveFactory::initializeOp_impl(...):" 921 " Error, There is no preconditioner given by client and the client " 922 "passed in an Epetra_RowMatrix for the forward operator but the " 923 "overall transpose is not NOTRANS and therefore we can can just " 924 "hand this over to aztec without making a copy which is not supported here!" 926 aztecFwdSolver->SetPrecMatrix(
927 const_cast<Epetra_RowMatrix*>(&*rowmatrix_epetraFwdOp));
929 rowmatrix_epetraFwdOp, AOOLOWSF_rowmatrix_epetraFwdOp_str,
933 setAztecPreconditioner =
true;
936 case PT_AZTEC_FROM_APPROX_FWD_MATRIX: {
941 if( startingOver || !reusePrec ) {
943 rowmatrix_epetraPrecOp.get()==NULL, std::logic_error
944 ,
"AztecOOLinearOpWithSolveFactor::initializeOp_impl(...): The client " 945 "passed in an Epetra_Operator for the preconditioner matrix of type \'" 946 <<
typeName(*epetra_epetraPrecOp)<<
"\' that does not " 947 "support the Epetra_RowMatrix interface!" 950 overall_epetra_epetraPrecOpTransp!=
NOTRANS, std::logic_error
951 ,
"AztecOOLinearOpWithSolveFactor::initializeOp_impl(...): Error, The client " 952 "passed in an Epetra_RowMatrix for the preconditoner matrix but the overall " 953 "transpose is not NOTRANS and therefore we can can just " 954 "hand this over to aztec without making a copy which is not supported here!" 956 aztecFwdSolver->SetPrecMatrix(
957 const_cast<Epetra_RowMatrix*>(&*rowmatrix_epetraPrecOp));
959 rowmatrix_epetraPrecOp, AOOLOWSF_rowmatrix_epetraPrecOp_str,
963 setAztecPreconditioner =
true;
966 case PT_FROM_PREC_OP: {
973 = { epetra_epetraPrecOp };
976 = { overall_epetra_epetraPrecOpTransp==
NOTRANS 982 theEpetraOpsApplyMode[]
984 ? PO::APPLY_MODE_APPLY_INVERSE
985 : PO::APPLY_MODE_APPLY };
992 aztec_fwd_epetra_epetraPrecOp = epetra_epetraPrecOp;
995 aztec_fwd_epetra_epetraPrecOp =
rcp(
new PO(1,theEpetraOps,theEpetraOpsTransp,theEpetraOpsApplyMode));
997 aztecFwdSolver->SetPrecOperator(
998 const_cast<Epetra_Operator*>(&*aztec_fwd_epetra_epetraPrecOp));
1000 aztec_fwd_epetra_epetraPrecOp, AOOLOWSF_aztec_fwd_epetra_epetraPrecOp_str,
1005 aztecAdjSolver.
get()
1010 theEpetraOpsTransp[0] = (
1011 overall_epetra_epetraPrecOpTransp==
NOTRANS 1021 aztec_adj_epetra_epetraPrecOp = epetra_epetraPrecOp;
1024 aztec_adj_epetra_epetraPrecOp =
rcp(
1025 new PO(1,theEpetraOps,theEpetraOpsTransp,theEpetraOpsApplyMode));
1027 aztecAdjSolver->SetPrecOperator(
1028 const_cast<Epetra_Operator*>(&*aztec_adj_epetra_epetraPrecOp));
1030 aztec_adj_epetra_epetraPrecOp, AOOLOWSF_aztec_adj_epetra_epetraPrecOp_str,
1033 set_extra_data<bool>(
1034 true, AOOLOWSF_setPrecondtionerOperator_str,
1047 if(setAztecPreconditioner) {
1048 if( startingOver || !reusePrec ) {
1049 double condNumEst = -1.0;
1052 set_extra_data<bool>(
1053 true, AOOLOWSF_constructedAztecPreconditoner_str,
1065 if(aztecAdjSolver.
get() && aztecAdjSolver->GetPrecOperator()) {
1067 fwdOp, fwdOpSrc,precUsed, prec.
get()!=NULL, approxFwdOpSrc,
1068 aztecFwdSolver,
true, aztecAdjSolver,
true, epetra_epetraFwdOpScalar
1073 fwdOp, fwdOpSrc, precUsed, prec.
get()!=NULL, approxFwdOpSrc,
1074 aztecFwdSolver,
true, null,
false, epetra_epetraFwdOpScalar
1082 aztecOp->setOStream(this->getOStream());
1083 if(!
is_null(this->getOverridingOStream()))
1084 aztecOp->setOverridingOStream(this->getOverridingOStream());
1085 aztecOp->setVerbLevel(this->getVerbLevel());
1087 #ifdef TEUCHOS_DEBUG 1093 *out <<
"\nLeaving Thyra::AztecOOLinearOpWithSolveFactory::initializeOp_impl(...) ...\n";
void setAztecOOParameters(Teuchos::ParameterList *pl, AztecOO *solver)
Setup an AztecOO solver object with a set of parameters.
Teuchos::RCP< PreconditionerFactoryBase< double > > getPreconditionerFactory() const
Teuchos::RCP< Teuchos::ParameterList > paramList_
std::string typeName(const T &t)
bool acceptsPreconditionerFactory() const
Returns true .
bool is_null(const boost::shared_ptr< T > &p)
Teuchos::RCP< Teuchos::ParameterList > thisValidParamList_
T & get(ParameterList &l, const std::string &name)
double defaultFwdTolerance_
bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
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 isSublist(const std::string &name) const
AztecOOLinearOpWithSolveFactory(Teuchos::RCP< Teuchos::ParameterList > const ¶mList=Teuchos::null)
Construct uninitialized.
void initializeAndReuseOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, LinearOpWithSolveBase< double > *Op) const
RCP< ParameterList > sublist(const RCP< ParameterList > ¶mList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
std::string description() const
bool isExternalPrec() const
Determine if the preconditioner was external or not.
void updateThisValidParamList()
void initializeApproxPreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const LinearOpSourceBase< double > > &approxFwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
int defaultFwdMaxIterations_
EPETRA_OP_APPLY_APPLY_INVERSE
void validateParameters(ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
double defaultAdjTolerance_
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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
T_To & dyn_cast(T_From &from)
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
void unsetPreconditionerFactory(Teuchos::RCP< PreconditionerFactoryBase< double > > *precFactory, std::string *precFactoryName)
Teuchos::RCP< LinearOpWithSolveBase< double > > createOp() const
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
T * getPtr(const std::string &name)
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList)
ParameterList & setParameters(const ParameterList &source)
std::string precFactoryName_
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.
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
int defaultAdjMaxIterations_
bool isCompatible(const LinearOpSourceBase< double > &fwdOpSrc) const
void initializePreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const PreconditionerBase< double > > &prec, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
EPETRA_OP_ADJOINT_SUPPORTED
void initializeOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
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()
#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.