46 #include "Thyra_AztecOOLinearOpWithSolveFactory.hpp" 47 #include "Thyra_AztecOOLinearOpWithSolve.hpp" 48 #include "Thyra_PreconditionerFactoryHelpers.hpp" 49 #include "Thyra_EpetraOperatorViewExtractorStd.hpp" 50 #include "Thyra_ScaledAdjointLinearOpBase.hpp" 51 #include "Thyra_EpetraLinearOpBase.hpp" 52 #include "Thyra_EpetraOperatorWrapper.hpp" 54 #include "Teuchos_VerboseObjectParameterListHelpers.hpp" 55 #include "Teuchos_ParameterList.hpp" 56 #include "Teuchos_dyn_cast.hpp" 57 #include "AztecOOParameterList.hpp" 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)
114 updateThisValidParamList();
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" 145 precFactory_ = precFactory;
146 precFactoryName_ = _precFactoryName;
147 updateThisValidParamList();
160 std::string *precFactoryName
163 if(precFactory) *precFactory = precFactory_;
164 if(precFactoryName) *precFactoryName = precFactoryName_;
165 precFactory_ = Teuchos::null;
166 precFactoryName_ =
"";
167 updateThisValidParamList();
175 return epetraFwdOpViewExtractor_->isCompatible(*fwdOpSrc.
getOp());
192 this->initializeOp_impl(fwdOpSrc,Teuchos::null,Teuchos::null,
false,Op);
201 this->initializeOp_impl(fwdOpSrc,Teuchos::null,Teuchos::null,
true,Op);
209 const_cast<bool&
>(useAztecPrec_) = (
213 "Aztec Preconditioner",
"none" 221 return useAztecPrec_;
238 this->initializeOp_impl(fwdOpSrc,prec,Teuchos::null,
false,Op);
251 this->initializeOp_impl(fwdOpSrc,Teuchos::null,approxFwdOpSrc,
false,Op);
272 if(fwdOpSrc) *fwdOpSrc = _fwdOpSrc;
273 if(approxFwdOpSrc) *approxFwdOpSrc = _approxFwdOpSrc;
280 if(prec) *prec = _prec;
297 paramList_ = paramList;
299 outputEveryRhs_ = paramList_->
get(OutputEveryRhs_name,OutputEveryRhs_default);
302 &fwdSolvePL = paramList_->
sublist(ForwardSolve_name);
303 defaultFwdMaxIterations_ = fwdSolvePL.
get(MaxIterations_name,defaultFwdMaxIterations_);
304 defaultFwdTolerance_ = fwdSolvePL.
get(Tolerance_name,defaultFwdTolerance_);
311 &adjSolvePL = paramList_->
sublist(AdjointSolve_name);
312 defaultAdjMaxIterations_ = adjSolvePL.
get(MaxIterations_name,defaultAdjMaxIterations_);
313 defaultAdjTolerance_ = adjSolvePL.
get(Tolerance_name,defaultAdjTolerance_);
315 if(precFactory_.get()) {
319 const bool nestedPFSublistExists = paramList_->
isSublist(precFactoryName_);
320 const bool alreadyHasSublist = !
is_null(precFactory_->getParameterList());
321 if( nestedPFSublistExists || !alreadyHasSublist ) {
322 precFactory_->setParameterList(Teuchos::sublist(paramList_,precFactoryName_));
325 Teuchos::readVerboseObjectSublist(&*paramList_,
this);
340 paramList_ = Teuchos::null;
355 return thisValidParamList_;
364 std::ostringstream oss;
365 oss <<
"Thyra::AztecOOLinearOpWithSolveFactory{";
366 oss <<
"precFactory=";
368 oss << precFactory_->description();
380 AztecOOLinearOpWithSolveFactory::generateAndGetValidParameters()
383 if(validParamList.
get()==NULL) {
384 validParamList = Teuchos::rcp(
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)." 392 aztecParamList = getValidAztecOOParameters();
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." 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;
425 void AztecOOLinearOpWithSolveFactory::updateThisValidParamList()
430 if(precFactory_.get()) {
432 precFactoryValidParamList = precFactory_->getValidParameters();
433 if(precFactoryValidParamList.
get()) {
435 *precFactoryValidParamList);
438 Teuchos::setupVerboseObjectSublist(&*thisValidParamList_);
442 void AztecOOLinearOpWithSolveFactory::initializeOp_impl(
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;
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);
497 dynamic_cast<const EpetraLinearOpBase*
>(&*tmpApproxFwdOp.get())
500 approxFwdOp = makeEpetraWrapper(tmpApproxFwdOp);
507 AztecOOLinearOpWithSolve
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!" 539 else if (precFactory_.get() ) {
543 ( !aztecOp->isExternalPrec()
544 ? Teuchos::rcp_const_cast<PreconditionerBase<double> >(
545 aztecOp->extract_prec())
553 myPrec = precFactory_->createPrec();
555 precFactory_->initializePrec(fwdOpSrc,&*myPrec);
562 RCP<const LinearOpBase<double> > rightPrecOp;
563 if (precUsed.
get()) {
564 RCP<const LinearOpBase<double> > unspecified = precUsed->getUnspecifiedPrecOp();
565 RCP<const LinearOpBase<double> > left = precUsed->getLeftPrecOp();
566 RCP<const LinearOpBase<double> > right = precUsed->getRightPrecOp();
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;
586 RCP<const LinearOpBase<double> > wrappedPrecOp = null;
587 RCP<const EpetraLinearOpBase> epetraPrecOp;
592 EOpTransp overall_epetra_epetraPrecOpTransp;
593 if(rightPrecOp.get()) {
594 RCP<const LinearOpBase<double> > tmpWrappedPrecOp;
596 rightPrecOp,&wrappedPrecOpScalar,&wrappedPrecOpTransp,&tmpWrappedPrecOp);
597 if( dynamic_cast<const EpetraLinearOpBase*>(&*tmpWrappedPrecOp) ) {
598 wrappedPrecOp = tmpWrappedPrecOp;
601 wrappedPrecOp = makeEpetraWrapper(tmpWrappedPrecOp);
603 epetraPrecOp = rcp_dynamic_cast<
const EpetraLinearOpBase>(
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
631 if(approxFwdOp.
get()) {
634 unwrap(approxFwdOp,&wrappedPrecOpScalar,&wrappedPrecOpTransp,&wrappedPrecOp);
635 epetraPrecOp = rcp_dynamic_cast<
const EpetraLinearOpBase>(
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
665 RCP<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;
680 if( precUsed.
get()==NULL && approxFwdOp.
get()==NULL && !useAztecPrec_ ) {
682 localPrecType = PT_NONE;
684 else if( precUsed.
get()==NULL && approxFwdOp.
get()==NULL && useAztecPrec_ ) {
687 localPrecType = PT_AZTEC_FROM_OP;
689 else if( approxFwdOp.
get() && useAztecPrec_ ) {
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.");
710 RCP<AztecOO> aztecFwdSolver, aztecAdjSolver;
719 bool old_isExternalPrec;
723 double old_aztecSolverScalar;
724 aztecOp->uninitialize(
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
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
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
796 aztecAdjSolver->SetAztecOption(AZ_diagnostics,AZ_none);
806 setAztecOOParameters(
807 ¶mList_->
sublist(ForwardSolve_name).
sublist(AztecOO_Settings_name),
810 if(aztecAdjSolver.get() && paramList_.
get())
811 setAztecOOParameters(
812 ¶mList_->
sublist(AdjointSolve_name).
sublist(AztecOO_Settings_name),
820 RCP<const Epetra_Operator>
821 aztec_epetra_epetraFwdOp,
822 aztec_epetra_epetraAdjOp;
824 RCP<const Epetra_Operator>
826 = { epetra_epetraFwdOp };
833 ? PO::APPLY_MODE_APPLY
834 : PO::APPLY_MODE_APPLY_INVERSE };
836 epetraOpsTransp[0] == Teuchos::NO_TRANS
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,
860 Teuchos::inOutArg(aztecFwdSolver), Teuchos::POST_DESTROY,
false 864 if( aztecAdjSolver.get() ) {
865 epetraOpsTransp[0] = (
866 epetra_epetraFwdOpTransp==
NOTRANS 871 epetraOpsTransp[0] == Teuchos::NO_TRANS
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,
886 Teuchos::inOutArg(aztecAdjSolver), Teuchos::POST_DESTROY,
false 893 RCP<const Epetra_Operator>
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,
930 Teuchos::inOutArg(aztecFwdSolver), Teuchos::POST_DESTROY,
false 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,
960 Teuchos::inOutArg(aztecFwdSolver), Teuchos::POST_DESTROY,
false 963 setAztecPreconditioner =
true;
966 case PT_FROM_PREC_OP: {
971 RCP<const Epetra_Operator>
973 = { epetra_epetraPrecOp };
976 = { overall_epetra_epetraPrecOpTransp==
NOTRANS 982 theEpetraOpsApplyMode[]
984 ? PO::APPLY_MODE_APPLY_INVERSE
985 : PO::APPLY_MODE_APPLY };
987 theEpetraOpsTransp[0] == Teuchos::NO_TRANS
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,
1001 Teuchos::inOutArg(aztecFwdSolver), Teuchos::POST_DESTROY,
false 1005 aztecAdjSolver.get()
1010 theEpetraOpsTransp[0] = (
1011 overall_epetra_epetraPrecOpTransp==
NOTRANS 1016 theEpetraOpsTransp[0] == Teuchos::NO_TRANS
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,
1031 Teuchos::inOutArg(aztecAdjSolver), Teuchos::POST_DESTROY,
false 1033 set_extra_data<bool>(
1034 true, AOOLOWSF_setPrecondtionerOperator_str,
1035 Teuchos::inOutArg(aztecFwdSolver), Teuchos::POST_DESTROY, false
1047 if(setAztecPreconditioner) {
1048 if( startingOver || !reusePrec ) {
1049 double condNumEst = -1.0;
1052 set_extra_data<bool>(
1053 true, AOOLOWSF_constructedAztecPreconditoner_str,
1054 Teuchos::inOutArg(aztecFwdSolver), Teuchos::POST_DESTROY, false
1065 if(aztecAdjSolver.get() && aztecAdjSolver->GetPrecOperator()) {
1066 aztecOp->initialize(
1067 fwdOp, fwdOpSrc,precUsed, prec.get()!=NULL, approxFwdOpSrc,
1068 aztecFwdSolver,
true, aztecAdjSolver,
true, epetra_epetraFwdOpScalar
1072 aztecOp->initialize(
1073 fwdOp, fwdOpSrc, precUsed, prec.get()!=NULL, approxFwdOpSrc,
1074 aztecFwdSolver,
true, null,
false, epetra_epetraFwdOpScalar
1077 aztecOp->fwdDefaultMaxIterations(defaultFwdMaxIterations_);
1078 aztecOp->fwdDefaultTol(defaultFwdTolerance_);
1079 aztecOp->adjDefaultMaxIterations(defaultAdjMaxIterations_);
1080 aztecOp->adjDefaultTol(defaultAdjTolerance_);
1081 aztecOp->outputEveryRhs(outputEveryRhs_);
1087 #ifdef TEUCHOS_DEBUG 1088 if(paramList_.
get())
1093 *out <<
"\nLeaving Thyra::AztecOOLinearOpWithSolveFactory::initializeOp_impl(...) ...\n";
Teuchos::RCP< PreconditionerFactoryBase< double > > getPreconditionerFactory() const
bool acceptsPreconditionerFactory() const
Returns true .
bool is_null(const boost::shared_ptr< T > &p)
void unwrap(const LinearOpBase< Scalar > &Op, Scalar *scalar, EOpTransp *transp, const LinearOpBase< Scalar > **origOp)
T & get(const std::string &name, T def_value)
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)
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)
virtual EVerbosityLevel getVerbLevel() const
bool isSublist(const std::string &name) const
T_To & dyn_cast(T_From &from)
AztecOOLinearOpWithSolveFactory(Teuchos::RCP< Teuchos::ParameterList > const ¶mList=Teuchos::null)
Construct uninitialized.
void initializeAndReuseOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, LinearOpWithSolveBase< double > *Op) const
virtual RCP< FancyOStream > getOStream() const
EOpTransp real_trans(EOpTransp transp)
std::string description() const
bool isExternalPrec() const
Determine if the preconditioner was external or not.
void initializeApproxPreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const LinearOpSourceBase< double > > &approxFwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
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
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
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
EOpTransp trans_trans(EOpTransp trans1, EOpTransp trans2)
virtual RCP< FancyOStream > getOverridingOStream() const
int DestroyPreconditioner()
void unsetPreconditionerFactory(Teuchos::RCP< PreconditionerFactoryBase< double > > *precFactory, std::string *precFactoryName)
Teuchos::RCP< LinearOpWithSolveBase< double > > createOp() const
T * getPtr(const std::string &name)
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList)
ParameterList & setParameters(const ParameterList &source)
PRECONDITIONER_INPUT_TYPE_AS_OPERATOR
RCP< const PreconditionerBase< double > > extract_prec()
Extract the preconditioner.
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
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
virtual Teuchos::RCP< const LinearOpBase< Scalar > > getOp() const=0
PRECONDITIONER_INPUT_TYPE_AS_MATRIX
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)
std::string typeName(const T &t)
Concrete LinearOpWithSolveBase subclass implemented using AztecOO.
RCP< const LinearOpSourceBase< double > > extract_approxFwdOpSrc()
Extract the approximate forward LinearOpBase<double> object used to build the preconditioner.