diff --git a/packages/belos/src/BelosFixedPointIteration.hpp b/packages/belos/src/BelosFixedPointIteration.hpp index 00f8f18f827f..d4472b1b14a5 100644 --- a/packages/belos/src/BelosFixedPointIteration.hpp +++ b/packages/belos/src/BelosFixedPointIteration.hpp @@ -72,37 +72,6 @@ namespace Belos { {} }; - //! @name FixedPointIteration Exceptions - //@{ - - /** \brief FixedPointIterationInitFailure is thrown when the FixedPointIteration object is unable to - * generate an initial iterate in the FixedPointIteration::initialize() routine. - * - * This std::exception is thrown from the FixedPointIteration::initialize() method, which is - * called by the user or from the FixedPointIteration::iterate() method if isInitialized() - * == \c false. - * - * In the case that this std::exception is thrown, - * FixedPointIteration::isInitialized() will be \c false and the user will need to provide - * a new initial iterate to the iteration. - */ - class FixedPointIterationInitFailure : public BelosError {public: - FixedPointIterationInitFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - - /** \brief FixedPointIterateFailure is thrown when the FixedPointIteration object is unable to - * compute the next iterate in the FixedPointIteration::iterate() routine. - * - * This std::exception is thrown from the FixedPointIteration::iterate() method. - * - */ - class FixedPointIterateFailure : public BelosError {public: - FixedPointIterateFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - - //@} - - template class FixedPointIteration : virtual public Iteration { diff --git a/packages/belos/src/BelosLSQRIteration.hpp b/packages/belos/src/BelosLSQRIteration.hpp index ab9cc04a0bf4..ef11f57f18ef 100644 --- a/packages/belos/src/BelosLSQRIteration.hpp +++ b/packages/belos/src/BelosLSQRIteration.hpp @@ -105,21 +105,6 @@ namespace Belos { //! @name LSQRIteration Exceptions //@{ - /** \brief LSQRIterationInitFailure is thrown when the LSQRIteration object is - * unable to generate an initial iterate in the initialize() routine. - * - * This std::exception is thrown from the initialize() method, which is - * called by the user or from the iterate() method if isInitialized() - * == \c false. - * - * In the case that this std::exception is thrown, - * isInitialized() will be \c false and the user will need to provide - * a new initial iterate to the iteration. - */ -class LSQRIterationInitFailure : public BelosError {public: - LSQRIterationInitFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - /** \brief LSQRIterateFailure is thrown when the LSQRIteration object is unable to * compute the next iterate in the iterate() routine. * diff --git a/packages/belos/src/BelosMinresIteration.hpp b/packages/belos/src/BelosMinresIteration.hpp index dd8118947bab..b45cc6ee9570 100644 --- a/packages/belos/src/BelosMinresIteration.hpp +++ b/packages/belos/src/BelosMinresIteration.hpp @@ -92,21 +92,6 @@ namespace Belos { //! @name MinresIteration Exceptions //@{ - /** \brief MinresIterationInitFailure is thrown when the MinresIteration object is unable to - * generate an initial iterate in the MinresIteration::initialize() routine. - * - * This std::exception is thrown from the MinresIteration::initialize() method, which is - * called by the user or from the MinresIteration::iterate() method if isInitialized() - * == \c false. - * - * In the case that this std::exception is thrown, - * MinresIteration::isInitialized() will be \c false and the user will need to provide - * a new initial iterate to the iteration. - */ - class MinresIterationInitFailure : public BelosError {public: - MinresIterationInitFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - /** \brief MinresIterateFailure is thrown when the MinresIteration object is unable to * compute the next iterate in the MinresIteration::iterate() routine. * diff --git a/packages/belos/src/BelosPCPGIter.hpp b/packages/belos/src/BelosPCPGIter.hpp index d2da5541366d..35297e3a0363 100644 --- a/packages/belos/src/BelosPCPGIter.hpp +++ b/packages/belos/src/BelosPCPGIter.hpp @@ -55,6 +55,7 @@ #include "BelosStatusTest.hpp" #include "BelosOperatorTraits.hpp" #include "BelosMultiVecTraits.hpp" +#include "BelosCGIteration.hpp" #include "Teuchos_SerialDenseMatrix.hpp" #include "Teuchos_SerialDenseVector.hpp" @@ -128,42 +129,6 @@ namespace Belos { //@} - //! @name PCPGIter Exceptions - //@{ - - /** \brief PCPGIterInitFailure is thrown when the PCPGIter object is unable to - * generate an initial iterate in the PCPGIter::initialize() routine. - * - * This std::exception is thrown from the PCPGIter::initialize() method, which is - * called by the user or from the PCPGIter::iterate() method if isInitialized() - * == \c false. - * - * In the case that this std::exception is thrown, - * PCPGIter::isInitialized() will be \c false and the user will need to provide - * a new initial iterate to the iteration. - */ - class PCPGIterInitFailure : public BelosError {public: - PCPGIterInitFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - - /** \brief PCPGIterateFailure is thrown when the PCPGIter object breaks down. - * The std::exception is thrown from the PCPGIter::iterate() method, and - * is due to a coefficient matrix that is not positive definite. - */ - class PCPGIterateFailure : public BelosError {public: - PCPGIterateFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - - /** \brief PCPGIterOrthoFailure is thrown when the PCPGIter object is unable to - * compute independent direction vectors in the PCPGIter::iterate() routine. - * - * This std::exception is thrown from the PCPGIter::iterate() method. - * - */ - class PCPGIterOrthoFailure : public BelosError {public: - PCPGIterOrthoFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - template class PCPGIter : virtual public Iteration { @@ -695,12 +660,12 @@ namespace Belos { Teuchos::RCP cur_soln_vec = lp_->getCurrLHSVec(); // Check that the current solution std::vector only has one column. - TEUCHOS_TEST_FOR_EXCEPTION( MVT::GetNumberVecs(*cur_soln_vec) != 1, PCPGIterInitFailure, - "Belos::CGIter::iterate(): current linear system has more than one std::vector!" ); + TEUCHOS_TEST_FOR_EXCEPTION( MVT::GetNumberVecs(*cur_soln_vec) != 1, CGIterationInitFailure, + "Belos::PCPGIter::iterate(): current linear system has more than one std::vector!" ); //Check that the input is correctly set up - TEUCHOS_TEST_FOR_EXCEPTION( curDim_ != prevUdim_ + 1, PCPGIterInitFailure, - "Belos::CGIter::iterate(): mistake in initialization !" ); + TEUCHOS_TEST_FOR_EXCEPTION( curDim_ != prevUdim_ + 1, CGIterationInitFailure, + "Belos::PCPGIter::iterate(): mistake in initialization !" ); const ScalarType zero = Teuchos::ScalarTraits::zero(); @@ -765,15 +730,15 @@ namespace Belos { (*D_)(iter_ -1 ,iter_ -1 ) = pAp(0,0); // positive pAp required - TEUCHOS_TEST_FOR_EXCEPTION( pAp(0,0) <= zero, PCPGIterateFailure, - "Belos::CGIter::iterate(): non-positive value for p^H*A*p encountered!" ); + TEUCHOS_TEST_FOR_EXCEPTION( pAp(0,0) <= zero, CGPositiveDefiniteFailure, + "Belos::PCPGIter::iterate(): non-positive value for p^H*A*p encountered!" ); // alpha := / alpha(0,0) = rHz(0,0) / pAp(0,0); // positive alpha required - TEUCHOS_TEST_FOR_EXCEPTION( alpha(0,0) <= zero, PCPGIterateFailure, - "Belos::CGIter::iterate(): non-positive value for alpha encountered!" ); + TEUCHOS_TEST_FOR_EXCEPTION( alpha(0,0) <= zero, CGPositiveDefiniteFailure, + "Belos::PCPGIter::iterate(): non-positive value for alpha encountered!" ); // solution update x += alpha * P if( curDim_ < savedBlocks_ ){ diff --git a/packages/belos/src/BelosPCPGSolMgr.hpp b/packages/belos/src/BelosPCPGSolMgr.hpp index c2fd577abdc6..3d6382435062 100644 --- a/packages/belos/src/BelosPCPGSolMgr.hpp +++ b/packages/belos/src/BelosPCPGSolMgr.hpp @@ -102,16 +102,6 @@ namespace Belos { PCPGSolMgrLAPACKFailure(const std::string& what_arg) : BelosError(what_arg) {}}; - /** \brief PCPGSolMgrRecyclingFailure is thrown when any problem occurs in using/creating - * the recycling subspace. - * - * The PCPGSolMgr::solve() method throws the exception. - * - */ - class PCPGSolMgrRecyclingFailure : public BelosError {public: - PCPGSolMgrRecyclingFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - //@} @@ -902,14 +892,6 @@ ReturnType PCPGSolMgr::solve() { "Belos::PCPGSolMgr::solve(): Invalid return from PCPGIter::iterate()."); } // end if } // end try - catch (const PCPGIterOrthoFailure &e) { - - // Check to see if the most recent solution yielded convergence. - sTest_->checkStatus( &*pcpg_iter ); - if (convTest_->getStatus() != Passed) - isConverged = false; - break; - } catch (const std::exception &e) { printer_->stream(Errors) << "Error! Caught exception in PCPGIter::iterate() at iteration " << pcpg_iter->getNumIters() << std::endl diff --git a/packages/belos/src/BelosPseudoBlockCGSolMgr.hpp b/packages/belos/src/BelosPseudoBlockCGSolMgr.hpp index e8b0b5ebb570..e6b8c019d7cc 100644 --- a/packages/belos/src/BelosPseudoBlockCGSolMgr.hpp +++ b/packages/belos/src/BelosPseudoBlockCGSolMgr.hpp @@ -96,16 +96,6 @@ namespace Belos { PseudoBlockCGSolMgrLinearProblemFailure(const std::string& what_arg) : BelosError(what_arg) {}}; - /** \brief PseudoBlockCGSolMgrOrthoFailure is thrown when the orthogonalization manager is - * unable to generate orthonormal columns from the initial basis vectors. - * - * This std::exception is thrown from the PseudoBlockCGSolMgr::solve() method. - * - */ - class PseudoBlockCGSolMgrOrthoFailure : public BelosError {public: - PseudoBlockCGSolMgrOrthoFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - // Partial specialization for unsupported ScalarType types. // This contains a stub implementation. diff --git a/packages/belos/src/BelosPseudoBlockGmresIter.hpp b/packages/belos/src/BelosPseudoBlockGmresIter.hpp index 03f701e108c8..68fd092fe48e 100644 --- a/packages/belos/src/BelosPseudoBlockGmresIter.hpp +++ b/packages/belos/src/BelosPseudoBlockGmresIter.hpp @@ -122,22 +122,6 @@ namespace Belos { //! @name PseudoBlockGmresIter Exceptions //@{ - /** \brief PseudoBlockGmresIterInitFailure is thrown when the PseudoBlockGmresIter object is unable to - * generate an initial iterate in the PseudoBlockGmresIter::initialize() routine. - * - * This std::exception is thrown from the PseudoBlockGmresIter::initialize() method, which is - * called by the user or from the PseudoBlockGmresIter::iterate() method if isInitialized() - * == \c false. - * - * In the case that this std::exception is thrown, - * PseudoBlockGmresIter::isInitialized() will be \c false and the user will need to provide - * a new initial iterate to the iteration. - * - */ - class PseudoBlockGmresIterInitFailure : public BelosError {public: - PseudoBlockGmresIterInitFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - /** \brief PseudoBlockGmresIterOrthoFailure is thrown when the orthogonalization manager is * unable to generate orthonormal columns from the new basis vectors. * diff --git a/packages/belos/src/BelosPseudoBlockTFQMRIter.hpp b/packages/belos/src/BelosPseudoBlockTFQMRIter.hpp index cf8d70ad956f..9b56935f5ee1 100644 --- a/packages/belos/src/BelosPseudoBlockTFQMRIter.hpp +++ b/packages/belos/src/BelosPseudoBlockTFQMRIter.hpp @@ -110,38 +110,6 @@ namespace Belos { {} }; - - //! @name PseudoBlockTFQMRIter Exceptions - //@{ - - /** \brief PseudoBlockTFQMRIterInitFailure is thrown when the PseudoBlockTFQMRIter object is unable to - * generate an initial iterate in the PseudoBlockTFQMRIter::initialize() routine. - * - * This std::exception is thrown from the PseudoBlockTFQMRIter::initialize() method, which is - * called by the user or from the PseudoBlockTFQMRIter::iterate() method if isInitialized() - * == \c false. - * - * In the case that this std::exception is thrown, - * PseudoBlockTFQMRIter::isInitialized() will be \c false and the user will need to provide - * a new initial iterate to the iteration. - */ - class PseudoBlockTFQMRIterInitFailure : public BelosError {public: - PseudoBlockTFQMRIterInitFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - - /** \brief PseudoBlockTFQMRIterateFailure is thrown when the PseudoBlockTFQMRIter object is unable to - * compute the next iterate in the PseudoBlockTFQMRIter::iterate() routine. - * - * This std::exception is thrown from the PseudoBlockTFQMRIter::iterate() method. - * - */ - class PseudoBlockTFQMRIterateFailure : public BelosError {public: - PseudoBlockTFQMRIterateFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - - //@} - - template class PseudoBlockTFQMRIter : public Iteration { public: diff --git a/packages/belos/src/BelosRCGIter.hpp b/packages/belos/src/BelosRCGIter.hpp index 3af56939939d..35f4c155d151 100644 --- a/packages/belos/src/BelosRCGIter.hpp +++ b/packages/belos/src/BelosRCGIter.hpp @@ -55,6 +55,7 @@ #include "BelosStatusTest.hpp" #include "BelosOperatorTraits.hpp" #include "BelosMultiVecTraits.hpp" +#include "BelosCGIteration.hpp" #include "Teuchos_LAPACK.hpp" #include "Teuchos_SerialDenseMatrix.hpp" @@ -140,47 +141,6 @@ namespace Belos { //@} - //! @name RCGIter Exceptions - //@{ - - /** \brief RCGIterInitFailure is thrown when the RCGIter object is unable to - * generate an initial iterate in the RCGIter::initialize() routine. - * - * This std::exception is thrown from the RCGIter::initialize() method, which is - * called by the user or from the RCGIter::iterate() method if isInitialized() - * == \c false. - * - * In the case that this std::exception is thrown, - * RCGIter::isInitialized() will be \c false and the user will need to provide - * a new initial iterate to the iteration. - */ - class RCGIterInitFailure : public BelosError {public: - RCGIterInitFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - - /** \brief RCGIterFailure is thrown when the RCGIter object is unable to - * compute the next iterate in the RCGIter::iterate() routine. - * - * This std::exception is thrown from the RCGIter::iterate() method. - * - */ - class RCGIterFailure : public BelosError {public: - RCGIterFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - - /** \brief RCGIterLAPACKFailure is thrown when a nonzero return value is passed back - * from an LAPACK routine. - * - * This std::exception is thrown from the RCGIter::iterate() method. - * - */ - class RCGIterLAPACKFailure : public BelosError {public: - RCGIterLAPACKFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - - //@} - - template class RCGIter : virtual public Iteration { @@ -529,7 +489,7 @@ namespace Belos { template void RCGIter::iterate() { - TEUCHOS_TEST_FOR_EXCEPTION( initialized_ == false, RCGIterFailure, + TEUCHOS_TEST_FOR_EXCEPTION( initialized_ == false, CGIterateFailure, "Belos::RCGIter::iterate(): RCGIter class not initialized." ); // We'll need LAPACK @@ -547,7 +507,7 @@ namespace Belos { Teuchos::RCP cur_soln_vec = lp_->getCurrLHSVec(); // Check that the current solution std::vector only has one column. - TEUCHOS_TEST_FOR_EXCEPTION( MVT::GetNumberVecs(*cur_soln_vec) != 1, RCGIterFailure, + TEUCHOS_TEST_FOR_EXCEPTION( MVT::GetNumberVecs(*cur_soln_vec) != 1, CGIterateFailure, "Belos::RCGIter::iterate(): current linear system has more than one std::vector!" ); // Compute the current search dimension. @@ -579,7 +539,8 @@ namespace Belos { (*Alpha_)(i_,0) = (*rTz_old_)(0,0) / pAp(0,0); // Check that alpha is a positive number - TEUCHOS_TEST_FOR_EXCEPTION( SCT::real(pAp(0,0)) <= zero, RCGIterFailure, "Belos::RCGIter::iterate(): non-positive value for p^H*A*p encountered!" ); + TEUCHOS_TEST_FOR_EXCEPTION( SCT::real(pAp(0,0)) <= zero, CGPositiveDefiniteFailure, + "Belos::RCGIter::iterate(): non-positive value for p^H*A*p encountered!" ); // x = x + (alpha * p); MVT::MvAddMv( one, *cur_soln_vec, (*Alpha_)(i_,0), *p_, *cur_soln_vec ); @@ -624,7 +585,7 @@ namespace Belos { char TRANS = 'N'; int info; lapack.GETRS( TRANS, recycleBlocks_, 1, LUUTAU_->values(), LUUTAU_->stride(), &(*ipiv_)[0], mu.values(), mu.stride(), &info ); - TEUCHOS_TEST_FOR_EXCEPTION(info != 0, RCGIterLAPACKFailure, + TEUCHOS_TEST_FOR_EXCEPTION(info != 0, CGIterationLAPACKFailure, "Belos::RCGIter::solve(): LAPACK GETRS failed to compute a solution."); // p = -(U*mu) + (beta*p) + z (in two steps) // p = (beta*p) + z; diff --git a/packages/belos/src/BelosRCGSolMgr.hpp b/packages/belos/src/BelosRCGSolMgr.hpp index 9114b02298a9..4fb5afaf6aed 100644 --- a/packages/belos/src/BelosRCGSolMgr.hpp +++ b/packages/belos/src/BelosRCGSolMgr.hpp @@ -128,16 +128,6 @@ namespace Belos { RCGSolMgrLAPACKFailure(const std::string& what_arg) : BelosError(what_arg) {}}; - /** \brief RCGSolMgrRecyclingFailure is thrown when any problem occurs in using/creating - * the recycling subspace. - * - * This exception is thrown from the RCGSolMgr::solve() method. - * - */ - class RCGSolMgrRecyclingFailure : public BelosError {public: - RCGSolMgrRecyclingFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - //@} diff --git a/packages/belos/src/BelosTFQMRIter.hpp b/packages/belos/src/BelosTFQMRIter.hpp index 491332aa0510..20bd5e569270 100644 --- a/packages/belos/src/BelosTFQMRIter.hpp +++ b/packages/belos/src/BelosTFQMRIter.hpp @@ -110,21 +110,6 @@ namespace Belos { //! @name TFQMRIter Exceptions //@{ - /** \brief TFQMRIterInitFailure is thrown when the TFQMRIter object is unable to - * generate an initial iterate in the TFQMRIter::initialize() routine. - * - * This std::exception is thrown from the TFQMRIter::initialize() method, which is - * called by the user or from the TFQMRIter::iterate() method if isInitialized() - * == \c false. - * - * In the case that this std::exception is thrown, - * TFQMRIter::isInitialized() will be \c false and the user will need to provide - * a new initial iterate to the iteration. - */ - class TFQMRIterInitFailure : public BelosError {public: - TFQMRIterInitFailure(const std::string& what_arg) : BelosError(what_arg) - {}}; - /** \brief TFQMRIterateFailure is thrown when the TFQMRIter object is unable to * compute the next iterate in the TFQMRIter::iterate() routine. *