Re: [petsc-users] question on VecPointwiseMax

2018-04-19 Thread Smith, Barry F.
Ok, yes we started locking the solution so that people won't "accidentally" change values in the solution while monitoring The "proper" way to change it is to use SNESLineSearchSetPostCheck() and change the value of the third vector (the current solution) in your callback function. Could

Re: [petsc-users] question on VecPointwiseMax

2018-04-19 Thread Xiangdong
Hi Barry, I called the SNESGetSolution() through SNESMonitorSet(). I understand that it may not be effective, but I was able to change the values of iteration solution in old releases (two years ago). Was the solution vector set to read status in recent version? About the -snes_type vinewtonrsls,

Re: [petsc-users] question on VecPointwiseMax

2018-04-17 Thread Smith, Barry F.
Where are you call SNESGetSolution() from? Inside a SNES monitor routine, a SNES convergence test routine, a SNESLineSearchPostCheck() routine? The SNES linear solvers are solving the system, you really shouldn't be changing the values of the solution any time while they are doing their

Re: [petsc-users] question on VecPointwiseMax

2018-04-17 Thread Xiangdong
Hello everyone, Here are a little more information. Here is the function calls I have: SNESGetSolution(snes,&x); VecPointwiseMax(x,x,xl); Fail VecPointwiseMax(x,y,xl); Fail The error messages are"Object is in wrong state, Vec is locked read only, argument #1." It seems that the vector x retu

[petsc-users] question on VecPointwiseMax

2018-04-17 Thread Xiangdong
Hello everyone, When I call VecPointwiseMax(x,x,y) , I got an error message "object is in wrong state. Vec is locked read only, argument #1." However, In the online manual of output parameters of VecPointwiseMax, it says: http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecPointwi