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号
Res_Jac.cpp
Description: Binary data