46 #include "Thyra_MultiVectorStdOps.hpp"
47 #include "Epetra_MultiVector.h"
58 amesosSolverTransp_(Thyra::
NOTRANS),
59 amesosSolverScalar_(1.0)
65 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
68 const EOpTransp amesosSolverTransp,
69 const double amesosSolverScalar
72 this->
initialize(fwdOp,fwdOpSrc,epetraLP,amesosSolver,
73 amesosSolverTransp,amesosSolverScalar);
79 const Teuchos::RCP<
const LinearOpSourceBase<double> > &fwdOpSrc,
82 const EOpTransp amesosSolverTransp,
83 const double amesosSolverScalar
100 const std::string fwdOpLabel = fwdOp_->getObjectLabel();
101 if(fwdOpLabel.length())
102 this->setObjectLabel(
"lows("+fwdOpLabel+
")" );
118 Teuchos::RCP<
const LinearOpSourceBase<double> > *fwdOpSrc,
121 EOpTransp *amesosSolverTransp,
122 double *amesosSolverScalar
126 if(fwdOp) *fwdOp =
fwdOp_;
172 std::ostringstream oss;
176 <<
"{fwdOp="<<
fwdOp_->description()
190 using Teuchos::describe;
202 <<
"rangeDim=" << this->
range()->dim()
203 <<
",domainDim="<< this->
domain()->dim() <<
"}\n";
227 return ::Thyra::opSupported(*
fwdOp_,M_trans);
232 const EOpTransp M_trans,
233 const MultiVectorBase<double> &X,
234 const Ptr<MultiVectorBase<double> > &Y,
239 Thyra::apply( *
fwdOp_, M_trans, X, Y, alpha, beta );
248 if (Thyra::real_trans(M_trans) == Thyra::NOTRANS) {
260 const bool supportsAdjoint = (
amesosSolver_->SetUseTranspose(
true) == 0);
262 return supportsAdjoint;
267 EOpTransp ,
const SolveMeasureType&
276 const EOpTransp M_trans,
277 const MultiVectorBase<double> &
B,
278 const Ptr<MultiVectorBase<double> > &X,
279 const Ptr<
const SolveCriteria<double> >
282 using Teuchos::rcpFromPtr;
283 using Teuchos::rcpFromRef;
287 totalTimer.
start(
true);
289 THYRA_FUNC_TIME_MONITOR(
"Stratimikos: AmesosLOWS");
293 OSTab tab = this->getOSTab();
295 *out <<
"\nSolving block system using Amesos solver "
302 const Epetra_Operator *amesosOp =
epetraLP_->GetOperator();
304 &opRangeMap = ( amesosOpTransp ==
NOTRANS
305 ? amesosOp->OperatorRangeMap() : amesosOp->OperatorDomainMap() ),
306 &opDomainMap = ( amesosOpTransp ==
NOTRANS
307 ? amesosOp->OperatorDomainMap() : amesosOp->OperatorRangeMap() );
321 epetraLP_->SetRHS(const_cast<Epetra_MultiVector*>(&*epetra_B));
331 "Error, the function Solve() on the amesos solver of type\n"
353 SolveStatus<double> solveStatus;
354 solveStatus.solveStatus = SOLVE_STATUS_CONVERGED;
355 solveStatus.achievedTol = SolveStatus<double>::unknownTolerance();
356 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)