7 #include "Thyra_EpetraLinearOp.hpp"
8 #include "Thyra_SpmdVectorSpaceBase.hpp"
9 #include "Thyra_DefaultSpmdVectorSpace.hpp"
10 #include "Stratimikos_DefaultLinearSolverBuilder.hpp"
11 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
13 #include "Thyra_EpetraThyraWrappers.hpp"
14 #include "Thyra_LinearOpWithSolveFactoryHelpers.hpp"
44 typedef RCP<const Thyra::LinearOpBase<double> > LinearOpPtr;
45 typedef RCP<Thyra::MutliVectorBase<double> > MultiVectorPtr;
47 LinearOpPtr
A = Thyra::epetraLinearOp( epetra_A );
48 VectorPtr X = Thyra::create_Vector(
rcp(epetra_X,
false), A->domain() );
49 VectorPtr
B = Thyra::create_Vector(
rcp(&epetra_B,
false), A->range() );
64 Stratimikos::DefaultLinearSolverBuilder linearSolverBuilder;
66 linearSolverBuilder.setParameterList(
rcp(paramList,
false) ) ;
69 RCP<Thyra::LinearOpWithSolveFactoryBase<double> >
70 lowsFactory = linearSolverBuilder.createLinearSolveStrategy(
"");
74 RCP<Thyra::LinearOpWithSolveBase<double> >
75 lows = Thyra::linearOpWithSolve(*lowsFactory,A);
78 Thyra::SolveStatus<double>
79 status = Thyra::solve(*lows,Thyra::NOTRANS,*B,&*X);
81 linearSolverBuilder.writeParamsFile(*lowsFactory);
85 std::cout << __FILE__ <<
"::" << __LINE__ <<
86 " paramlist = " << *(linearSolverBuilder.getParameterList( )) << std::endl ;
89 return (status.solveStatus!=Thyra::SOLVE_STATUS_CONVERGED);
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
int simpleStratimikosSolve(Epetra_CrsMatrix const &epetra_A, Epetra_MultiVector const &epetra_B, Epetra_MultiVector *epetra_X, Teuchos::ParameterList *paramList)