On Sat, Oct 10, 2020 at 5:31 AM baikadi pranay <[email protected]>
wrote:

> Hello,
> I am using the MatDuplicate routine so that I use the Jacobian matrix as a
> preconditioning matrix as well. However, I get the error "MAT_COPY_VALUES
> not allowed for unassembled matrix". The exact command I use is the
> following:
> *call MatDuplicate(jac,MAT_COPY_VALUES,prec,ierr)*
> I am attaching you the error output in a text file for your reference.
> Could you please let me know how to solve this problem?.
>

1) You should be using CHKERRQ(ierr) after the call

2) You need to assemble the matrix, MatAssemblyBegin/End(), before calling
MatDuplicate()

3) You do not need to duplicate the matrix, just pass the same matrix twice

  Thanks,

     Matt


> Thank you in advance.
> Best Regards,
> Pranay.
>
> ᐧ
>


-- 
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://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>

Reply via email to