|
Belos Package Browser (Single Doxygen Collection)
Development
|
Go to the documentation of this file.
43 #ifndef BELOS_STATUS_TEST_USER_OUTPUT_HPP
44 #define BELOS_STATUS_TEST_USER_OUTPUT_HPP
69 template <
class ScalarType,
class MV,
class OP>
202 std::vector<Teuchos::RCP<StatusTest<ScalarType,MV,OP> > > tmpVec = comboTest->
getStatusTests();
205 int numTests = tmpVec.size();
208 for (
int i=0; i<numTests; ++i) {
212 if (tmpItrTest != Teuchos::null) {
222 if (tmpResTest != Teuchos::null) {
240 typename std::map<std::string,Teuchos::RCP<StatusTest<ScalarType,MV,OP> > >::iterator it;
241 for (
size_t j=0; j<tmpVec.size(); ++j) {
242 tmpResTest = Teuchos::rcp_dynamic_cast<StatusTestResNorm_t>(tmpVec[j]);
244 if(tmpResTest == Teuchos::null)
continue;
248 if(tmpVec[j] == it->second) { bFound =
true;
break; }
310 void print(std::ostream& os,
int indent = 0)
const {
311 std::string ind(indent,
' ');
312 std::string starLine(55,
'*');
313 std::string starFront(5,
'*');
315 std::ios_base::fmtflags osFlags(os.flags());
317 os.setf(std::ios::scientific, std::ios::floatfield);
322 os << std::endl << ind << starLine << std::endl;
323 os << ind << starFront <<
" Belos Iterative Solver: " <<
solverDesc_ << std::endl;
325 os << ind << starFront <<
" Preconditioner: " <<
precondDesc_ << std::endl;
326 os << ind << starFront <<
" Maximum Iterations: " <<
iterTest_->getMaxIters() << std::endl;
327 os << ind << starFront <<
" Block Size: " <<
blockSize_ << std::endl;
328 os << ind << starFront <<
" Status tests: " << std::endl;
329 test_->print(os,indent + 3);
330 os << ind << starLine << std::endl;
331 os.setf(std::ios_base::right, std::ios_base::adjustfield);
337 os << ind << indheader;
349 os.setf(std::ios_base::right, std::ios_base::adjustfield);
362 if(tempResTest != Teuchos::null)
366 os << std::setw(15) <<
"Passed";
368 os << std::setw(15) <<
"Failed";
369 else os << std::setw(15) <<
"Undefined";
372 os << std::setw(15) <<
"---";
397 std::vector<Teuchos::RCP<StatusTest<ScalarType,MV,OP> > >
resTestVec_;
Belos header file which uses auto-configuration information to include necessary C++ headers.
virtual const std::vector< MagnitudeType > * getTestValue() const =0
Returns the test value, , computed in most recent call to CheckStatus.
std::vector< std::string > resTestNamesVec_
Name tags for status tests.
int getLSNumber() const
The number of linear systems that have been set.
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.
Teuchos::RCP< OutputManager< ScalarType > > printer_
void reset()
Informs the status test that it should reset its internal configuration to the uninitialized state.
Exception thrown to signal error in a status test during Belos::StatusTest::checkStatus().
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test_
Belos::StatusTest abstract class for specifying a residual norm stopping criteria.
A Belos::StatusTest class for specifying a maximum number of iterations.
A special StatusTest for printing other status tests in a simple format.
static int GetNumberVecs(const MV &mv)
Obtain the number of vectors in mv.
void setSolverDesc(const std::string &solverDesc)
Set a short solver description for output clarity.
Virtual base class for StatusTest that printing status tests.
A linear system to solve, and its associated information.
void resetNumCalls()
Informs the outputting status test that it should reset the number of calls to zero.
StatusType
Whether the StatusTest wants iteration to stop.
Belos::StatusTest class for specifying a maximum number of iterations.
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > getChild() const
Get child test.
StatusTestUserOutput(const Teuchos::RCP< OutputManager< ScalarType > > &printer, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test, Teuchos::RCP< std::map< std::string, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > > > taggedTests, int mod=1, int printStates=Passed)
Constructor.
const std::vector< int > getLSIndex() const
(Zero-based) indices of the linear system(s) currently being solved.
std::vector< Teuchos::RCP< StatusTest< ScalarType, MV, OP > > > resTestVec_
Vector of residual status tests.
Teuchos::RCP< const MV > getRHS() const
A pointer to the right-hand side B.
An abstract class of StatusTest for stopping criteria using residual norms.
Teuchos::RCP< StatusTestMaxIters< ScalarType, MV, OP > > iterTest_
MultiVecTraits< ScalarType, MV > MVT
virtual int getBlockSize() const =0
Get the blocksize to be used by the iterative solver in solving this linear problem.
A pure virtual class for defining the status tests for the Belos iterative solvers.
void setOutputManager(const Teuchos::RCP< OutputManager< ScalarType > > &printer)
Set the output manager.
st_vector getStatusTests()
Return the vector of status tests.
virtual ~StatusTestUserOutput()
Destructor.
A class for extending the status testing capabilities of Belos via logical combinations.
StatusType checkStatus(Iteration< ScalarType, MV, OP > *solver)
void setChild(Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test)
Set child test, which must be a combination of a Belos::StatusTestMaxIters AND a combination of Belos...
virtual const LinearProblem< ScalarType, MV, OP > & getProblem() const =0
Get a constant reference to the linear problem.
StatusType getStatus() const
Return the result of the most recent checkStatus call, or undefined if it has not been run.
Collection of types and exceptions used within the Belos solvers.
std::vector< int > currIdx_
void setOutputFrequency(int mod)
Set how often the child test is printed.
A virtual base class for StatusTest that print other status tests.
Pure virtual base class which describes the basic interface to the linear solver iteration.
void setPrecondDesc(const std::string &precondDesc)
Set a short preconditioner description for output clarity.
Teuchos::RCP< std::map< std::string, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > > > taggedTests_
Traits class which defines basic operations on multivectors.
Belos::StatusTestCombo< ScalarType, MV, OP > StatusTestCombo_t
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Belos::StatusTest for logically combining several status tests.
void print(std::ostream &os, int indent=0) const
Output formatted description of stopping test to output stream.
Belos::StatusTestMaxIters< ScalarType, MV, OP > StatusTestMaxIters_t
Belos::StatusTestResNorm< ScalarType, MV, OP > StatusTestResNorm_t
ComboType getComboType() const
Return the type of combination (OR, AND, or SEQ).