[deal.II] convert linear_operator to SparseMatrix<double> or get the inverse of linear_operator

39 views
Skip to first unread message

陈敏

unread,
Apr 8, 2022, 11:33:22 PM4/8/22
to dea...@googlegroups.com
Hello team,
First, I got the linear_operator op_M(the matrix M). I want to get the inverse of M named as M_inv. Because of the difficult of inverting the M and that M is not symmetry, I used such codes to get M_inv:
SparseMatrix<double> M = op_M;
solver SolverGMRES<Vector<double>> gmres(solver_control); 
const auto M_inv = linear_operator(M, gmres, somepreconditioner);
 There are some questions on it:
  1. I don't know how to convert linear_operator to SparseMatrix<double>, the code "SparseMatrix<double> M = op_M;" get error.
  2. Whether could I get the M_inv directly by op_M using iterator method  and don't need to convert linear_operator to SparseMatrix<double>?
  3. Where I can find the support preconditioner for the iterator? it seems that the SolverGMRES don't supports the preconditoner of SparseILU<double> and SparseDirectUMFPACK. 
best regards
chen

Marco Feder

unread,
Apr 9, 2022, 4:26:52 PM4/9/22
to deal.II User Group
Hi Chen,

You can work directly with LinearOperator(s). What you need is the *inverse operator* of op_M , and you can get it by giving a Solver and a corresponding preconditioner to inverse_operator() [https://www.dealii.org/current/doxygen/deal.II/group__LAOperators.html#ga87e38fbde431397c069a88692bd24ae7], as explained in step-20. (https://www.dealii.org/current/doxygen/deal.II/step_20.html#TheLinearOperatorframeworkindealII)


Best,
Marco
Reply all
Reply to author
Forward
0 new messages