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 #include "Thyra_PreconditionerFactoryBase.hpp"
00033 #include "Thyra_DefaultLinearOpSource.hpp"
00034 #include "Thyra_DefaultPreconditioner.hpp"
00035
00036 namespace Thyra {
00037
00040 template <class Scalar>
00041 void initializePrec(
00042 const PreconditionerFactoryBase<Scalar> &precFactory
00043 ,const Teuchos::RefCountPtr<const LinearOpBase<Scalar> > &fwdOp
00044 ,PreconditionerBase<Scalar> *precOp
00045 ,const ESupportSolveUse supportSolveUse = SUPPORT_SOLVE_UNSPECIFIED
00046 )
00047 {
00048 precFactory.initializePrec(defaultLinearOpSource(fwdOp),precOp,supportSolveUse);
00049 }
00050
00054 template <class Scalar>
00055 void uninitializePrec(
00056 const PreconditionerFactoryBase<Scalar> &precFactory
00057 ,PreconditionerBase<Scalar> *prec
00058 ,Teuchos::RefCountPtr<const LinearOpBase<Scalar> > *fwdOp = NULL
00059 ,ESupportSolveUse *supportSolveUse = NULL
00060 )
00061 {
00062 Teuchos::RefCountPtr<const LinearOpSourceBase<Scalar> > fwdOpSrc;
00063 precFactory.uninitializePrec(prec,&fwdOpSrc,supportSolveUse);
00064 if(fwdOp) *fwdOp = fwdOpSrc->getOp();
00065 }
00066
00067 }
00068
00069 #endif // THYRA_PRECONDITIONER_FACTORY_HELPERS_DECL_HPP