//
//----------------------------------------------------------------------
+// Test the SolverSelector class.
#include "../tests.h"
#include "testmatrix.h"
names.push_back("gmres");
names.push_back("fgmres");
+ ReductionControl cont1(100, 0., 1.e-4);
+ SolverControl cont2(100, 1.e-7);
SolverSelector<VECTOR> solver;
PreconditionSSOR<SparseMatrix<double> > pre;
pre.initialize(A);
VECTOR u;
u.reinit(f);
-
- std::vector<std::string>::const_iterator name;
- for (name = names.begin(); name != names.end();++name)
- {
- solver.select(*name);
- u = 0.;
- solver.solve(A, u, f, pre);
- }
- ReductionControl cont1(100, 0., 1.e-4);
- solver.control = cont1;
+ std::vector<std::string>::const_iterator name;
+
+ solver.set_control(cont1);
for (name = names.begin(); name != names.end();++name)
{
solver.select(*name);
solver.solve(A, u, f, pre);
}
- SolverControl cont2(100, 1.e-7);
- solver.control = cont2;
+ solver.set_control(cont2);
for (name = names.begin(); name != names.end();++name)
{
solver.select(*name);
DEAL::Size 37 Unknowns 1296
DEAL:cg::Starting value 36.00
-DEAL:cg::Convergence step 14 value 0.2102
-DEAL:Bicgstab::Starting value 36.00
-DEAL:Bicgstab::Convergence step 5 value 0.2814
-DEAL:GMRES::Starting value 34.45
-DEAL:GMRES::Convergence step 13 value 0.1890
-DEAL:FGMRES::Starting value 36.00
-DEAL:FGMRES::Convergence step 13 value 0.2928
-DEAL:cg::Starting value 36.00
DEAL:cg::Convergence step 21 value 0.003095
DEAL:Bicgstab::Starting value 36.00
DEAL:Bicgstab::Convergence step 10 value 0.003158