[petsc-users] Parallel computing in SNES
Matthew Knepley
knepley at gmail.com
Tue Dec 10 07:23:31 CST 2024
On Tue, Dec 10, 2024 at 4:32 AM David Jiawei LUO LIANG <
12431140 at mail.sustech.edu.cn> wrote:
> Hello PETSc,
>
> I want to substitute the existing nonlinear solver codes with SNES.
>
> The existing code is Parallel computing.
>
> My FormFunction and FormJacobian is attached in file Res_Jac.cpp.
>
> The global tangent matrix assembly and residual function assembly are both
> implemented by invoking user pointers.
>
> The following is the message, we can find that SNES just iterate once.
>
>
> I think the problem is input solution Vec y doesn't link to Residual Vec
> f, because my update is stored in the user variables.
> If I use
> const PetscScalar *yy;
> VecGetArrayRead(y, &yy);
> the value of yy is not identical to Vec y, because there are multi thread.
>
> So, my problem is how to assembly residual and tangent in parallel
> environment?
>
I am having trouble understanding your question.
1) Can you run with -snes_monitor -snes_converged_reason
-ksp_monitor_true_residual -ksp_converged_reason -snes_view and send the
output?
2) You have the line
VecCopy(user->gassem_ptr->G, f);
which looks like it puts the values of your G into f, so I am not sure what
the problem is.
THanks,
Matt
>
> David Jiawei LUO LIANG
>
> 南方科技大学/学生/研究生/2024
>
> 广东省深圳市南山区学苑大道1088号
>
>
--
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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!awWXPHw1GNXswCx9rANXgow3jupJ1On7I9qTmMvSDr0WuSRayb_cCkSj1qvn6spDBOJX-GVhIvjDx8-R6uqs$ <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!awWXPHw1GNXswCx9rANXgow3jupJ1On7I9qTmMvSDr0WuSRayb_cCkSj1qvn6spDBOJX-GVhIvjDx8xw7ziW$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20241210/1ceb1abf/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C30690D0 at 0F60110C.7F0A586700000000.jpg
Type: image/jpeg
Size: 67593 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20241210/1ceb1abf/attachment-0001.jpg>
More information about the petsc-users
mailing list