[petsc-users] How to do a precondition in SNES flow
Matthew Knepley
knepley at gmail.com
Tue Oct 3 14:32:27 CDT 2023
On Tue, Oct 3, 2023 at 3:05 PM Gong Ding <gongding at cn.cogenda.com> wrote:
> On 2023/10/4 02:47, Matthew Knepley wrote:
>
> On Tue, Oct 3, 2023 at 1:51 PM Gong Ding <gongding at cn.cogenda.com> wrote:
>
>> Hi all,
>>
>> I'd like to do a special jacobian precondition during the snes
>> iteration, for which jacobian matrix and RHS vector must be modified
>> explicitly.
>>
>> In the SNESComputeJacobian, the preconditioner P is built after assembly
>> of jacobian matrix.
>>
>> I need to multiply P to J and RHS vector explicitly as left precondition
>> before the solve stage of J*dx = rhs.
>>
>> What you are proposing is exactly what PETSc does with left
> preconditioning, multiplies both sides by the preconditioner. What do you
> want to change?
>
> I'd like to multiply precondition matrix into jacobian matrix, and do LU
> factorization to jacobian matrix. not with iterative method. Something like
>
> Kelley, C. T. "Newton's Method in Three Precisions." *arXiv preprint
> arXiv:2307.16051* (2023).
>
> BTW: does petsc have the plan to support multi-precision?
>
1. Tim is just solving the Newton equation with LU. You can do this using
-pc_type lu
2. We do not support this kind of multi-precision. We had a plan to do
this, but no one to work on it. It does not seem to be a priority of users
so far.
Thanks,
Matt
> Thanks,
>
> Matt
>
>> However, I find that petsc evaluates function before jacobian, so P*RHS vector can not be processed at SNESComputeFunction.
>>
>> As a result, I must find a hook function after SNESComputeJacobian and before the solve stage.
>>
>> Any suggest?
>>
>> Gong Ding
>>
>>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> <http://www.cse.buffalo.edu/~knepley/>
>
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20231003/47147319/attachment-0001.html>
More information about the petsc-users
mailing list