Thanks, Bruno and Jean-Paul. I will not use the TrilinosWrapper::SolverDirect in inverse_operator, replaced by an iterative solver. But Bruno, this example initializes a precondition by a matrix
preconditioner.initialize(system_matrix, data); While I can't get the entity of the matrix, I want to get the precondition directly from a linear_operator. SparseMatrix M; auto op_M = linear_operator(M); TrilinosWrapper::PreconditionILU prec_M(op_M); Or in other hands, Can I get the entity of a matrix from the linear_operator? For example: SparseMatrix A, B, C, D, E, F; linear_operator op_A, op_B, op_C, op_D, op_E, op_F; inverse_operator inv_C(op_C, solver, prec_C), inv_E(op_E, solver, prec_E); linear_operator op_G=op_A-op_B*inv_C*op_D-inv_E*op_F; Can I get the entity of matrix G by TrilinosWrapper::MPI::SparseMatrix G = op_G; or the precondition of op_G? auto prec_G = linear_operator(op_G, TrilinosWrapper::PreconditionILU); seems don't wok. Best, Chen 在2022年4月20日星期三 UTC+8 00:19:46<Jean-Paul Pelteret> 写道: > 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 > 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] 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]> 写道: >> >>> 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/ > 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/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/7023e219-44ec-4d96-932a-452f29fdb327n%40googlegroups.com.
