11 #include "Thyra_DefaultDiagonalLinearOpWithSolve.hpp"
16 #include "Epetra_RowMatrix.h"
17 #include "Epetra_Vector.h"
18 #include "Epetra_Map.h"
25 const LinearOpSourceBase<double> &fwdOpSrc
28 using Teuchos::outArg;
30 fwdOp = fwdOpSrc.getOp();
32 if( ! (eFwdOp = dynamic_cast<const EpetraLinearOpBase*>(&*fwdOp)) )
35 EOpTransp epetraFwdOpTransp;
39 outArg(epetraFwdOpApplyAs), outArg(epetraFwdOpAdjointSupport) );
40 if( !dynamic_cast<const Epetra_RowMatrix*>(&*epetraFwdOp) )
49 return Teuchos::rcp(
new DefaultDiagonalLinearOpWithSolve<double>());
54 const RCP<
const LinearOpSourceBase<double> > &fwdOpSrc
55 ,LinearOpWithSolveBase<double> *Op
56 ,
const ESupportSolveUse
59 using Teuchos::outArg;
66 EOpTransp epetraFwdOpTransp;
70 outArg(epetraFwdOpApplyAs), outArg(epetraFwdOpAdjointSupport) );
71 const Epetra_RowMatrix &eRMOp =
73 const Epetra_Map &map = eRMOp.OperatorDomainMap();
76 eRMOp.ExtractDiagonalCopy(*e_diag);
81 Teuchos::set_extra_data<RCP<const LinearOpSourceBase<double> > >(
82 fwdOpSrc,
"Thyra::DiagonalEpetraLinearOpWithSolveFactory::fwdOpSrc",
83 Teuchos::inOutArg(diag)
86 Teuchos::rcp_implicit_cast<
const VectorBase<double> >(diag)
93 LinearOpWithSolveBase<double> *Op
94 ,
RCP<
const LinearOpSourceBase<double> > *fwdOpSrc
95 ,
RCP<
const PreconditionerBase<double> > *prec
96 ,
RCP<
const LinearOpSourceBase<double> > *approxFwdOpSrc
100 using Teuchos::get_extra_data;
102 DefaultDiagonalLinearOpWithSolve<double>
105 diag = diagOp.getDiag();
109 get_extra_data<RCP<const LinearOpSourceBase<double> > >(
110 diag,
"Thyra::DiagonalEpetraLinearOpWithSolveFactory::fwdOpSrc"
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList)
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
RCP< const VectorSpaceBase< double > > create_VectorSpace(const RCP< const Epetra_Map > &epetra_map)
Create an VectorSpaceBase object given an Epetra_Map object.
Abstract base class for all LinearOpBase objects that can return an Epetra_Operator view of themselve...
bool isCompatible(const LinearOpSourceBase< double > &fwdOpSrc) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< LinearOpWithSolveBase< double > > createOp() const
RCP< VectorBase< double > > create_Vector(const RCP< Epetra_Vector > &epetra_v, const RCP< const VectorSpaceBase< double > > &space=Teuchos::null)
Create a non-const VectorBase object from a non-const Epetra_Vector object.
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
EAdjointEpetraOp
Determine if adjoints are supported on Epetra_Opeator or not.
T_To & dyn_cast(T_From &from)
virtual void getEpetraOpView(const Ptr< RCP< const Epetra_Operator > > &epetraOp, const Ptr< EOpTransp > &epetraOpTransp, const Ptr< EApplyEpetraOpAs > &epetraOpApplyAs, const Ptr< EAdjointEpetraOp > &epetraOpAdjointSupport) const =0
Return a smart pointer to a const Epetra_Operator view of this object and how the object is applied t...
void initializeOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
EApplyEpetraOpAs
Determine how the apply an Epetra_Operator as a linear operator.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)