|
Belos Package Browser (Single Doxygen Collection)
Development
|
Go to the documentation of this file.
43 #ifndef BELOS_STATUS_TEST_RESNORM_OUTPUT_HPP
44 #define BELOS_STATUS_TEST_RESNORM_OUTPUT_HPP
73 template <
class ScalarType,
class MV,
class OP>
205 std::vector<Teuchos::RCP<StatusTest<ScalarType,MV,OP> > > tmpVec = comboTest->
getStatusTests();
208 int numTests = tmpVec.size();
211 for (
int i=0; i<numTests; ++i) {
215 if (tmpItrTest != Teuchos::null) {
223 if (tmpResTest != Teuchos::null) {
238 tmpResTest = Teuchos::rcp_dynamic_cast<StatusTestResNorm_t>(tmpVec[j]);
291 void print(std::ostream& os,
int indent = 0)
const {
292 std::string ind(indent,
' ');
293 std::string starLine(55,
'*');
294 std::string starFront(5,
'*');
296 std::ios_base::fmtflags osFlags(os.flags());
298 os.setf(std::ios::scientific, std::ios::floatfield);
303 os << std::endl << ind << starLine << std::endl;
304 os << ind << starFront <<
" Belos Iterative Solver: " <<
solverDesc_ << std::endl;
306 os << ind << starFront <<
" Preconditioner: " <<
precondDesc_ << std::endl;
307 os << ind << starFront <<
" Maximum Iterations: " <<
iterTest_->getMaxIters() << std::endl;
308 os << ind << starFront <<
" Block Size: " <<
blockSize_ << std::endl;
310 os << ind << starFront <<
" Residual Tests ("
312 <<
"): " << std::endl;
314 os << ind << starFront <<
" Residual Test: " << std::endl;
317 os << ind << starFront <<
" Test " << i+1 <<
" : " <<
resTestVec_[i]->description() << std::endl;
319 os << ind << starLine << std::endl;
324 os.setf(std::ios_base::right, std::ios_base::adjustfield);
337 os << std::setw(15) <<
"---";
359 std::vector<Teuchos::RCP<StatusTestResNorm<ScalarType,MV,OP> > >
resTestVec_;
Belos header file which uses auto-configuration information to include necessary C++ headers.
MultiVecTraits< ScalarType, MV > MVT
int getLSNumber() const
The number of linear systems that have been set.
Teuchos::RCP< OutputManager< ScalarType > > printer_
Belos's basic output manager for sending information of select verbosity levels to the appropriate ou...
Pure virtual base class for defining the status testing capabilities of Belos.
StatusType checkStatus(Iteration< ScalarType, MV, OP > *solver)
void resetNumCalls()
Informs the outputting status test that it should reset the number of calls to zero.
Exception thrown to signal error in a status test during Belos::StatusTest::checkStatus().
StatusTestResNormOutput(const Teuchos::RCP< OutputManager< ScalarType > > &printer, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test, int mod=1, int printStates=Passed)
Constructor.
Belos::StatusTest abstract class for specifying a residual norm stopping criteria.
Teuchos::RCP< StatusTestMaxIters< ScalarType, MV, OP > > iterTest_
A Belos::StatusTest class for specifying a maximum number of iterations.
Belos::StatusTestMaxIters< ScalarType, MV, OP > StatusTestMaxIters_t
static int GetNumberVecs(const MV &mv)
Obtain the number of vectors in mv.
Virtual base class for StatusTest that printing status tests.
A linear system to solve, and its associated information.
void setOutputManager(const Teuchos::RCP< OutputManager< ScalarType > > &printer)
Set the output manager.
void setOutputFrequency(int mod)
Set how often the child test is printed.
void print(std::ostream &os, int indent=0) const
Output formatted description of stopping test to output stream.
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test_
StatusType
Whether the StatusTest wants iteration to stop.
Belos::StatusTest class for specifying a maximum number of iterations.
A special StatusTest for printing other status tests in a simple format.
const std::vector< int > getLSIndex() const
(Zero-based) indices of the linear system(s) currently being solved.
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > getChild() const
Get child test.
Teuchos::RCP< const MV > getRHS() const
A pointer to the right-hand side B.
Belos::StatusTestResNorm< ScalarType, MV, OP > StatusTestResNorm_t
An abstract class of StatusTest for stopping criteria using residual norms.
virtual int getBlockSize() const =0
Get the blocksize to be used by the iterative solver in solving this linear problem.
Belos::StatusTestCombo< ScalarType, MV, OP > StatusTestCombo_t
StatusType getStatus() const
Return the result of the most recent checkStatus call, or undefined if it has not been run.
A pure virtual class for defining the status tests for the Belos iterative solvers.
st_vector getStatusTests()
Return the vector of status tests.
A class for extending the status testing capabilities of Belos via logical combinations.
void setChild(Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test)
Set child test, which must be a combination of a Belos::StatusTestMaxIters AND a single or combinatio...
virtual const LinearProblem< ScalarType, MV, OP > & getProblem() const =0
Get a constant reference to the linear problem.
Collection of types and exceptions used within the Belos solvers.
A virtual base class for StatusTest that print other status tests.
virtual ~StatusTestResNormOutput()
Destructor.
void reset()
Informs the status test that it should reset its internal configuration to the uninitialized state.
void setSolverDesc(const std::string &solverDesc)
Set a short solver description for output clarity.
Pure virtual base class which describes the basic interface to the linear solver iteration.
Traits class which defines basic operations on multivectors.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Belos::StatusTest for logically combining several status tests.
void setPrecondDesc(const std::string &precondDesc)
Set a short preconditioner description for output clarity.
std::vector< Teuchos::RCP< StatusTestResNorm< ScalarType, MV, OP > > > resTestVec_
Vector of residual status tests.
std::vector< int > currIdx_
ComboType getComboType() const
Return the type of combination (OR, AND, or SEQ).