2 #include "Thyra_BelosLinearOpWithSolveFactory.hpp"
3 #include "Thyra_LinearOpWithSolveFactoryHelpers.hpp"
4 #include "Thyra_MultiVectorStdOps.hpp"
5 #include "Thyra_VectorBase.hpp"
6 #include "Thyra_VectorStdOps.hpp"
8 #include "EpetraExt_readEpetraLinearSystem.h"
9 #include "Epetra_SerialComm.h"
29 Epetra_SerialComm comm;
31 std::string matrixFile =
"FourByFour.mtx";
32 EpetraExt::readEpetraLinearSystem( matrixFile, comm, &epetra_A );
41 lowsFactory = belosLowsFactory;
46 belosLOWSFPL.
set(
"Solver Type",
"Block GMRES");
49 belosLOWSFPL.
sublist(
"Solver Types");
52 belosLOWSFPL_solver.
sublist(
"Block GMRES");
54 belosLOWSFPL_gmres.
set(
"Maximum Iterations",
int(4));
55 belosLOWSFPL_gmres.
set(
"Convergence Tolerance",
double(1.0e-4));
56 belosLOWSFPL_gmres.
set(
"Maximum Restarts",
int(0));
57 belosLOWSFPL_gmres.
set(
"Block Size",
int(1));
58 belosLOWSFPL_gmres.
set(
"Num Blocks",
int(4));
59 belosLOWSFPL_gmres.
set(
"Output Frequency",
int(1));
60 belosLOWSFPL_gmres.
set(
"Show Maximum Residual Norm Only",
bool(
false));
62 lowsFactory->setParameterList(
Teuchos::rcp(&belosLOWSFPL,
false));
66 Thyra::initializeOp<double>(*lowsFactory,
A, nsA.
ptr());
71 Thyra::put_scalar(0.0,x.ptr());
72 Thyra::put_scalar(1.0,
f.ptr());
77 Thyra::SolveStatus<double> status = Thyra::solve<double>(*nsA,Thyra::NOTRANS,*
f,x.ptr());
79 TEST_EQUALITY(status.solveStatus, Thyra::SOLVE_STATUS_UNCONVERGED);