12 #include "Thyra_MultiVectorStdOps.hpp"
13 #include "Epetra_MultiVector.h"
24 amesosSolverTransp_(Thyra::
NOTRANS),
25 amesosSolverScalar_(1.0)
31 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
34 const EOpTransp amesosSolverTransp,
35 const double amesosSolverScalar
38 this->
initialize(fwdOp,fwdOpSrc,epetraLP,amesosSolver,
39 amesosSolverTransp,amesosSolverScalar);
45 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
48 const EOpTransp amesosSolverTransp,
49 const double amesosSolverScalar
66 const std::string fwdOpLabel = fwdOp_->getObjectLabel();
67 if(fwdOpLabel.length())
68 this->setObjectLabel(
"lows("+fwdOpLabel+
")" );
84 Teuchos::RCP<
const LinearOpSourceBase<double> > *fwdOpSrc,
87 EOpTransp *amesosSolverTransp,
88 double *amesosSolverScalar
138 std::ostringstream oss;
142 <<
"{fwdOp="<<
fwdOp_->description()
156 using Teuchos::describe;
168 <<
"rangeDim=" << this->
range()->dim()
169 <<
",domainDim="<< this->
domain()->dim() <<
"}\n";
193 return ::Thyra::opSupported(*
fwdOp_,M_trans);
198 const EOpTransp M_trans,
199 const MultiVectorBase<double> &X,
200 const Ptr<MultiVectorBase<double> > &Y,
205 Thyra::apply( *
fwdOp_, M_trans, X, Y, alpha, beta );
214 if (Thyra::real_trans(M_trans) == Thyra::NOTRANS) {
226 const bool supportsAdjoint = (
amesosSolver_->SetUseTranspose(
true) == 0);
228 return supportsAdjoint;
233 EOpTransp ,
const SolveMeasureType&
242 const EOpTransp M_trans,
243 const MultiVectorBase<double> &
B,
244 const Ptr<MultiVectorBase<double> > &X,
245 const Ptr<
const SolveCriteria<double> >
248 using Teuchos::rcpFromPtr;
249 using Teuchos::rcpFromRef;
253 totalTimer.
start(
true);
255 THYRA_FUNC_TIME_MONITOR(
"Stratimikos: AmesosLOWS");
259 OSTab tab = this->getOSTab();
261 *out <<
"\nSolving block system using Amesos solver "
268 const Epetra_Operator *amesosOp =
epetraLP_->GetOperator();
270 &opRangeMap = ( amesosOpTransp ==
NOTRANS
271 ? amesosOp->OperatorRangeMap() : amesosOp->OperatorDomainMap() ),
272 &opDomainMap = ( amesosOpTransp ==
NOTRANS
273 ? amesosOp->OperatorDomainMap() : amesosOp->OperatorRangeMap() );
287 epetraLP_->SetRHS(const_cast<Epetra_MultiVector*>(&*epetra_B));
297 "Error, the function Solve() on the amesos solver of type\n"
319 SolveStatus<double> solveStatus;
320 solveStatus.solveStatus = SOLVE_STATUS_CONVERGED;
321 solveStatus.achievedTol = SolveStatus<double>::unknownTolerance();
322 solveStatus.message =
Teuchos::RCP< Epetra_LinearProblem > epetraLP_
RCP< Epetra_MultiVector > get_Epetra_MultiVector(const Epetra_Map &map, const RCP< MultiVectorBase< double > > &mv)
Teuchos::RCP< const LinearOpSourceBase< double > > extract_fwdOpSrc()
Extract the LinearOpSourceBase<double> object so that it can be modified.
std::string typeName(const T &t)
bool is_null(const boost::shared_ptr< T > &p)
Teuchos::RCP< Amesos_BaseSolver > amesosSolver_
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
virtual bool opSupportedImpl(EOpTransp M_trans) const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
std::string description() const
EOpTransp amesosSolverTransp_
basic_OSTab< char > OSTab
virtual bool solveSupportsImpl(EOpTransp M_trans) const
void start(bool reset=false)
SolveStatus< double > solveImpl(const EOpTransp M_trans, const MultiVectorBase< double > &B, const Ptr< MultiVectorBase< double > > &X, const Ptr< const SolveCriteria< double > > solveCriteria) const
Teuchos::RCP< const VectorSpaceBase< double > > range() const
Teuchos::RCP< const LinearOpSourceBase< double > > fwdOpSrc_
virtual std::string description() const
virtual bool solveSupportsSolveMeasureTypeImpl(EOpTransp M_trans, const SolveMeasureType &solveMeasureType) const
void initialize(const Teuchos::RCP< const LinearOpBase< double > > &fwdOp, const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< Epetra_LinearProblem > &epetraLP, const Teuchos::RCP< Amesos_BaseSolver > &amesosSolver, const EOpTransp amesosSolverTransp, const double amesosSolverScalar)
First initialization.
void uninitialize(Teuchos::RCP< const LinearOpBase< double > > *fwdOp=NULL, Teuchos::RCP< const LinearOpSourceBase< double > > *fwdOpSrc=NULL, Teuchos::RCP< Epetra_LinearProblem > *epetraLP=NULL, Teuchos::RCP< Amesos_BaseSolver > *amesosSolver=NULL, EOpTransp *amesosSolverTransp=NULL, double *amesosSolverScalar=NULL)
Uninitialize.
virtual void applyImpl(const EOpTransp M_trans, const MultiVectorBase< double > &X, const Ptr< MultiVectorBase< double > > &Y, const double alpha, const double beta) const
double amesosSolverScalar_
Teuchos::RCP< const LinearOpBase< double > > fwdOp_
Teuchos::RCP< const LinearOpBase< double > > clone() const
double totalElapsedTime(bool readCurrentTime=false) const
Teuchos::RCP< const VectorSpaceBase< double > > domain() const
AmesosLinearOpWithSolve()
Construct to uninitialized.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)