Re: [petsc-users] VecCopy fails after VecDuplicate

2019-01-17 Thread Sajid Ali via petsc-users
Nevermind, it was my fault in thinking the error was with u_abs and not u. I switched from local array based value setting for initial conditions to VecSetValues when converting the uniprocessor example to an MPI program. While I removed VecRestoreArray and swapped u_local[*ptr] assignments with

Re: [petsc-users] VecCopy fails after VecDuplicate

2019-01-17 Thread Sajid Ali via petsc-users
As requested : [sajid@xrm free_space]$ ./ex_modify Solving a linear TS problem on 1 processor m : 256, slices : 1000.00, lambda : 1.239800e-10 [0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: Object is in wrong

Re: [petsc-users] VecCopy fails after VecDuplicate

2019-01-17 Thread Smith, Barry F. via petsc-users
It is likely the u vector that is not assembled not the u_abs; the complete error message has this information. If the monitor is called from TS then I cannot imagine how the u could possibly be unassembled. Please send the complete error message. Barry > On Jan 17, 2019, at 1:18 PM,

[petsc-users] VecCopy fails after VecDuplicate

2019-01-17 Thread Sajid Ali via petsc-users
Hi, I have the following 2 lines in a function in my code : ierr = VecDuplicate(u,_abs);CHKERRQ(ierr); ierr = VecCopy(u,u_abs);CHKERRQ(ierr); The VecCopy fails with the error message : [0]PETSC ERROR: Object is in wrong state [0]PETSC ERROR: Not for unassembled vector adding the following