|
Belos Package Browser (Single Doxygen Collection)
Development
|
Go to the documentation of this file.
42 #ifndef __Belos_InnerSolver_hpp
43 #define __Belos_InnerSolver_hpp
64 template<
class Scalar,
class MV,
class OP>
78 RCP<MV> X_orig = problem->getLHS ();
80 "problemWithNewRHS(): The original LinearProblem's "
81 "initial guess / current approximate solution (getLHS())"
82 " is null. We need an initial guess or current approxim"
83 "ate solution in order to know the domain of the (right-"
84 "preconditioned, if applicable) operator. This is "
85 "because Belos::MultiVecTraits does not include the idea"
86 " of the domain and range of an operator, or the space "
87 "to which a vector belongs.");
89 "problemWithNewRHS(): the given new right-hand side B "
91 RCP<MV> X = MVT::CloneCopy (problem->getLHS ());
93 RCP<lp_type> lp (
new lp_type (
A, X,
B));
94 lp->setLeftPrec (problem->getLeftPrec ());
95 lp->setRightPrec (problem->getRightPrec ());
137 template<
class Scalar,
class MV,
class OP>
204 const int maxItersPerRestart,
205 const int maxNumRestarts) = 0;
264 template<
class Scalar,
class MV,
class OP>
274 using Teuchos::rcpFromRef;
277 "Belos::InnerSolver is not able to solve the "
278 "transposed system.");
279 RCP<const MV> x_ptr = rcpFromRef (x);
280 RCP<MV> y_ptr = rcpFromRef (y);
281 (void) Op.
solve (y_ptr, x_ptr);
293 template<
class Scalar,
class MV,
class OP>
297 (void) Scalar::this_specialization_is_not_defined();
298 (void) MV::this_specialization_is_not_defined();
299 (void) OP::this_specialization_is_not_defined();
322 template<
class Scalar,
class MV,
class OP>
339 using Teuchos::rcp_implicit_cast;
343 return rcp_implicit_cast<operator_type> (
rcp (
new wrapper_type (solver)));
360 using Teuchos::rcp_dynamic_cast;
364 RCP<wrapper_type> wrapper = rcp_dynamic_cast<wrapper_type> (op,
true);
365 return wrapper->getInnerSolver();
371 #endif // __Belos_InnerSolver_hpp
Teuchos::ScalarTraits< Scalar >::magnitudeType magnitude_type
bool is_null(const boost::shared_ptr< T > &p)
InnerSolver< scalar_type, multivector_type, operator_type > inner_solver_type
Class which defines basic traits for the operator type.
static Teuchos::RCP< inner_solver_type > getInnerSolver(const Teuchos::RCP< operator_type > &op)
Return the given wrapper's inner solver object.
Represents the result of an inner solve.
Class which describes the linear problem to be solved by the iterative solver.
ETrans
Whether to apply the (conjugate) transpose of an operator.
static Teuchos::RCP< OP > makeInnerSolverOperator(const Teuchos::RCP< InnerSolver< Scalar, MV, OP > > &solver)
Wrap the given inner solver in a wrapper_type.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual InnerSolveResult solve(const Teuchos::RCP< MV > &X, const Teuchos::RCP< const MV > &B, const magnitude_type convTol, const int maxItersPerRestart, const int maxNumRestarts)=0
Solve for the given right-hand side(s) B.
A linear system to solve, and its associated information.
virtual ~InnerSolver()
Virtual destructor, for correctness.
Teuchos::RCP< LinearProblem< Scalar, MV, OP > > problemWithNewRHS(const Teuchos::RCP< const LinearProblem< Scalar, MV, OP > > &problem, const Teuchos::RCP< const MV > &B)
New LinearProblem with different right-hand side.
Class which defines basic traits for the operator type.
Declaration of basic traits for the multivector type.
UndefinedWrapperType< Scalar, MV, OP > wrapper_type
virtual Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const =0
Current parameters for the inner solver implementation.
bool nonnull(const std::shared_ptr< T > &p)
static void Apply(const InnerSolver< Scalar, MV, OP > &Op, const MV &x, MV &y, ETrans trans=NOTRANS)
Traits class which defines basic operations on multivectors.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
bool is_null(const std::shared_ptr< T > &p)
Wrap an InnerSolver in an OP (operator).