10#ifndef BELOS_BLOCK_GMRES_SOLMGR_HPP
11#define BELOS_BLOCK_GMRES_SOLMGR_HPP
34#ifdef BELOS_TEUCHOS_TIME_MONITOR
35#include "Teuchos_TimeMonitor.hpp"
95template<
class ScalarType,
class MV,
class OP>
101 typedef Teuchos::ScalarTraits<ScalarType> SCT;
102 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
103 typedef Teuchos::ScalarTraits<MagnitudeType> MT;
138 const Teuchos::RCP<Teuchos::ParameterList> &
pl );
144 Teuchos::RCP<SolverManager<ScalarType, MV, OP> >
clone ()
const override {
171 Teuchos::Array<Teuchos::RCP<Teuchos::Time> >
getTimers()
const {
172 return Teuchos::tuple(timerSolve_);
259 const Teuchos::EVerbosityLevel
verbLevel =
260 Teuchos::Describable::verbLevel_default)
const override;
270 bool checkStatusTest();
273 Teuchos::RCP<LinearProblem<ScalarType,MV,OP> > problem_;
276 Teuchos::RCP<OutputManager<ScalarType> > printer_;
277 Teuchos::RCP<std::ostream> outputStream_;
280 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > debugStatusTest_;
281 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > sTest_;
282 Teuchos::RCP<StatusTestMaxIters<ScalarType,MV,OP> > maxIterTest_;
283 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > convTest_;
284 Teuchos::RCP<StatusTestResNorm<ScalarType,MV,OP> > expConvTest_, impConvTest_;
285 Teuchos::RCP<StatusTestOutput<ScalarType,MV,OP> > outputTest_;
288 Teuchos::RCP<MatOrthoManager<ScalarType,MV,OP> > ortho_;
291 Teuchos::RCP<Teuchos::ParameterList> params_;
294 static constexpr int maxRestarts_default_ = 20;
295 static constexpr int maxIters_default_ = 1000;
296 static constexpr bool adaptiveBlockSize_default_ =
true;
297 static constexpr bool showMaxResNormOnly_default_ =
false;
298 static constexpr bool flexibleGmres_default_ =
false;
299 static constexpr bool expResTest_default_ =
false;
300 static constexpr int blockSize_default_ = 1;
301 static constexpr int numBlocks_default_ = 300;
304 static constexpr int outputFreq_default_ = -1;
305 static constexpr const char * impResScale_default_ =
"Norm of Preconditioned Initial Residual";
306 static constexpr const char * expResScale_default_ =
"Norm of Initial Residual";
307 static constexpr const char * label_default_ =
"Belos";
308 static constexpr const char * orthoType_default_ =
"ICGS";
311 MagnitudeType convtol_, orthoKappa_, achievedTol_;
312 int maxRestarts_, maxIters_, numIters_;
313 int blockSize_, numBlocks_, verbosity_, outputStyle_, outputFreq_;
314 bool adaptiveBlockSize_, showMaxResNormOnly_, isFlexible_, expResTest_;
315 std::string orthoType_;
316 std::string impResScale_, expResScale_;
320 Teuchos::RCP<Teuchos::Time> timerSolve_;
323 bool isSet_, isSTSet_;
329template<
class ScalarType,
class MV,
class OP>
335 maxRestarts_(maxRestarts_default_),
336 maxIters_(maxIters_default_),
338 blockSize_(blockSize_default_),
339 numBlocks_(numBlocks_default_),
340 verbosity_(verbosity_default_),
341 outputStyle_(outputStyle_default_),
342 outputFreq_(outputFreq_default_),
343 adaptiveBlockSize_(adaptiveBlockSize_default_),
344 showMaxResNormOnly_(showMaxResNormOnly_default_),
345 isFlexible_(flexibleGmres_default_),
346 expResTest_(expResTest_default_),
347 orthoType_(orthoType_default_),
348 impResScale_(impResScale_default_),
349 expResScale_(expResScale_default_),
350 label_(label_default_),
358template<
class ScalarType,
class MV,
class OP>
361 const Teuchos::RCP<Teuchos::ParameterList> &
pl) :
367 maxRestarts_(maxRestarts_default_),
368 maxIters_(maxIters_default_),
370 blockSize_(blockSize_default_),
371 numBlocks_(numBlocks_default_),
372 verbosity_(verbosity_default_),
373 outputStyle_(outputStyle_default_),
374 outputFreq_(outputFreq_default_),
375 adaptiveBlockSize_(adaptiveBlockSize_default_),
376 showMaxResNormOnly_(showMaxResNormOnly_default_),
377 isFlexible_(flexibleGmres_default_),
378 expResTest_(expResTest_default_),
379 orthoType_(orthoType_default_),
380 impResScale_(impResScale_default_),
381 expResScale_(expResScale_default_),
382 label_(label_default_),
398template<
class ScalarType,
class MV,
class OP>
399Teuchos::RCP<const Teuchos::ParameterList>
402 static Teuchos::RCP<const Teuchos::ParameterList>
validPL;
404 Teuchos::RCP<Teuchos::ParameterList>
pl = Teuchos::parameterList();
409 "The relative residual tolerance that needs to be achieved by the\n"
410 "iterative solver in order for the linear system to be declared converged." );
411 pl->set(
"Maximum Restarts",
static_cast<int>(maxRestarts_default_),
412 "The maximum number of restarts allowed for each\n"
413 "set of RHS solved.");
414 pl->set(
"Maximum Iterations",
static_cast<int>(maxIters_default_),
415 "The maximum number of block iterations allowed for each\n"
416 "set of RHS solved.");
417 pl->set(
"Num Blocks",
static_cast<int>(numBlocks_default_),
418 "The maximum number of blocks allowed in the Krylov subspace\n"
419 "for each set of RHS solved.");
420 pl->set(
"Block Size",
static_cast<int>(blockSize_default_),
421 "The number of vectors in each block. This number times the\n"
422 "number of blocks is the total Krylov subspace dimension.");
423 pl->set(
"Adaptive Block Size",
static_cast<bool>(adaptiveBlockSize_default_),
424 "Whether the solver manager should adapt the block size\n"
425 "based on the number of RHS to solve.");
426 pl->set(
"Verbosity",
static_cast<int>(verbosity_default_),
427 "What type(s) of solver information should be outputted\n"
428 "to the output stream.");
429 pl->set(
"Output Style",
static_cast<int>(outputStyle_default_),
430 "What style is used for the solver information outputted\n"
431 "to the output stream.");
432 pl->set(
"Output Frequency",
static_cast<int>(outputFreq_default_),
433 "How often convergence information should be outputted\n"
434 "to the output stream.");
435 pl->set(
"Output Stream", Teuchos::rcpFromRef(std::cout),
436 "A reference-counted pointer to the output stream where all\n"
437 "solver output is sent.");
438 pl->set(
"Show Maximum Residual Norm Only",
static_cast<bool>(showMaxResNormOnly_default_),
439 "When convergence information is printed, only show the maximum\n"
440 "relative residual norm when the block size is greater than one.");
441 pl->set(
"Flexible Gmres",
static_cast<bool>(flexibleGmres_default_),
442 "Whether the solver manager should use the flexible variant\n"
444 pl->set(
"Explicit Residual Test",
static_cast<bool>(expResTest_default_),
445 "Whether the explicitly computed residual should be used in the convergence test.");
446 pl->set(
"Implicit Residual Scaling",
static_cast<const char *
>(impResScale_default_),
447 "The type of scaling used in the implicit residual convergence test.");
448 pl->set(
"Explicit Residual Scaling",
static_cast<const char *
>(expResScale_default_),
449 "The type of scaling used in the explicit residual convergence test.");
450 pl->set(
"Timer Label",
static_cast<const char *
>(label_default_),
451 "The string to use as a prefix for the timer labels.");
452 pl->set(
"Orthogonalization",
static_cast<const char *
>(orthoType_default_),
453 "The type of orthogonalization to use: DGKS, ICGS, or IMGS.");
455 "The constant used by DGKS orthogonalization to determine\n"
456 "whether another step of classical Gram-Schmidt is necessary.");
463template<
class ScalarType,
class MV,
class OP>
468 if (params_ == Teuchos::null) {
469 params_ = Teuchos::rcp(
new Teuchos::ParameterList(*getValidParameters()) );
472 params->validateParameters(*getValidParameters());
476 if (
params->isParameter(
"Maximum Restarts")) {
477 maxRestarts_ =
params->get(
"Maximum Restarts",maxRestarts_default_);
480 params_->set(
"Maximum Restarts", maxRestarts_);
484 if (
params->isParameter(
"Maximum Iterations")) {
485 maxIters_ =
params->get(
"Maximum Iterations",maxIters_default_);
488 params_->set(
"Maximum Iterations", maxIters_);
489 if (maxIterTest_!=Teuchos::null)
490 maxIterTest_->setMaxIters( maxIters_ );
494 if (
params->isParameter(
"Block Size")) {
495 blockSize_ =
params->get(
"Block Size",blockSize_default_);
497 "Belos::BlockGmresSolMgr: \"Block Size\" must be strictly positive.");
500 params_->set(
"Block Size", blockSize_);
504 if (
params->isParameter(
"Adaptive Block Size")) {
505 adaptiveBlockSize_ =
params->get(
"Adaptive Block Size",adaptiveBlockSize_default_);
508 params_->set(
"Adaptive Block Size", adaptiveBlockSize_);
512 if (
params->isParameter(
"Num Blocks")) {
513 numBlocks_ =
params->get(
"Num Blocks",numBlocks_default_);
515 "Belos::BlockGmresSolMgr: \"Num Blocks\" must be strictly positive.");
518 params_->set(
"Num Blocks", numBlocks_);
522 if (
params->isParameter(
"Timer Label")) {
528 params_->set(
"Timer Label", label_);
529 std::string
solveLabel = label_ +
": BlockGmresSolMgr total solve time";
530#ifdef BELOS_TEUCHOS_TIME_MONITOR
531 timerSolve_ = Teuchos::TimeMonitor::getNewCounter(
solveLabel);
533 if (ortho_ != Teuchos::null) {
534 ortho_->setLabel( label_ );
540 if (
params->isParameter(
"Flexible Gmres")) {
541 isFlexible_ = Teuchos::getParameter<bool>(*
params,
"Flexible Gmres");
542 params_->set(
"Flexible Gmres", isFlexible_);
543 if (isFlexible_ && expResTest_) {
550 if (
params->isParameter(
"Verbosity")) {
551 if (Teuchos::isParameterType<int>(*
params,
"Verbosity")) {
552 verbosity_ =
params->get(
"Verbosity", verbosity_default_);
554 verbosity_ = (
int)Teuchos::getParameter<Belos::MsgType>(*
params,
"Verbosity");
558 params_->set(
"Verbosity", verbosity_);
559 if (printer_ != Teuchos::null)
560 printer_->setVerbosity(verbosity_);
564 if (
params->isParameter(
"Output Style")) {
565 if (Teuchos::isParameterType<int>(*
params,
"Output Style")) {
566 outputStyle_ =
params->get(
"Output Style", outputStyle_default_);
568 outputStyle_ = (
int)Teuchos::getParameter<Belos::OutputType>(*
params,
"Output Style");
572 params_->set(
"Output Style", outputStyle_);
573 if (outputTest_ != Teuchos::null) {
579 if (
params->isParameter(
"Output Stream")) {
580 outputStream_ = Teuchos::getParameter<Teuchos::RCP<std::ostream> >(*
params,
"Output Stream");
583 params_->set(
"Output Stream", outputStream_);
584 if (printer_ != Teuchos::null)
585 printer_->setOStream( outputStream_ );
590 if (
params->isParameter(
"Output Frequency")) {
591 outputFreq_ =
params->get(
"Output Frequency", outputFreq_default_);
595 params_->set(
"Output Frequency", outputFreq_);
596 if (outputTest_ != Teuchos::null)
597 outputTest_->setOutputFrequency( outputFreq_ );
601 if (printer_ == Teuchos::null) {
607 if (
params->isParameter(
"Orthogonalization")) {
614 params_->set(
"Orthogonalization", orthoType_);
617 if (
params->isParameter(
"Orthogonalization Constant")) {
618 if (
params->isType<MagnitudeType> (
"Orthogonalization Constant")) {
619 orthoKappa_ =
params->get (
"Orthogonalization Constant",
623 orthoKappa_ =
params->get (
"Orthogonalization Constant",
628 params_->set(
"Orthogonalization Constant",orthoKappa_);
629 if (orthoType_==
"DGKS") {
631 Teuchos::rcp_dynamic_cast<DGKSOrthoManager<ScalarType,MV,OP> >(ortho_)->setDepTol( orthoKappa_ );
640 if (orthoType_==
"DGKS" && orthoKappa_ > 0) {
641 paramsOrtho = Teuchos::rcp(
new Teuchos::ParameterList());
645 ortho_ =
factory.makeMatOrthoManager (orthoType_, Teuchos::null, printer_, label_,
paramsOrtho);
649 if (
params->isParameter(
"Convergence Tolerance")) {
650 if (
params->isType<MagnitudeType> (
"Convergence Tolerance")) {
651 convtol_ =
params->get (
"Convergence Tolerance",
659 params_->set(
"Convergence Tolerance", convtol_);
660 if (impConvTest_ != Teuchos::null)
661 impConvTest_->setTolerance( convtol_ );
662 if (expConvTest_ != Teuchos::null)
663 expConvTest_->setTolerance( convtol_ );
667 if (
params->isParameter(
"Implicit Residual Scaling")) {
668 std::string
tempImpResScale = Teuchos::getParameter<std::string>( *
params,
"Implicit Residual Scaling" );
676 params_->set(
"Implicit Residual Scaling", impResScale_);
677 if (impConvTest_ != Teuchos::null) {
681 catch (std::exception&
e) {
689 if (
params->isParameter(
"Explicit Residual Scaling")) {
690 std::string
tempExpResScale = Teuchos::getParameter<std::string>( *
params,
"Explicit Residual Scaling" );
698 params_->set(
"Explicit Residual Scaling", expResScale_);
699 if (expConvTest_ != Teuchos::null) {
703 catch (std::exception&
e) {
711 if (
params->isParameter(
"Explicit Residual Test")) {
712 expResTest_ = Teuchos::getParameter<bool>( *
params,
"Explicit Residual Test" );
715 params_->set(
"Explicit Residual Test", expResTest_);
716 if (expConvTest_ == Teuchos::null) {
721 if (
params->isParameter(
"Show Maximum Residual Norm Only")) {
722 showMaxResNormOnly_ = Teuchos::getParameter<bool>(*
params,
"Show Maximum Residual Norm Only");
725 params_->set(
"Show Maximum Residual Norm Only", showMaxResNormOnly_);
726 if (impConvTest_ != Teuchos::null)
727 impConvTest_->setShowMaxResNormOnly( showMaxResNormOnly_ );
728 if (expConvTest_ != Teuchos::null)
729 expConvTest_->setShowMaxResNormOnly( showMaxResNormOnly_ );
734 if (timerSolve_ == Teuchos::null) {
735 std::string
solveLabel = label_ +
": BlockGmresSolMgr total solve time";
736#ifdef BELOS_TEUCHOS_TIME_MONITOR
737 timerSolve_ = Teuchos::TimeMonitor::getNewCounter(
solveLabel);
746template<
class ScalarType,
class MV,
class OP>
759 if (isFlexible_ && Teuchos::is_null(problem_->getRightPrec())) {
761 params_->set(
"Flexible Gmres", isFlexible_);
765 "Belos::BlockGmresSolMgr::solve(): Linear problem has a left preconditioner, not a right preconditioner, which is required for flexible GMRES.");
770 if (!Teuchos::is_null(problem_->getLeftPrec()) && !isFlexible_) {
792 convTest_ = Teuchos::rcp(
new StatusTestCombo_t( StatusTestCombo_t::SEQ, impConvTest_, expConvTest_ ) );
815 expConvTest_ = impConvTest_;
816 convTest_ = impConvTest_;
820 sTest_ = Teuchos::rcp(
new StatusTestCombo_t( StatusTestCombo_t::OR, maxIterTest_, convTest_ ) );
823 if (
nonnull(debugStatusTest_) ) {
825 Teuchos::rcp_dynamic_cast<StatusTestCombo_t>(sTest_)->addStatusTest( debugStatusTest_ );
845template<
class ScalarType,
class MV,
class OP>
855template<
class ScalarType,
class MV,
class OP>
862 setParameters(Teuchos::parameterList(*getValidParameters()));
866 "Belos::BlockGmresSolMgr::solve(): Linear problem is not a valid object.");
869 "Belos::BlockGmresSolMgr::solve(): Linear problem is not ready, setProblem() has not been called.");
871 if (!isSTSet_ || (!expResTest_ && !Teuchos::is_null(problem_->getLeftPrec())) ) {
873 "Belos::BlockGmresSolMgr::solve(): Linear problem and requested status tests are incompatible.");
878 int numRHS2Solve = MVT::GetNumberVecs( *(problem_->getRHS()) );
884 if ( adaptiveBlockSize_ ) {
900 problem_->setLSIndex(
currIdx );
904 Teuchos::ParameterList
plist;
905 plist.set(
"Block Size",blockSize_);
907 ptrdiff_t dim = MVT::GetGlobalLength( *(problem_->getRHS()) );
908 if (blockSize_*
static_cast<ptrdiff_t>(numBlocks_) >
dim) {
915 "Belos::BlockGmresSolMgr::solve(): Warning! Requested Krylov subspace dimension is larger than operator dimension!"
916 << std::endl <<
" The maximum number of blocks allowed for the Krylov subspace will be adjusted to " <<
tmpNumBlocks << std::endl;
920 plist.set(
"Num Blocks",numBlocks_);
923 outputTest_->reset();
924 loaDetected_ =
false;
941#ifdef BELOS_TEUCHOS_TIME_MONITOR
942 Teuchos::TimeMonitor
slvtimer(*timerSolve_);
948 if (blockSize_*numBlocks_ >
dim) {
963 outputTest_->resetNumCalls();
966 Teuchos::RCP<MV>
V_0;
969 if (
currIdx[blockSize_-1] == -1) {
970 V_0 = MVT::Clone( *(problem_->getInitResVec()), blockSize_ );
971 problem_->computeCurrResVec( &*
V_0 );
974 V_0 = MVT::CloneCopy( *(problem_->getInitResVec()),
currIdx );
979 if (
currIdx[blockSize_-1] == -1) {
980 V_0 = MVT::Clone( *(problem_->getInitPrecResVec()), blockSize_ );
981 problem_->computeCurrPrecResVec( &*
V_0 );
984 V_0 = MVT::CloneCopy( *(problem_->getInitPrecResVec()),
currIdx );
989 Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> >
z_0 =
990 Teuchos::rcp(
new Teuchos::SerialDenseMatrix<int,ScalarType>( blockSize_, blockSize_ ) );
995 "Belos::BlockGmresSolMgr::solve(): Failed to compute initial block of orthonormal vectors.");
1015 if ( convTest_->getStatus() ==
Passed ) {
1016 if ( expConvTest_->getLOADetected() ) {
1018 loaDetected_ =
true;
1020 "Belos::BlockGmresSolMgr::solve(): Warning! Solver has experienced a loss of accuracy!" << std::endl;
1030 else if ( maxIterTest_->getStatus() ==
Passed ) {
1048 printer_->stream(
Debug) <<
" Performing restart number " <<
numRestarts <<
" of " << maxRestarts_ << std::endl << std::endl;
1054 Teuchos::RCP<MV>
curX = problem_->getCurrLHSVec();
1058 problem_->updateSolution(
update,
true );
1067 problem_->computeCurrResVec( &*
V_0 );
1069 problem_->computeCurrPrecResVec( &*
V_0 );
1072 z_0 = Teuchos::rcp(
new Teuchos::SerialDenseMatrix<int,ScalarType>( blockSize_, blockSize_ ) );
1077 "Belos::BlockGmresSolMgr::solve(): Failed to compute initial block of orthonormal vectors after restart.");
1096 "Belos::BlockGmresSolMgr::solve(): Invalid return from BlockGmresIter::iterate().");
1101 if (blockSize_ != 1) {
1102 printer_->stream(
Errors) <<
"Error! Caught std::exception in BlockGmresIter::iterate() at iteration "
1104 <<
e.what() << std::endl;
1105 if (convTest_->getStatus() !=
Passed)
1115 if (convTest_->getStatus() !=
Passed)
1122 achievedTol_ = MT::one();
1123 Teuchos::RCP<MV>
X = problem_->getLHS();
1124 MVT::MvInit( *
X, SCT::zero() );
1125 printer_->stream(
Warnings) <<
"Belos::BlockGmresSolMgr::solve(): Warning! NaN has been detected!"
1129 catch (
const std::exception &
e) {
1130 printer_->stream(
Errors) <<
"Error! Caught std::exception in BlockGmresIter::iterate() at iteration "
1132 <<
e.what() << std::endl;
1142 Teuchos::RCP<MV>
curX = problem_->getCurrLHSVec();
1144 if (
update != Teuchos::null)
1149 if ( !Teuchos::is_null(expConvTest_->getSolution()) ) {
1150 Teuchos::RCP<MV>
newX = expConvTest_->getSolution();
1151 Teuchos::RCP<MV>
curX = problem_->getCurrLHSVec();
1156 problem_->updateSolution(
update,
true );
1161 problem_->setCurrLS();
1169 if ( adaptiveBlockSize_ ) {
1183 problem_->setLSIndex(
currIdx );
1197#ifdef BELOS_TEUCHOS_TIME_MONITOR
1202 Teuchos::TimeMonitor::summarize( printer_->stream(
TimingDetails) );
1206 numIters_ = maxIterTest_->getNumIters();
1232 "Belos::BlockGmresSolMgr::solve(): The implicit convergence test's "
1233 "getTestValue() method returned NULL. Please report this bug to the "
1234 "Belos developers.");
1236 "Belos::BlockGmresSolMgr::solve(): The implicit convergence test's "
1237 "getTestValue() method returned a vector of length zero. Please report "
1238 "this bug to the Belos developers.");
1253template<
class ScalarType,
class MV,
class OP>
1256 std::ostringstream
out;
1257 out <<
"\"Belos::BlockGmresSolMgr\": {";
1261 out <<
"Flexible: " << (isFlexible_ ?
"true" :
"false")
1262 <<
", Num Blocks: " << numBlocks_
1263 <<
", Maximum Iterations: " << maxIters_
1264 <<
", Maximum Restarts: " << maxRestarts_
1265 <<
", Convergence Tolerance: " << convtol_
1271template<
class ScalarType,
class MV,
class OP>
1275 const Teuchos::EVerbosityLevel
verbLevel)
const
1277 using Teuchos::TypeNameTraits;
1278 using Teuchos::VERB_DEFAULT;
1279 using Teuchos::VERB_NONE;
1280 using Teuchos::VERB_LOW;
1287 const Teuchos::EVerbosityLevel
vl =
1293 out <<
"\"Belos::BlockGmresSolMgr\":" << endl;
1295 out <<
"Template parameters:" << endl;
1305 out <<
"Flexible: " << (isFlexible_ ?
"true" :
"false") << endl
1306 <<
"Num Blocks: " << numBlocks_ << endl
1307 <<
"Maximum Iterations: " << maxIters_ << endl
1308 <<
"Maximum Restarts: " << maxRestarts_ << endl
1309 <<
"Convergence Tolerance: " << convtol_ << endl;
Belos concrete class for performing the block, flexible GMRES iteration.
Belos concrete class for performing the block GMRES iteration.
Belos header file which uses auto-configuration information to include necessary C++ headers.
Pure virtual base class which augments the basic interface for a Gmres linear solver iteration.
Class which describes the linear problem to be solved by the iterative solver.
Class which manages the output and verbosity of the Belos solvers.
Pure virtual base class which describes the basic interface for a solver manager.
Belos::StatusTest for logically combining several status tests.
Belos::StatusTestResNorm for specifying general residual norm stopping criteria.
Belos::StatusTest for specifying an implicit residual norm stopping criteria that checks for loss of ...
Belos::StatusTest class for specifying a maximum number of iterations.
A factory class for generating StatusTestOutput objects.
Virtual base class for StatusTest that printing status tests.
Collection of types and exceptions used within the Belos solvers.
Parent class to all Belos exceptions.
BlockGmresSolMgrLinearProblemFailure is thrown when the linear problem is not setup (i....
BlockGmresSolMgrLinearProblemFailure(const std::string &what_arg)
BlockGmresSolMgrOrthoFailure is thrown when the orthogonalization manager is unable to generate ortho...
BlockGmresSolMgrOrthoFailure(const std::string &what_arg)
Interface to Block GMRES and Flexible GMRES.
void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem) override
Set the linear problem that needs to be solved.
int getNumIters() const override
Get the iteration count for the most recent call to solve().
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const override
Print the object with the given verbosity level to a FancyOStream.
void setDebugStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &debugStatusTest) override
Set a debug status test that will be checked at the same time as the top-level status test.
ReturnType solve() override
This method performs possibly repeated calls to the underlying linear solver's iterate() routine unti...
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > getTimers() const
Return the timers for this object.
std::string description() const override
Return a one-line description of this object.
MagnitudeType achievedTol() const override
Tolerance achieved by the last solve() invocation.
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
Set the parameters the solver manager should use to solve the linear problem.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Get a parameter list containing the valid parameters for this object.
Teuchos::RCP< SolverManager< ScalarType, MV, OP > > clone() const override
clone for Inverted Injection (DII)
BlockGmresSolMgr()
Empty constructor for BlockGmresSolMgr. This constructor takes no arguments and sets the default valu...
virtual ~BlockGmresSolMgr()
Destructor.
Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const override
Get a parameter list containing the current parameters for this object.
void reset(const ResetType type) override
Performs a reset of the solver manager specified by the ResetType. This informs the solver manager th...
bool isLOADetected() const override
Return whether a loss of accuracy was detected by this solver during the most current solve.
const LinearProblem< ScalarType, MV, OP > & getProblem() const override
Get current linear problem being solved for in this object.
GmresIterationOrthoFailure is thrown when the GmresIteration object is unable to compute independent ...
Alternative run-time polymorphic interface for operators.
Operator()
Default constructor (does nothing).
The Belos::SolverManager is a templated virtual base class that defines the basic interface that any ...
ScaleType convertStringToScaleType(const std::string &scaleType)
Convert the given string to its ScaleType enum value.
ReturnType
Whether the Belos solve converged for all linear systems.
ScaleType
The type of scaling to use on the residual norm value.
ResetType
How to reset the solver.
Default parameters common to most Belos solvers.
static const double convTol
Default convergence tolerance.
static const double orthoKappa
DGKS orthogonalization constant.