[petsc-users] Parallel computing in SNES

David Jiawei LUO LIANG 12431140 at mail.sustech.edu.cn
Tue Dec 10 03:31:43 CST 2024


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?








David Jiawei LUO LIANG



南方科技大学/学生/研究生/2024



广东省深圳市南山区学苑大道1088号




 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20241210/f193dbb9/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/f193dbb9/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Res_Jac.cpp
Type: application/octet-stream
Size: 4488 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20241210/f193dbb9/attachment-0001.obj>


More information about the petsc-users mailing list