In step58, it suggested to use iterative solver to improve performance.
And I tried gmres, but program threw error: "solver_gmres.h:676:13: error:
cannot convert ‘std::complex<double>’ to ‘double’ in assignment". My code
is as follows:
void TEST_Solver_Complex::solve() {
LogStream::Prefix p("Solve");
deallog << "Solving linear system..." << std::endl;
// SparseDirectUMFPACK direct_solver;
// solution = system_rhs;
// direct_solver.solve(system_matrix, solution);
SolverControl solver_control(std::max<std::size_t>(1000,
system_rhs.size() /
10),
1e-10 * system_rhs.l2_norm());
SolverGMRES<Vector<std::complex<double>>> solver(solver_control);
PreconditionJacobi<SparseMatrix<std::complex<double>>> preconditioner;
preconditioner.initialize(system_matrix, 1.0);
solver.solve(system_matrix, solution, system_rhs, preconditioner);
deallog << "Done." << std::endl;
}
Can anyone point out what's wrong with this code snip snippet? Thanks for
your help.
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/71e64abf-7655-4a12-ba70-521628f751aen%40googlegroups.com.