48 #include "Teuchos_CommandLineProcessor.hpp" 49 #include "Teuchos_StandardCatchMacros.hpp" 57 #ifdef HAVE_BELOS_TRIUTILS 58 #include "Trilinos_Util_iohb.h" 67 int main(
int argc,
char *argv[])
74 MPI_Init(&argc,&argv);
82 MPI_Comm_rank(MPI_COMM_WORLD, &MyPID);
88 std::string filename(
"mhd1280b.cua");
93 CommandLineProcessor cmdp(
false,
true);
94 cmdp.setOption(
"verbose",
"quiet",&verbose,
"Print messages and results.");
95 cmdp.setOption(
"debug",
"quiet",&verbose,
"Print messages and results.");
96 cmdp.setOption(
"filename",&filename,
"Filename for Harwell-Boeing test matrix.");
97 if (cmdp.parse(argc,argv) != CommandLineProcessor::PARSE_SUCCESSFUL) {
105 typedef std::complex<double> ST;
107 typedef std::complex<double> ST;
111 if (verbose && MyPID==0) {
112 std::cout <<
"Not compiled with std::complex support." << std::endl;
113 if (verbose && MyPID==0) {
114 std::cout <<
"End Result: TEST FAILED" << std::endl;
130 RCP<Belos::OutputManager<ST> > MyOM
136 #ifndef HAVE_BELOS_TRIUTILS 137 std::cout <<
"This test requires Triutils. Please configure with --enable-triutils." << std::endl;
151 info = readHB_newmat_double(filename.c_str(),&dim,&dim2,&nnz,&colptr,&rowind,&dvals);
152 if (info == 0 || nnz < 0) {
154 <<
"Warning reading '" << filename <<
"'" << std::endl
155 <<
"End Result: TEST FAILED" << std::endl;
162 std::vector<ST> cvals(nnz);
163 for (
int ii=0; ii<nnz; ii++) {
164 cvals[ii] = ST(dvals[ii*2],dvals[ii*2+1]);
167 RCP< MyBetterOperator<ST> > A1
172 std::vector<ScalarTraits<ST>::magnitudeType> v(blockSize);
173 RCP< MyMultiVec<ST> > ivec = rcp(
new MyMultiVec<ST>(dim,blockSize) );
174 MVT::MvNorm(*ivec,v);
180 ierr = Belos::TestMultiVecTraits<ST,MV>(MyOM,ivec);
183 MyOM->print(
Belos::Warnings,
"*** MyMultiVec<std::complex> PASSED TestMultiVecTraits()\n");
186 MyOM->print(
Belos::Warnings,
"*** MyMultiVec<std::complex> FAILED TestMultiVecTraits() ***\n\n");
190 ierr = Belos::TestOperatorTraits<ST,MV,OP>(MyOM,ivec,A2);
193 MyOM->print(
Belos::Warnings,
"*** MyOperator<std::complex> PASSED TestOperatorTraits()\n");
196 MyOM->print(
Belos::Warnings,
"*** MyOperator<std::complex> FAILED TestOperatorTraits() ***\n\n");
200 ierr = Belos::TestOperatorTraits<ST,MV,OP>(MyOM,ivec,A1);
203 MyOM->print(
Belos::Warnings,
"*** MyBetterOperator<std::complex> PASSED TestOperatorTraits()\n");
206 MyOM->print(
Belos::Warnings,
"*** MyBetterOperator<std::complex> FAILED TestOperatorTraits() ***\n\n");
221 TEUCHOS_STANDARD_CATCH_STATEMENTS(verbose, std::cerr, success);
227 return ( success ? EXIT_SUCCESS : EXIT_FAILURE );
Belos's basic output manager for sending information of select verbosity levels to the appropriate ou...
Class which manages the output and verbosity of the Belos solvers.
Traits class which defines basic operations on multivectors.
Simple example of a user's defined Belos::MultiVec class.
Alternative run-time polymorphic interface for operators.
Test routines for MultiVecTraits and OperatorTraits conformity.
Simple example of a user's defined Belos::Operator class.
Interface for multivectors used by Belos' linear solvers.
Belos header file which uses auto-configuration information to include necessary C++ headers...
Simple example of a user's defined Belos::Operator class.
int main(int argc, char *argv[])