10#ifndef BELOS_BLOCK_GMRES_SOLMGR_HPP
11#define BELOS_BLOCK_GMRES_SOLMGR_HPP
37#ifdef BELOS_TEUCHOS_TIME_MONITOR
38#include "Teuchos_TimeMonitor.hpp"
98template<
class ScalarType,
class MV,
class OP,
class DM = DefaultDenseMatrix<
int, ScalarType>>
105 typedef Teuchos::ScalarTraits<ScalarType> SCT;
106 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
107 typedef Teuchos::ScalarTraits<MagnitudeType> MT;
142 const Teuchos::RCP<Teuchos::ParameterList> &
pl );
148 Teuchos::RCP<SolverManager<ScalarType, MV, OP, DM> >
clone ()
const override {
175 Teuchos::Array<Teuchos::RCP<Teuchos::Time> >
getTimers()
const {
176 return Teuchos::tuple(timerSolve_);
263 const Teuchos::EVerbosityLevel
verbLevel =
264 Teuchos::Describable::verbLevel_default)
const override;
274 bool checkStatusTest();
277 Teuchos::RCP<LinearProblem<ScalarType,MV,OP,DM> > problem_;
280 Teuchos::RCP<OutputManager<ScalarType> > printer_;
281 Teuchos::RCP<std::ostream> outputStream_;
284 Teuchos::RCP<StatusTest<ScalarType,MV,OP,DM> > debugStatusTest_;
285 Teuchos::RCP<StatusTest<ScalarType,MV,OP,DM> > sTest_;
286 Teuchos::RCP<StatusTestMaxIters<ScalarType,MV,OP,DM> > maxIterTest_;
287 Teuchos::RCP<StatusTest<ScalarType,MV,OP,DM> > convTest_;
288 Teuchos::RCP<StatusTestResNorm<ScalarType,MV,OP,DM> > expConvTest_, impConvTest_;
289 Teuchos::RCP<StatusTestOutput<ScalarType,MV,OP,DM> > outputTest_;
292 Teuchos::RCP<MatOrthoManager<ScalarType,MV,OP,DM> > ortho_;
295 Teuchos::RCP<Teuchos::ParameterList> params_;
298 static constexpr int maxRestarts_default_ = 20;
299 static constexpr int maxIters_default_ = 1000;
300 static constexpr bool adaptiveBlockSize_default_ =
true;
301 static constexpr bool showMaxResNormOnly_default_ =
false;
302 static constexpr bool flexibleGmres_default_ =
false;
303 static constexpr bool keepHessenberg_default_ =
false;
304 static constexpr bool expResTest_default_ =
false;
305 static constexpr int blockSize_default_ = 1;
306 static constexpr int numBlocks_default_ = 300;
309 static constexpr int outputFreq_default_ = -1;
310 static constexpr const char * impResScale_default_ =
"Norm of Preconditioned Initial Residual";
311 static constexpr const char * expResScale_default_ =
"Norm of Initial Residual";
312 static constexpr const char * label_default_ =
"Belos";
313 static constexpr const char * orthoType_default_ =
"ICGS";
316 MagnitudeType convtol_, orthoKappa_, achievedTol_;
317 int maxRestarts_, maxIters_, numIters_;
318 int blockSize_, numBlocks_, verbosity_, outputStyle_, outputFreq_;
319 bool adaptiveBlockSize_, showMaxResNormOnly_, isFlexible_, keepHessenberg_, expResTest_;
320 std::string orthoType_;
321 std::string impResScale_, expResScale_;
325 Teuchos::RCP<Teuchos::Time> timerSolve_;
328 Teuchos::RCP<GmresIteration<ScalarType,MV,OP,DM> > block_gmres_iter_;
331 bool isSet_, isSTSet_;
332 bool needsIterRebuild_;
338template<
class ScalarType,
class MV,
class OP,
class DM>
344 maxRestarts_(maxRestarts_default_),
345 maxIters_(maxIters_default_),
347 blockSize_(blockSize_default_),
348 numBlocks_(numBlocks_default_),
349 verbosity_(verbosity_default_),
350 outputStyle_(outputStyle_default_),
351 outputFreq_(outputFreq_default_),
352 adaptiveBlockSize_(adaptiveBlockSize_default_),
353 showMaxResNormOnly_(showMaxResNormOnly_default_),
354 isFlexible_(flexibleGmres_default_),
355 keepHessenberg_(keepHessenberg_default_),
356 expResTest_(expResTest_default_),
357 orthoType_(orthoType_default_),
358 impResScale_(impResScale_default_),
359 expResScale_(expResScale_default_),
360 label_(label_default_),
363 needsIterRebuild_(
true),
369template<
class ScalarType,
class MV,
class OP,
class DM>
372 const Teuchos::RCP<Teuchos::ParameterList> &
pl) :
378 maxRestarts_(maxRestarts_default_),
379 maxIters_(maxIters_default_),
381 blockSize_(blockSize_default_),
382 numBlocks_(numBlocks_default_),
383 verbosity_(verbosity_default_),
384 outputStyle_(outputStyle_default_),
385 outputFreq_(outputFreq_default_),
386 adaptiveBlockSize_(adaptiveBlockSize_default_),
387 showMaxResNormOnly_(showMaxResNormOnly_default_),
388 isFlexible_(flexibleGmres_default_),
389 keepHessenberg_(keepHessenberg_default_),
390 expResTest_(expResTest_default_),
391 orthoType_(orthoType_default_),
392 impResScale_(impResScale_default_),
393 expResScale_(expResScale_default_),
394 label_(label_default_),
397 needsIterRebuild_(
true),
411template<
class ScalarType,
class MV,
class OP,
class DM>
412Teuchos::RCP<const Teuchos::ParameterList>
415 static Teuchos::RCP<const Teuchos::ParameterList>
validPL;
417 Teuchos::RCP<Teuchos::ParameterList>
pl = Teuchos::parameterList();
422 "The relative residual tolerance that needs to be achieved by the\n"
423 "iterative solver in order for the linear system to be declared converged." );
424 pl->set(
"Maximum Restarts",
static_cast<int>(maxRestarts_default_),
425 "The maximum number of restarts allowed for each\n"
426 "set of RHS solved.");
427 pl->set(
"Maximum Iterations",
static_cast<int>(maxIters_default_),
428 "The maximum number of block iterations allowed for each\n"
429 "set of RHS solved.");
430 pl->set(
"Num Blocks",
static_cast<int>(numBlocks_default_),
431 "The maximum number of blocks allowed in the Krylov subspace\n"
432 "for each set of RHS solved.");
433 pl->set(
"Block Size",
static_cast<int>(blockSize_default_),
434 "The number of vectors in each block. This number times the\n"
435 "number of blocks is the total Krylov subspace dimension.");
436 pl->set(
"Adaptive Block Size",
static_cast<bool>(adaptiveBlockSize_default_),
437 "Whether the solver manager should adapt the block size\n"
438 "based on the number of RHS to solve.");
439 pl->set(
"Verbosity",
static_cast<int>(verbosity_default_),
440 "What type(s) of solver information should be outputted\n"
441 "to the output stream.");
442 pl->set(
"Output Style",
static_cast<int>(outputStyle_default_),
443 "What style is used for the solver information outputted\n"
444 "to the output stream.");
445 pl->set(
"Output Frequency",
static_cast<int>(outputFreq_default_),
446 "How often convergence information should be outputted\n"
447 "to the output stream.");
448 pl->set(
"Output Stream", Teuchos::rcpFromRef(std::cout),
449 "A reference-counted pointer to the output stream where all\n"
450 "solver output is sent.");
451 pl->set(
"Show Maximum Residual Norm Only",
static_cast<bool>(showMaxResNormOnly_default_),
452 "When convergence information is printed, only show the maximum\n"
453 "relative residual norm when the block size is greater than one.");
454 pl->set(
"Flexible Gmres",
static_cast<bool>(flexibleGmres_default_),
455 "Whether the solver manager should use the flexible variant\n"
457 pl->set(
"Keep Hessenberg",
static_cast<bool>(keepHessenberg_default_),
458 "Whether the raw upper Hessenberg matrix should be stored separately\n"
459 "from the QR-factored least squares system. Useful for harmonic Ritz\n"
460 "pair computation from the GMRES iteration state.");
461 pl->set(
"Explicit Residual Test",
static_cast<bool>(expResTest_default_),
462 "Whether the explicitly computed residual should be used in the convergence test.");
463 pl->set(
"Implicit Residual Scaling",
static_cast<const char *
>(impResScale_default_),
464 "The type of scaling used in the implicit residual convergence test.");
465 pl->set(
"Explicit Residual Scaling",
static_cast<const char *
>(expResScale_default_),
466 "The type of scaling used in the explicit residual convergence test.");
467 pl->set(
"Timer Label",
static_cast<const char *
>(label_default_),
468 "The string to use as a prefix for the timer labels.");
469 pl->set(
"Orthogonalization",
static_cast<const char *
>(orthoType_default_),
470 "The type of orthogonalization to use: DGKS, ICGS, or IMGS.");
472 "The constant used by DGKS orthogonalization to determine\n"
473 "whether another step of classical Gram-Schmidt is necessary.");
480template<
class ScalarType,
class MV,
class OP,
class DM>
485 if (params_ == Teuchos::null) {
486 params_ = Teuchos::rcp(
new Teuchos::ParameterList(*getValidParameters()) );
489 params->validateParameters(*getValidParameters());
493 if (
params->isParameter(
"Maximum Restarts")) {
494 maxRestarts_ =
params->get(
"Maximum Restarts",maxRestarts_default_);
497 params_->set(
"Maximum Restarts", maxRestarts_);
501 if (
params->isParameter(
"Maximum Iterations")) {
502 maxIters_ =
params->get(
"Maximum Iterations",maxIters_default_);
505 params_->set(
"Maximum Iterations", maxIters_);
506 if (maxIterTest_!=Teuchos::null)
507 maxIterTest_->setMaxIters( maxIters_ );
511 if (
params->isParameter(
"Block Size")) {
512 blockSize_ =
params->get(
"Block Size",blockSize_default_);
514 "Belos::BlockGmresSolMgr: \"Block Size\" must be strictly positive.");
517 params_->set(
"Block Size", blockSize_);
521 if (
params->isParameter(
"Adaptive Block Size")) {
522 adaptiveBlockSize_ =
params->get(
"Adaptive Block Size",adaptiveBlockSize_default_);
525 params_->set(
"Adaptive Block Size", adaptiveBlockSize_);
529 if (
params->isParameter(
"Num Blocks")) {
530 numBlocks_ =
params->get(
"Num Blocks",numBlocks_default_);
532 "Belos::BlockGmresSolMgr: \"Num Blocks\" must be strictly positive.");
535 params_->set(
"Num Blocks", numBlocks_);
539 if (
params->isParameter(
"Timer Label")) {
545 params_->set(
"Timer Label", label_);
546 std::string
solveLabel = label_ +
": BlockGmresSolMgr total solve time";
547#ifdef BELOS_TEUCHOS_TIME_MONITOR
548 timerSolve_ = Teuchos::TimeMonitor::getNewCounter(
solveLabel);
550 if (ortho_ != Teuchos::null) {
551 ortho_->setLabel( label_ );
557 if (
params->isParameter(
"Keep Hessenberg")) {
558 keepHessenberg_ = Teuchos::getParameter<bool>(*
params,
"Keep Hessenberg");
559 params_->set(
"Keep Hessenberg", keepHessenberg_);
563 if (
params->isParameter(
"Flexible Gmres")) {
564 isFlexible_ = Teuchos::getParameter<bool>(*
params,
"Flexible Gmres");
565 params_->set(
"Flexible Gmres", isFlexible_);
566 if (isFlexible_ && expResTest_) {
573 if (
params->isParameter(
"Verbosity")) {
574 if (Teuchos::isParameterType<int>(*
params,
"Verbosity")) {
575 verbosity_ =
params->get(
"Verbosity", verbosity_default_);
577 verbosity_ = (
int)Teuchos::getParameter<Belos::MsgType>(*
params,
"Verbosity");
581 params_->set(
"Verbosity", verbosity_);
582 if (printer_ != Teuchos::null)
583 printer_->setVerbosity(verbosity_);
587 if (
params->isParameter(
"Output Style")) {
588 if (Teuchos::isParameterType<int>(*
params,
"Output Style")) {
589 outputStyle_ =
params->get(
"Output Style", outputStyle_default_);
591 outputStyle_ = (
int)Teuchos::getParameter<Belos::OutputType>(*
params,
"Output Style");
595 params_->set(
"Output Style", outputStyle_);
596 if (outputTest_ != Teuchos::null) {
602 if (
params->isParameter(
"Output Stream")) {
603 outputStream_ = Teuchos::getParameter<Teuchos::RCP<std::ostream> >(*
params,
"Output Stream");
606 params_->set(
"Output Stream", outputStream_);
607 if (printer_ != Teuchos::null)
608 printer_->setOStream( outputStream_ );
613 if (
params->isParameter(
"Output Frequency")) {
614 outputFreq_ =
params->get(
"Output Frequency", outputFreq_default_);
618 params_->set(
"Output Frequency", outputFreq_);
619 if (outputTest_ != Teuchos::null)
620 outputTest_->setOutputFrequency( outputFreq_ );
624 if (printer_ == Teuchos::null) {
630 if (
params->isParameter(
"Orthogonalization")) {
637 params_->set(
"Orthogonalization", orthoType_);
640 if (
params->isParameter(
"Orthogonalization Constant")) {
641 if (
params->isType<MagnitudeType> (
"Orthogonalization Constant")) {
642 orthoKappa_ =
params->get (
"Orthogonalization Constant",
646 orthoKappa_ =
params->get (
"Orthogonalization Constant",
651 params_->set(
"Orthogonalization Constant",orthoKappa_);
652 if (orthoType_==
"DGKS") {
654 Teuchos::rcp_dynamic_cast<DGKSOrthoManager<ScalarType,MV,OP,DM> >(ortho_)->setDepTol( orthoKappa_ );
663 if (orthoType_==
"DGKS" && orthoKappa_ > 0) {
664 paramsOrtho = Teuchos::rcp(
new Teuchos::ParameterList());
668 ortho_ =
factory.makeMatOrthoManager (orthoType_, Teuchos::null, printer_, label_,
paramsOrtho);
672 if (
params->isParameter(
"Convergence Tolerance")) {
673 if (
params->isType<MagnitudeType> (
"Convergence Tolerance")) {
674 convtol_ =
params->get (
"Convergence Tolerance",
682 params_->set(
"Convergence Tolerance", convtol_);
683 if (impConvTest_ != Teuchos::null)
684 impConvTest_->setTolerance( convtol_ );
685 if (expConvTest_ != Teuchos::null)
686 expConvTest_->setTolerance( convtol_ );
690 if (
params->isParameter(
"Implicit Residual Scaling")) {
691 std::string
tempImpResScale = Teuchos::getParameter<std::string>( *
params,
"Implicit Residual Scaling" );
699 params_->set(
"Implicit Residual Scaling", impResScale_);
700 if (impConvTest_ != Teuchos::null) {
704 catch (std::exception&
e) {
712 if (
params->isParameter(
"Explicit Residual Scaling")) {
713 std::string
tempExpResScale = Teuchos::getParameter<std::string>( *
params,
"Explicit Residual Scaling" );
721 params_->set(
"Explicit Residual Scaling", expResScale_);
722 if (expConvTest_ != Teuchos::null) {
726 catch (std::exception&
e) {
734 if (
params->isParameter(
"Explicit Residual Test")) {
735 expResTest_ = Teuchos::getParameter<bool>( *
params,
"Explicit Residual Test" );
738 params_->set(
"Explicit Residual Test", expResTest_);
739 if (expConvTest_ == Teuchos::null) {
744 if (
params->isParameter(
"Show Maximum Residual Norm Only")) {
745 showMaxResNormOnly_ = Teuchos::getParameter<bool>(*
params,
"Show Maximum Residual Norm Only");
748 params_->set(
"Show Maximum Residual Norm Only", showMaxResNormOnly_);
749 if (impConvTest_ != Teuchos::null)
750 impConvTest_->setShowMaxResNormOnly( showMaxResNormOnly_ );
751 if (expConvTest_ != Teuchos::null)
752 expConvTest_->setShowMaxResNormOnly( showMaxResNormOnly_ );
757 if (timerSolve_ == Teuchos::null) {
758 std::string
solveLabel = label_ +
": BlockGmresSolMgr total solve time";
759#ifdef BELOS_TEUCHOS_TIME_MONITOR
760 timerSolve_ = Teuchos::TimeMonitor::getNewCounter(
solveLabel);
766 needsIterRebuild_ =
true;
771template<
class ScalarType,
class MV,
class OP,
class DM>
784 if (isFlexible_ && Teuchos::is_null(problem_->getRightPrec())) {
786 params_->set(
"Flexible Gmres", isFlexible_);
790 "Belos::BlockGmresSolMgr::solve(): Linear problem has a left preconditioner, not a right preconditioner, which is required for flexible GMRES.");
795 if (!Teuchos::is_null(problem_->getLeftPrec()) && !isFlexible_) {
817 convTest_ = Teuchos::rcp(
new StatusTestCombo_t( StatusTestCombo_t::SEQ, impConvTest_, expConvTest_ ) );
840 expConvTest_ = impConvTest_;
841 convTest_ = impConvTest_;
845 sTest_ = Teuchos::rcp(
new StatusTestCombo_t( StatusTestCombo_t::OR, maxIterTest_, convTest_ ) );
848 if (
nonnull(debugStatusTest_) ) {
850 Teuchos::rcp_dynamic_cast<StatusTestCombo_t>(sTest_)->addStatusTest( debugStatusTest_ );
870template<
class ScalarType,
class MV,
class OP,
class DM>
880template<
class ScalarType,
class MV,
class OP,
class DM>
888 setParameters(Teuchos::parameterList(*getValidParameters()));
892 "Belos::BlockGmresSolMgr::solve(): Linear problem is not a valid object.");
895 "Belos::BlockGmresSolMgr::solve(): Linear problem is not ready, setProblem() has not been called.");
897 if (!isSTSet_ || (!expResTest_ && !Teuchos::is_null(problem_->getLeftPrec())) ) {
899 "Belos::BlockGmresSolMgr::solve(): Linear problem and requested status tests are incompatible.");
904 int numRHS2Solve = MVT::GetNumberVecs( *(problem_->getRHS()) );
910 if ( adaptiveBlockSize_ ) {
926 problem_->setLSIndex(
currIdx );
930 Teuchos::ParameterList
plist;
931 plist.set(
"Block Size",blockSize_);
932 plist.set(
"Keep Hessenberg",keepHessenberg_);
934 ptrdiff_t dim = MVT::GetGlobalLength( *(problem_->getRHS()) );
935 if (blockSize_*
static_cast<ptrdiff_t>(numBlocks_) >
dim) {
942 "Belos::BlockGmresSolMgr::solve(): Warning! Requested Krylov subspace dimension is larger than operator dimension!"
943 << std::endl <<
" The maximum number of blocks allowed for the Krylov subspace will be adjusted to " <<
tmpNumBlocks << std::endl;
947 plist.set(
"Num Blocks",numBlocks_);
950 outputTest_->reset();
951 loaDetected_ =
false;
959 if (needsIterRebuild_) {
964 needsIterRebuild_ =
false;
966 Teuchos::RCP<GmresIteration<ScalarType,MV,OP,DM> > &
block_gmres_iter = block_gmres_iter_;
970#ifdef BELOS_TEUCHOS_TIME_MONITOR
971 Teuchos::TimeMonitor
slvtimer(*timerSolve_);
977 if (blockSize_*numBlocks_ >
dim) {
992 outputTest_->resetNumCalls();
995 Teuchos::RCP<MV>
V_0;
998 if (
currIdx[blockSize_-1] == -1) {
999 V_0 = MVT::Clone( *(problem_->getInitResVec()), blockSize_ );
1000 problem_->computeCurrResVec( &*
V_0 );
1003 V_0 = MVT::CloneCopy( *(problem_->getInitResVec()),
currIdx );
1008 if (
currIdx[blockSize_-1] == -1) {
1009 V_0 = MVT::Clone( *(problem_->getInitPrecResVec()), blockSize_ );
1010 problem_->computeCurrPrecResVec( &*
V_0 );
1013 V_0 = MVT::CloneCopy( *(problem_->getInitPrecResVec()),
currIdx );
1018 Teuchos::RCP<DM>
z_0 = DMT::Create(blockSize_, blockSize_);
1023 "Belos::BlockGmresSolMgr::solve(): Failed to compute initial block of orthonormal vectors.");
1043 if ( convTest_->getStatus() ==
Passed ) {
1044 if ( expConvTest_->getLOADetected() ) {
1047 loaDetected_ =
true;
1049 "Belos::BlockGmresSolMgr::solve(): Warning! Solver has experienced a loss of accuracy!" << std::endl;
1059 else if ( maxIterTest_->getStatus() ==
Passed ) {
1079 printer_->stream(
Debug) <<
" Performing restart number " <<
numRestarts <<
" of " << maxRestarts_ << std::endl << std::endl;
1085 Teuchos::RCP<MV>
curX = problem_->getCurrLHSVec();
1089 problem_->updateSolution(
update,
true );
1098 problem_->computeCurrResVec( &*
V_0 );
1100 problem_->computeCurrPrecResVec( &*
V_0 );
1103 z_0 = DMT::Create(blockSize_, blockSize_);
1108 "Belos::BlockGmresSolMgr::solve(): Failed to compute initial block of orthonormal vectors after restart.");
1128 "Belos::BlockGmresSolMgr::solve(): Invalid return from BlockGmresIter::iterate().");
1133 if (blockSize_ != 1) {
1134 printer_->stream(
Errors) <<
"Error! Caught std::exception in BlockGmresIter::iterate() at iteration "
1136 <<
e.what() << std::endl;
1137 if (convTest_->getStatus() !=
Passed) {
1149 if (convTest_->getStatus() !=
Passed) {
1159 achievedTol_ = MT::one();
1160 Teuchos::RCP<MV>
X = problem_->getLHS();
1161 MVT::MvInit( *
X, SCT::zero() );
1162 printer_->stream(
Warnings) <<
"Belos::BlockGmresSolMgr::solve(): Warning! NaN has been detected!"
1166 catch (
const std::exception &
e) {
1168 printer_->stream(
Errors) <<
"Error! Caught std::exception in BlockGmresIter::iterate() at iteration "
1170 <<
e.what() << std::endl;
1180 Teuchos::RCP<MV>
curX = problem_->getCurrLHSVec();
1182 if (
update != Teuchos::null)
1187 if ( !Teuchos::is_null(expConvTest_->getSolution()) ) {
1188 Teuchos::RCP<MV>
newX = expConvTest_->getSolution();
1189 Teuchos::RCP<MV>
curX = problem_->getCurrLHSVec();
1194 problem_->updateSolution(
update,
true );
1199 problem_->setCurrLS();
1207 if ( adaptiveBlockSize_ ) {
1221 problem_->setLSIndex(
currIdx );
1235#ifdef BELOS_TEUCHOS_TIME_MONITOR
1240 Teuchos::TimeMonitor::summarize( printer_->stream(
TimingDetails) );
1244 numIters_ = maxIterTest_->getNumIters();
1270 "Belos::BlockGmresSolMgr::solve(): The implicit convergence test's "
1271 "getTestValue() method returned NULL. Please report this bug to the "
1272 "Belos developers.");
1274 "Belos::BlockGmresSolMgr::solve(): The implicit convergence test's "
1275 "getTestValue() method returned a vector of length zero. Please report "
1276 "this bug to the Belos developers.");
1291template<
class ScalarType,
class MV,
class OP,
class DM>
1294 std::ostringstream
out;
1295 out <<
"\"Belos::BlockGmresSolMgr\": {";
1299 out <<
"Flexible: " << (isFlexible_ ?
"true" :
"false")
1300 <<
", Num Blocks: " << numBlocks_
1301 <<
", Maximum Iterations: " << maxIters_
1302 <<
", Maximum Restarts: " << maxRestarts_
1303 <<
", Convergence Tolerance: " << convtol_
1309template<
class ScalarType,
class MV,
class OP,
class DM>
1313 const Teuchos::EVerbosityLevel
verbLevel)
const
1315 using Teuchos::TypeNameTraits;
1316 using Teuchos::VERB_DEFAULT;
1317 using Teuchos::VERB_NONE;
1318 using Teuchos::VERB_LOW;
1325 const Teuchos::EVerbosityLevel
vl =
1331 out <<
"\"Belos::BlockGmresSolMgr\":" << endl;
1333 out <<
"Template parameters:" << endl;
1343 out <<
"Flexible: " << (isFlexible_ ?
"true" :
"false") << endl
1344 <<
"Num Blocks: " << numBlocks_ << endl
1345 <<
"Maximum Iterations: " << maxIters_ << endl
1346 <<
"Maximum Restarts: " << maxRestarts_ << endl
1347 <<
"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.
Full specialization of Belos::DenseMatTraits for Kokkos::DualView with arbitrary scalarType....
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.
Virtual base class for StatusTest that printing status tests.
A factory class for generating StatusTestOutput objects.
Full specialization of Belos::DenseMatTraits for Teuchos::SerialDenseMatrix with ordinal type int and...
Collection of types and exceptions used within the Belos solvers.
Parent class to all Belos exceptions.
Interface to Block GMRES and Flexible GMRES.
Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const override
Get a parameter list containing the current parameters for this object.
MagnitudeType achievedTol() const override
Tolerance achieved by the last solve() invocation.
void setDebugStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP, DM > > &debugStatusTest) override
Set a debug status test that will be checked at the same time as the top-level status test.
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
Set the parameters the solver manager should use to solve the linear problem.
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.
std::string description() const override
Return a one-line description of this object.
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > getTimers() const
Return the timers for this object.
void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP, DM > > &problem) override
Set the linear problem that needs to be solved.
Teuchos::RCP< SolverManager< ScalarType, MV, OP, DM > > clone() const override
clone for Inverted Injection (DII)
int getNumIters() const override
Get the iteration count for the most recent call to solve().
ReturnType solve() override
This method performs possibly repeated calls to the underlying linear solver's iterate() routine unti...
BlockGmresSolMgr()
Empty constructor for BlockGmresSolMgr. This constructor takes no arguments and sets the default valu...
bool isLOADetected() const override
Return whether a loss of accuracy was detected by this solver during the most current solve.
virtual ~BlockGmresSolMgr()
Destructor.
const LinearProblem< ScalarType, MV, OP, DM > & getProblem() const override
Get current linear problem being solved for in 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...
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Get a parameter list containing the valid parameters for this object.
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)
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.