Dear Chen,

Bruno pointed you to the exact example that I was going to. It is certainly 
possible to use linear operators as preconditioners for solvers.

It looks like support for TrilinosWrappers::SolverDirect has not yet been 
implemented:
https://github.com/dealii/dealii/blob/master/tests/lac/linear_operator_10.cc#L371-L414
 
<https://github.com/dealii/dealii/blob/master/tests/lac/linear_operator_10.cc#L371-L414>
I cannot recall what the reason was — maybe the class is simply missing some 
functions that are defined for the iterative solvers?

As for one of your early questions which Bruno did already answer: I must admit 
that I do not know if the PETSc linear algebra is compatible with linear 
operators. We had to write a special TrilinosPayload 
<https://dealii.org/current/doxygen/deal.II/classTrilinosWrappers_1_1internal_1_1LinearOperatorImplementation_1_1TrilinosPayload.html>
 for the Trilinos linear algebra classes in order for them to work correctly 
(with the Trilinos solvers, at least), and such a wrapper doesn’t exist for 
PETSc. But maybe it works just fine if you stick to the deal.II solvers? If you 
try this out, it would be interesting to know if it works or not.

Best,
J-P

> On 19. Apr 2022, at 17:27, Bruno Turcksin <[email protected]> wrote:
> 
> Chen,
> 
> I am not sure if TrilinosWrappers::SolverDirect is supported but for your 
> second point, you can use the linear_operator as a preconditioner. That's 
> exactly what's done here 
> <https://github.com/dealii/dealii/blob/master/tests/lac/step-40-linear_operator_06.cc#L220-L251>
>  for example. The preconditioner is wrapped in a LinearOperator and this 
> LinearOperator is then used as preconditioner.
> 
> Best,
> 
> Bruno
> 
> On Tuesday, April 19, 2022 at 10:39:17 AM UTC-4 [email protected] 
> <http://gmail.com/> wrote:
> Hi everyone,
> 
> More questions:
> 1. where can I find the supported linear solver of Trilinos of 
> linear_operator? TrilinosWrappers::SolverDirect seems not to be supported by 
> the linear_operator
> 2. Does linear_operator can be a preconditioner? for example, SparseMatrix A, 
> B, C, D, E, F; Matrix G=A-B*C^{-1}*D-E^{-1}*F; So Matrix G can only represent 
> by a linear_operator, not its entity. I want to get its inverse by 
> inverse_operator using some linear solvers as: PreconditionILU prec_G(op_G); 
> const auto op_G_inv = inverse_operator(G, Solver, prec_G); But it seems that 
> the precondition of linear_operator is not supported. Is there any solution?
> 
> best 
> Chen
> 
> 在2022年4月18日星期一 UTC+8 22:07:36<[email protected] 
> <applewebdata://06BA10DC-72C9-4BF1-B789-0BF1B6391134>> 写道:
> Bruno Turcksin
> Thank you! it really helpful!
> 
> best
> chen
> 在2022年4月18日星期一 UTC+8 21:07:45<[email protected] <>> 写道:
> Chen,
> 
> Yes, LinearOperator does support Trilinos and PETSc matrices. LinearOperator 
> even supports your own matrix type as long as you define vmult and Tvmult 
> (see here 
> <https://dealii.org/current/doxygen/deal.II/group__LAOperators.html#ga6b74b7ed76e4aeea2c67c0bbb03e3e24>)
> 
> Best,
> 
> Bruno
> 
> On Monday, April 18, 2022 at 4:19:42 AM UTC-4 [email protected] <> wrote:
> Hi everyone,
> 
> When solving a block matrix system, the LinearOperator is a useful tool. My 
> question is whether the LinearOpertor supports Matrix type (the same as the 
> Vector type) like PETSCWrapper::MPI::SparseMatrix or 
> TrilinosWrapper::MPI::SparseMatrix?
> 
> Best
> Chen
> 
> -- 
> The deal.II project is located at http://www.dealii.org/ 
> <http://www.dealii.org/>
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en 
> <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] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/6ee40751-54ae-402d-903e-ae745545387bn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dealii/6ee40751-54ae-402d-903e-ae745545387bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/3CCBC467-91F0-47CB-8F49-465FE5DB49E5%40gmail.com.

Reply via email to