00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef THYRA_PRECONDITIONER_FACTORY_HELPERS_DECL_HPP
00030 #define THYRA_PRECONDITIONER_FACTORY_HELPERS_DECL_HPP
00031
00032
00033 #include "Thyra_PreconditionerFactoryBase.hpp"
00034 #include "Thyra_DefaultLinearOpSource.hpp"
00035 #include "Thyra_DefaultPreconditioner.hpp"
00036
00037
00038 namespace Thyra {
00039
00040
00043 template <class Scalar>
00044 void initializePrec(
00045 const PreconditionerFactoryBase<Scalar> &precFactory
00046 ,const Teuchos::RCP<const LinearOpBase<Scalar> > &fwdOp
00047 ,PreconditionerBase<Scalar> *prec
00048 ,const ESupportSolveUse supportSolveUse = SUPPORT_SOLVE_UNSPECIFIED
00049 )
00050 {
00051 precFactory.initializePrec(defaultLinearOpSource(fwdOp),prec,supportSolveUse);
00052 }
00053
00054
00058 template <class Scalar>
00059 void uninitializePrec(
00060 const PreconditionerFactoryBase<Scalar> &precFactory
00061 ,PreconditionerBase<Scalar> *prec
00062 ,Teuchos::RCP<const LinearOpBase<Scalar> > *fwdOp = NULL
00063 ,ESupportSolveUse *supportSolveUse = NULL
00064 )
00065 {
00066 Teuchos::RCP<const LinearOpSourceBase<Scalar> > fwdOpSrc;
00067 precFactory.uninitializePrec(prec,&fwdOpSrc,supportSolveUse);
00068 if(fwdOp) *fwdOp = fwdOpSrc->getOp();
00069 }
00070
00071
00074 template <class Scalar>
00075 Teuchos::RCP<PreconditionerBase<Scalar> >
00076 prec(
00077 const PreconditionerFactoryBase<Scalar> &precFactory
00078 ,const Teuchos::RCP<const LinearOpBase<Scalar> > &fwdOp
00079 ,const ESupportSolveUse supportSolveUse = SUPPORT_SOLVE_UNSPECIFIED
00080 )
00081 {
00082 Teuchos::RCP<PreconditionerBase<Scalar> >
00083 prec = precFactory.createPrec();
00084 precFactory.initializePrec(defaultLinearOpSource(fwdOp),&*prec,supportSolveUse);
00085 return prec;
00086 }
00087
00088
00089 }
00090
00091
00092 #endif // THYRA_PRECONDITIONER_FACTORY_HELPERS_DECL_HPP