42#ifndef BELOS_PSEUDO_BLOCK_GMRES_SOLMGR_HPP
43#define BELOS_PSEUDO_BLOCK_GMRES_SOLMGR_HPP
60#ifdef BELOS_TEUCHOS_TIME_MONITOR
61#include "Teuchos_TimeMonitor.hpp"
119 template<
class ScalarType,
class MV,
class OP>
125 typedef Teuchos::ScalarTraits<ScalarType>
SCT;
126 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
MagnitudeType;
127 typedef Teuchos::ScalarTraits<MagnitudeType>
MT;
254 const Teuchos::RCP<Teuchos::ParameterList> &pl );
260 Teuchos::RCP<SolverManager<ScalarType, MV, OP> >
clone ()
const override {
283 Teuchos::Array<Teuchos::RCP<Teuchos::Time> >
getTimers()
const {
377 void setParameters (
const Teuchos::RCP<Teuchos::ParameterList> ¶ms)
override;
439 describe (Teuchos::FancyOStream& out,
440 const Teuchos::EVerbosityLevel verbLevel =
441 Teuchos::Describable::verbLevel_default)
const override;
467 Teuchos::RCP<LinearProblem<ScalarType,MV,OP> >
problem_;
476 Teuchos::RCP<StatusTest<ScalarType,MV,OP> >
sTest_;
482 Teuchos::RCP<std::map<std::string, Teuchos::RCP<StatusTest<ScalarType, MV, OP> > > >
taggedTests_;
485 Teuchos::RCP<MatOrthoManager<ScalarType,MV,OP> >
ortho_;
525template<
class ScalarType,
class MV,
class OP>
531 achievedTol_(Teuchos::ScalarTraits<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType>::zero()),
554template<
class ScalarType,
class MV,
class OP>
557 const Teuchos::RCP<Teuchos::ParameterList> &pl) :
563 achievedTol_(Teuchos::ScalarTraits<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType>::zero()),
584 TEUCHOS_TEST_FOR_EXCEPTION(
problem_ == Teuchos::null, std::invalid_argument,
"Problem not given to solver manager.");
593template<
class ScalarType,
class MV,
class OP>
596setParameters (
const Teuchos::RCP<Teuchos::ParameterList>& params)
598 using Teuchos::ParameterList;
599 using Teuchos::parameterList;
601 using Teuchos::rcp_dynamic_cast;
604 if (
params_ == Teuchos::null) {
616 if (params->isParameter (
"Maximum Restarts")) {
624 if (params->isParameter (
"Maximum Iterations")) {
635 if (params->isParameter (
"Block Size")) {
637 TEUCHOS_TEST_FOR_EXCEPTION(
639 "Belos::PseudoBlockGmresSolMgr::setParameters: "
640 "The \"Block Size\" parameter must be strictly positive, "
641 "but you specified a value of " <<
blockSize_ <<
".");
648 if (params->isParameter (
"Num Blocks")) {
650 TEUCHOS_TEST_FOR_EXCEPTION(
652 "Belos::PseudoBlockGmresSolMgr::setParameters: "
653 "The \"Num Blocks\" parameter must be strictly positive, "
654 "but you specified a value of " <<
numBlocks_ <<
".");
661 if (params->isParameter (
"Timer Label")) {
662 const std::string tempLabel = params->get (
"Timer Label",
label_default_);
665 if (tempLabel !=
label_) {
668 const std::string solveLabel =
669 label_ +
": PseudoBlockGmresSolMgr total solve time";
670#ifdef BELOS_TEUCHOS_TIME_MONITOR
671 timerSolve_ = Teuchos::TimeMonitor::getNewCounter (solveLabel);
673 if (
ortho_ != Teuchos::null) {
681 if (params->isParameter (
"Verbosity")) {
682 if (Teuchos::isParameterType<int> (*params,
"Verbosity")) {
685 verbosity_ = (int) Teuchos::getParameter<Belos::MsgType> (*params,
"Verbosity");
696 if (params->isParameter (
"Output Style")) {
697 if (Teuchos::isParameterType<int> (*params,
"Output Style")) {
700 outputStyle_ = (int) Teuchos::getParameter<Belos::OutputType> (*params,
"Output Style");
712 if (params->isSublist (
"User Status Tests")) {
713 Teuchos::ParameterList userStatusTestsList = params->sublist(
"User Status Tests",
true);
714 if ( userStatusTestsList.numParams() > 0 ) {
715 std::string userCombo_string = params->get<std::string>(
"User Status Tests Combo Type",
"SEQ");
717 setUserConvStatusTest( testFactory->buildStatusTests(userStatusTestsList), testFactory->stringToComboType(userCombo_string) );
724 if (params->isParameter (
"Output Stream")) {
725 outputStream_ = Teuchos::getParameter<Teuchos::RCP<std::ostream> > (*params,
"Output Stream");
736 if (params->isParameter (
"Output Frequency")) {
753 bool changedOrthoType =
false;
754 if (params->isParameter (
"Orthogonalization")) {
758 changedOrthoType =
true;
764 if (params->isParameter (
"Orthogonalization Constant")) {
765 if (params->isType<
MagnitudeType> (
"Orthogonalization Constant")) {
766 orthoKappa_ = params->get (
"Orthogonalization Constant",
770 orthoKappa_ = params->get (
"Orthogonalization Constant",
785 if (
ortho_.is_null() || changedOrthoType) {
787 Teuchos::RCP<Teuchos::ParameterList> paramsOrtho;
798 if (params->isParameter (
"Convergence Tolerance")) {
799 if (params->isType<
MagnitudeType> (
"Convergence Tolerance")) {
800 convtol_ = params->get (
"Convergence Tolerance",
818 bool userDefinedResidualScalingUpdated =
false;
819 if (params->isParameter (
"User Defined Residual Scaling")) {
821 if (params->isType<
MagnitudeType> (
"User Defined Residual Scaling")) {
822 tempResScaleFactor = params->get (
"User Defined Residual Scaling",
826 tempResScaleFactor = params->get (
"User Defined Residual Scaling",
833 userDefinedResidualScalingUpdated =
true;
836 if(userDefinedResidualScalingUpdated)
838 if (! params->isParameter (
"Implicit Residual Scaling") && !
impConvTest_.is_null ()) {
843 catch (std::exception& e) {
848 if (! params->isParameter (
"Explicit Residual Scaling") && !
expConvTest_.is_null ()) {
853 catch (std::exception& e) {
862 if (params->isParameter (
"Implicit Residual Scaling")) {
863 const std::string tempImpResScale =
864 Teuchos::getParameter<std::string> (*params,
"Implicit Residual Scaling");
880 catch (std::exception& e) {
886 else if (userDefinedResidualScalingUpdated) {
894 catch (std::exception& e) {
902 if (params->isParameter (
"Explicit Residual Scaling")) {
903 const std::string tempExpResScale =
904 Teuchos::getParameter<std::string> (*params,
"Explicit Residual Scaling");
920 catch (std::exception& e) {
926 else if (userDefinedResidualScalingUpdated) {
934 catch (std::exception& e) {
943 if (params->isParameter (
"Show Maximum Residual Norm Only")) {
945 Teuchos::getParameter<bool> (*params,
"Show Maximum Residual Norm Only");
960 if (params->isParameter(
"Deflation Quorum")) {
962 TEUCHOS_TEST_FOR_EXCEPTION(
964 "Belos::PseudoBlockGmresSolMgr::setParameters: "
965 "The \"Deflation Quorum\" parameter (= " <<
defQuorum_ <<
") must not be "
966 "larger than \"Block Size\" (= " <<
blockSize_ <<
").");
978 std::string solveLabel =
label_ +
": PseudoBlockGmresSolMgr total solve time";
979#ifdef BELOS_TEUCHOS_TIME_MONITOR
980 timerSolve_ = Teuchos::TimeMonitor::getNewCounter (solveLabel);
989template<
class ScalarType,
class MV,
class OP>
1000template<
class ScalarType,
class MV,
class OP>
1011template<
class ScalarType,
class MV,
class OP>
1012Teuchos::RCP<const Teuchos::ParameterList>
1015 static Teuchos::RCP<const Teuchos::ParameterList> validPL;
1016 if (is_null(validPL)) {
1017 Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
1022 pl= Teuchos::rcp(
new Teuchos::ParameterList() );
1024 "The relative residual tolerance that needs to be achieved by the\n"
1025 "iterative solver in order for the linear system to be declared converged.");
1027 "The maximum number of restarts allowed for each\n"
1028 "set of RHS solved.");
1030 "The maximum number of block iterations allowed for each\n"
1031 "set of RHS solved.");
1033 "The maximum number of vectors allowed in the Krylov subspace\n"
1034 "for each set of RHS solved.");
1036 "The number of RHS solved simultaneously.");
1038 "What type(s) of solver information should be outputted\n"
1039 "to the output stream.");
1041 "What style is used for the solver information outputted\n"
1042 "to the output stream.");
1044 "How often convergence information should be outputted\n"
1045 "to the output stream.");
1047 "The number of linear systems that need to converge before\n"
1048 "they are deflated. This number should be <= block size.");
1049 pl->set(
"Output Stream", Teuchos::rcpFromRef(std::cout),
1050 "A reference-counted pointer to the output stream where all\n"
1051 "solver output is sent.");
1053 "When convergence information is printed, only show the maximum\n"
1054 "relative residual norm when the block size is greater than one.");
1056 "The type of scaling used in the implicit residual convergence test.");
1058 "The type of scaling used in the explicit residual convergence test.");
1059 pl->set(
"Timer Label",
static_cast<const char *
>(
label_default_),
1060 "The string to use as a prefix for the timer labels.");
1062 "The type of orthogonalization to use.");
1064 "The constant used by DGKS orthogonalization to determine\n"
1065 "whether another step of classical Gram-Schmidt is necessary.");
1066 pl->sublist(
"User Status Tests");
1067 pl->set(
"User Status Tests Combo Type",
"SEQ",
1068 "Type of logical combination operation of user-defined\n"
1069 "and/or solver-specific status tests.");
1076template<
class ScalarType,
class MV,
class OP>
1088 if ( !Teuchos::is_null(
problem_->getLeftPrec()) ) {
1095 Teuchos::RCP<StatusTestGenResNorm_t> tmpImpConvTest =
1106 Teuchos::RCP<StatusTestGenResNorm_t> tmpExpConvTest =
1108 tmpExpConvTest->defineResForm( StatusTestGenResNorm_t::Explicit,
Belos::TwoNorm );
1123 Teuchos::RCP<StatusTestImpResNorm_t> tmpImpConvTest =
1139 Teuchos::RCP<StatusTestCombo_t> tmpComboTest = Teuchos::rcp_dynamic_cast<StatusTestCombo_t>(
userConvStatusTest_);
1140 if (tmpComboTest != Teuchos::null) {
1141 std::vector<Teuchos::RCP<StatusTest<ScalarType,MV,OP> > > tmpVec = tmpComboTest->getStatusTests();
1143 const int numResTests =
static_cast<int>(tmpVec.size());
1144 auto newConvTest = Teuchos::rcp(
new StatusTestCombo_t(
comboType_));
1146 for (
int j = 0; j < numResTests; ++j) {
1147 newConvTest->addStatusTest(tmpVec[j]);
1176 std::string solverDesc =
" Pseudo Block Gmres ";
1188template<
class ScalarType,
class MV,
class OP>
1197 "Belos::PseudoBlockGmresSolMgr::solve(): Linear problem is not ready, setProblem() has not been called.");
1202 "Belos::BlockGmresSolMgr::solve(): Linear problem and requested status tests are incompatible.");
1210 std::vector<int> currIdx( numCurrRHS );
1212 for (
int i=0; i<numCurrRHS; ++i)
1213 { currIdx[i] = startPtr+i; }
1220 Teuchos::ParameterList plist;
1228 bool isConverged =
true;
1233 Teuchos::RCP<PseudoBlockGmresIter<ScalarType,MV,OP> > block_gmres_iter
1238#ifdef BELOS_TEUCHOS_TIME_MONITOR
1242 while ( numRHS2Solve > 0 ) {
1245 std::vector<int> convRHSIdx;
1246 std::vector<int> currRHSIdx( currIdx );
1247 currRHSIdx.resize(numCurrRHS);
1250 block_gmres_iter->setNumBlocks(
numBlocks_ );
1253 block_gmres_iter->resetNumIters();
1262 std::vector<int> index(1);
1271 Teuchos::RCP<Teuchos::SerialDenseVector<int,ScalarType> > tmpZ
1272 = Teuchos::rcp(
new Teuchos::SerialDenseVector<int,ScalarType>( 1 ));
1275 int rank =
ortho_->normalize( *tmpV, tmpZ );
1277 "Belos::PseudoBlockGmresSolMgr::solve(): Failed to compute initial block of orthonormal vectors.");
1279 newState.
V[i] = tmpV;
1280 newState.
Z[i] = tmpZ;
1284 block_gmres_iter->initialize(newState);
1285 int numRestarts = 0;
1291 block_gmres_iter->iterate();
1312 "Belos::PseudoBlockGmresSolMgr::solve(): Warning! Solver has experienced a loss of accuracy!" << std::endl;
1313 isConverged =
false;
1317 std::vector<int> convIdx =
expConvTest_->convIndices();
1321 if (convIdx.size() == currRHSIdx.size())
1332 int curDim = oldState.
curDim;
1337 std::vector<int> oldRHSIdx( currRHSIdx );
1338 std::vector<int> defRHSIdx;
1339 for (
unsigned int i=0; i<currRHSIdx.size(); ++i) {
1341 for (
unsigned int j=0; j<convIdx.size(); ++j) {
1342 if (currRHSIdx[i] == convIdx[j]) {
1348 defRHSIdx.push_back( i );
1351 defState.
V.push_back( Teuchos::rcp_const_cast<MV>( oldState.
V[i] ) );
1352 defState.
Z.push_back( Teuchos::rcp_const_cast<Teuchos::SerialDenseVector<int,ScalarType> >( oldState.
Z[i] ) );
1353 defState.
H.push_back( Teuchos::rcp_const_cast<Teuchos::SerialDenseMatrix<int,ScalarType> >( oldState.
H[i] ) );
1354 defState.
sn.push_back( Teuchos::rcp_const_cast<Teuchos::SerialDenseVector<int,ScalarType> >( oldState.
sn[i] ) );
1355 defState.
cs.push_back( Teuchos::rcp_const_cast<Teuchos::SerialDenseVector<int,MagnitudeType> >(oldState.
cs[i] ) );
1356 currRHSIdx[have] = currRHSIdx[i];
1360 defRHSIdx.resize(currRHSIdx.size()-have);
1361 currRHSIdx.resize(have);
1365 Teuchos::RCP<MV> update = block_gmres_iter->getCurrentUpdate();
1372 problem_->updateSolution( defUpdate,
true );
1376 problem_->setLSIndex( currRHSIdx );
1379 defState.
curDim = curDim;
1382 block_gmres_iter->initialize(defState);
1391 isConverged =
false;
1399 else if ( block_gmres_iter->getCurSubspaceDim() == block_gmres_iter->getMaxSubspaceDim() ) {
1402 isConverged =
false;
1407 printer_->stream(
Debug) <<
" Performing restart number " << numRestarts <<
" of " <<
maxRestarts_ << std::endl << std::endl;
1410 Teuchos::RCP<MV> update = block_gmres_iter->getCurrentUpdate();
1411 problem_->updateSolution( update,
true );
1418 newstate.
V.resize(currRHSIdx.size());
1419 newstate.
Z.resize(currRHSIdx.size());
1424 problem_->computeCurrPrecResVec( &*R_0 );
1425 for (
unsigned int i=0; i<currRHSIdx.size(); ++i) {
1431 Teuchos::RCP<Teuchos::SerialDenseVector<int,ScalarType> > tmpZ
1432 = Teuchos::rcp(
new Teuchos::SerialDenseVector<int,ScalarType>( 1 ));
1435 int rank =
ortho_->normalize( *tmpV, tmpZ );
1437 "Belos::PseudoBlockGmresSolMgr::solve(): Failed to compute initial block of orthonormal vectors after the restart.");
1439 newstate.
V[i] = tmpV;
1440 newstate.
Z[i] = tmpZ;
1445 block_gmres_iter->initialize(newstate);
1457 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
1458 "Belos::PseudoBlockGmresSolMgr::solve(): Invalid return from PseudoBlockGmresIter::iterate().");
1464 block_gmres_iter->updateLSQR( block_gmres_iter->getCurSubspaceDim() );
1467 sTest_->checkStatus( &*block_gmres_iter );
1469 isConverged =
false;
1472 catch (
const std::exception &e) {
1473 printer_->stream(
Errors) <<
"Error! Caught std::exception in PseudoBlockGmresIter::iterate() at iteration "
1474 << block_gmres_iter->getNumIters() << std::endl
1475 << e.what() << std::endl;
1484 Teuchos::RCP<MV> update = block_gmres_iter->getCurrentUpdate();
1485 problem_->updateSolution( update,
true );
1490 Teuchos::RCP<MV> curX =
problem_->getCurrLHSVec();
1495 Teuchos::RCP<MV> update = block_gmres_iter->getCurrentUpdate();
1496 problem_->updateSolution( update,
true );
1503 startPtr += numCurrRHS;
1504 numRHS2Solve -= numCurrRHS;
1505 if ( numRHS2Solve > 0 ) {
1509 currIdx.resize( numCurrRHS );
1510 for (
int i=0; i<numCurrRHS; ++i)
1511 { currIdx[i] = startPtr+i; }
1525 currIdx.resize( numRHS2Solve );
1536#ifdef BELOS_TEUCHOS_TIME_MONITOR
1558 const std::vector<MagnitudeType>* pTestValues = NULL;
1561 if (pTestValues == NULL || pTestValues->size() < 1) {
1569 TEUCHOS_TEST_FOR_EXCEPTION(pTestValues == NULL, std::logic_error,
1570 "Belos::PseudoBlockGmresSolMgr::solve(): The implicit convergence test's "
1571 "getTestValue() method returned NULL. Please report this bug to the "
1572 "Belos developers.");
1573 TEUCHOS_TEST_FOR_EXCEPTION(pTestValues->size() < 1, std::logic_error,
1574 "Belos::PseudoBlockGmresSolMgr::solve(): The implicit convergence test's "
1575 "getTestValue() method returned a vector of length zero. Please report "
1576 "this bug to the Belos developers.");
1581 achievedTol_ = *std::max_element (pTestValues->begin(), pTestValues->end());
1591template<
class ScalarType,
class MV,
class OP>
1594 std::ostringstream out;
1596 out <<
"\"Belos::PseudoBlockGmresSolMgr\": {";
1597 if (this->getObjectLabel () !=
"") {
1598 out <<
"Label: " << this->getObjectLabel () <<
", ";
1601 <<
", Maximum Iterations: " <<
maxIters_
1603 <<
", Convergence Tolerance: " <<
convtol_
1609template<
class ScalarType,
class MV,
class OP>
1612describe (Teuchos::FancyOStream &out,
1613 const Teuchos::EVerbosityLevel verbLevel)
const
1615 using Teuchos::TypeNameTraits;
1616 using Teuchos::VERB_DEFAULT;
1617 using Teuchos::VERB_NONE;
1618 using Teuchos::VERB_LOW;
1625 const Teuchos::EVerbosityLevel vl =
1626 (verbLevel == VERB_DEFAULT) ? VERB_LOW : verbLevel;
1628 if (vl != VERB_NONE) {
1629 Teuchos::OSTab tab0 (out);
1631 out <<
"\"Belos::PseudoBlockGmresSolMgr\":" << endl;
1632 Teuchos::OSTab tab1 (out);
1633 out <<
"Template parameters:" << endl;
1635 Teuchos::OSTab tab2 (out);
1636 out <<
"ScalarType: " << TypeNameTraits<ScalarType>::name () << endl
1637 <<
"MV: " << TypeNameTraits<MV>::name () << endl
1638 <<
"OP: " << TypeNameTraits<OP>::name () << endl;
1640 if (this->getObjectLabel () !=
"") {
1641 out <<
"Label: " << this->getObjectLabel () << endl;
1644 <<
"Maximum Iterations: " <<
maxIters_ << endl
1646 <<
"Convergence Tolerance: " <<
convtol_ << endl;
Belos header file which uses auto-configuration information to include necessary C++ headers.
Class which describes the linear problem to be solved by the iterative solver.
Class which manages the output and verbosity of the Belos solvers.
Belos concrete class for performing the pseudo-block GMRES iteration.
Pure virtual base class which describes the basic interface for a solver manager.
A factory class for generating StatusTestOutput objects.
Collection of types and exceptions used within the Belos solvers.
BelosError(const std::string &what_arg)
An implementation of the Belos::MatOrthoManager that performs orthogonalization using (potentially) m...
void setDepTol(const MagnitudeType dep_tol)
Set parameter for re-orthogonalization threshhold.
Traits class which defines basic operations on multivectors.
static Teuchos::RCP< MV > CloneCopy(const MV &mv)
Creates a new MV and copies contents of mv into the new vector (deep copy).
static Teuchos::RCP< MV > Clone(const MV &mv, const int numvecs)
Creates a new empty MV containing numvecs columns.
static Teuchos::RCP< MV > CloneViewNonConst(MV &mv, const std::vector< int > &index)
Creates a new MV that shares the selected contents of mv (shallow copy).
static void MvAddMv(const ScalarType alpha, const MV &A, const ScalarType beta, const MV &B, MV &mv)
Replace mv with .
static int GetNumberVecs(const MV &mv)
Obtain the number of vectors in mv.
Class which defines basic traits for the operator type.
Enumeration of all valid Belos (Mat)OrthoManager classes.
Teuchos::RCP< Belos::MatOrthoManager< Scalar, MV, OP > > makeMatOrthoManager(const std::string &ortho, const Teuchos::RCP< const OP > &M, const Teuchos::RCP< OutputManager< Scalar > > &, const std::string &label, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Return an instance of the specified MatOrthoManager subclass.
Belos's basic output manager for sending information of select verbosity levels to the appropriate ou...
PseudoBlockGmresIterOrthoFailure is thrown when the orthogonalization manager is unable to generate o...
This class implements the pseudo-block GMRES iteration, where a block Krylov subspace is constructed ...
PseudoBlockGmresSolMgrLinearProblemFailure is thrown when the linear problem is not setup (i....
PseudoBlockGmresSolMgrLinearProblemFailure(const std::string &what_arg)
PseudoBlockGmresSolMgrOrthoFailure is thrown when the orthogonalization manager is unable to generate...
PseudoBlockGmresSolMgrOrthoFailure(const std::string &what_arg)
static constexpr int defQuorum_default_
static constexpr int outputFreq_default_
Teuchos::RCP< std::ostream > outputStream_
void reset(const ResetType type) override
Performs a reset of the solver manager specified by the ResetType. This informs the solver manager th...
MagnitudeType achievedTol_
MagnitudeType orthoKappa_
Teuchos::RCP< std::map< std::string, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > > > taggedTests_
bool isLOADetected() const override
Whether a "loss of accuracy" was detected during the last solve().
OperatorTraits< ScalarType, MV, OP > OPT
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.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
A list of valid default parameters for this solver.
static constexpr int numBlocks_default_
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > debugStatusTest_
Teuchos::ScalarTraits< MagnitudeType > MT
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > convTest_
PseudoBlockGmresSolMgr()
Empty constructor.
static constexpr const char * orthoType_default_
Teuchos::RCP< SolverManager< ScalarType, MV, OP > > clone() const override
clone for Inverted Injection (DII)
static constexpr const char * label_default_
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
Set the parameters the solver manager should use to solve the linear problem.
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.
static constexpr const char * expResScale_default_
static constexpr int outputStyle_default_
MultiVecTraits< ScalarType, MV > MVT
const StatusTestResNorm< ScalarType, MV, OP > * getResidualStatusTest() const
Return the residual status test.
Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > problem_
The current linear problem to solve.
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.
MagnitudeType resScaleFactor_
Teuchos::RCP< Teuchos::Time > timerSolve_
static constexpr int blockSize_default_
std::string description() const override
Return a one-line description of this object.
Teuchos::RCP< StatusTestOutput< ScalarType, MV, OP > > outputTest_
Teuchos::RCP< StatusTestResNorm< ScalarType, MV, OP > > impConvTest_
Teuchos::RCP< StatusTestResNorm< ScalarType, MV, OP > > expConvTest_
Teuchos::ScalarTraits< ScalarType > SCT
virtual void setUserConvStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &userConvStatusTest, const typename StatusTestCombo< ScalarType, MV, OP >::ComboType &comboType=StatusTestCombo< ScalarType, MV, OP >::SEQ) override
Set a custom status test.
MagnitudeType achievedTol() const override
Tolerance achieved by the last solve() invocation.
bool checkStatusTest()
Check current status tests against current linear problem.
Teuchos::RCP< OutputManager< ScalarType > > printer_
StatusTestCombo< ScalarType, MV, OP >::ComboType comboType_
const LinearProblem< ScalarType, MV, OP > & getProblem() const override
Return a reference to the linear problem being solved by this solver manager.
virtual ~PseudoBlockGmresSolMgr()
Destructor.
Teuchos::ScalarTraits< ScalarType >::magnitudeType MagnitudeType
static constexpr int verbosity_default_
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > sTest_
Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const override
The current parameters for this solver.
void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem) override
Set the linear problem to solve.
static constexpr int maxIters_default_
Teuchos::RCP< MatOrthoManager< ScalarType, MV, OP > > ortho_
static constexpr int maxRestarts_default_
static constexpr const char * impResScale_default_
Teuchos::RCP< Teuchos::ParameterList > params_
static constexpr bool showMaxResNormOnly_default_
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > userConvStatusTest_
Teuchos::RCP< StatusTestMaxIters< ScalarType, MV, OP > > maxIterTest_
int getNumIters() const override
Iteration count for the most recent call to solve().
SolverManager()
Empty constructor.
A class for extending the status testing capabilities of Belos via logical combinations.
ComboType
The test can be either the AND of all the component tests, or the OR of all the component tests,...
Factory to build a set of status tests from a parameter list.
An implementation of StatusTestResNorm using a family of residual norms.
Convergence test using the implicit residual norm(s), with an explicit residual norm(s) check for los...
A Belos::StatusTest class for specifying a maximum number of iterations.
A factory class for generating StatusTestOutput objects.
Teuchos::RCP< StatusTestOutput< ScalarType, MV, OP > > create(const Teuchos::RCP< OutputManager< ScalarType > > &printer, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test, int mod, int printStates)
Create the StatusTestOutput object specified by the outputStyle.
An abstract class of StatusTest for stopping criteria using residual norms.
A pure virtual class for defining the status tests for the Belos iterative solvers.
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 resScaleFactor
User-defined residual scaling factor.
static const double convTol
Default convergence tolerance.
static const double orthoKappa
DGKS orthogonalization constant.
Structure to contain pointers to PseudoBlockGmresIter state variables.
std::vector< Teuchos::RCP< const Teuchos::SerialDenseVector< int, ScalarType > > > sn
The current Given's rotation coefficients.
std::vector< Teuchos::RCP< const MV > > V
The current Krylov basis.
std::vector< Teuchos::RCP< const Teuchos::SerialDenseVector< int, ScalarType > > > Z
The current right-hand side of the least squares system RY = Z.
std::vector< Teuchos::RCP< const Teuchos::SerialDenseMatrix< int, ScalarType > > > H
The current Hessenberg matrix.
std::vector< Teuchos::RCP< const Teuchos::SerialDenseVector< int, MagnitudeType > > > cs
int curDim
The current dimension of the reduction.