M.diag_element(3) = 42;
Vector<double> rhs(4);
- rhs(0) = rhs(2) = 0;
- rhs(1) = rhs(3) = 0.0975;
+ rhs = 1;
Vector<double> solution (4);
bicgstab.solve (M, solution, rhs, PreconditionIdentity());
}
- for (unsigned int i=0; i<4; ++i)
- deallog << solution(i) << std::endl;
+ solution.print(deallog);
Vector<double> res (4);
M.residual (res, solution, rhs);
SparseMatrix<double> M1 (sparsity_pattern);
M1.add(1e10,M);
rhs *= 1e10;
+ solution = 0;
{
SolverControl control(100, 1.e7);
SolverBicgstab<> bicgstab(control);
bicgstab.solve (M1, solution, rhs, PreconditionIdentity());
}
-
- for (unsigned int i=0; i<4; ++i)
- deallog << solution(i) << std::endl;
-
+ solution.print(deallog);
M1.residual (res, solution, rhs);
deallog << "residual=" << res.l2_norm()
<< std::endl;
-DEAL:Bicgstab::Starting value 0.1379
-DEAL:Bicgstab::Convergence step 2 value 0
-DEAL::0
-DEAL::0.009750
-DEAL::0
-DEAL::0.002321
+DEAL:Bicgstab::Starting value 2.000
+DEAL:Bicgstab::Convergence step 4 value 0
+DEAL::1.000 0.1000 0.09091 0.02381
DEAL::residual=0
-DEAL:Bicgstab::Starting value 2.384e-07
-DEAL:Bicgstab::Convergence step 0 value 2.384e-07
-DEAL::0
-DEAL::0.009750
-DEAL::0
-DEAL::0.002321
-DEAL::residual=2.384e-07
+DEAL:Bicgstab::Starting value 2.000e+10
+DEAL:Bicgstab::Convergence step 4 value 0.001939
+DEAL::1.000 0.1000 0.09091 0.02381
+DEAL::residual=0.001937