# Call PETSc matrix operator MatDiagonalSet (…)

**URL:** https://community.freefem.org/t/call-petsc-matrix-operator-matdiagonalset/1050
**Category:** General Discussion
**Created:** [June 21, 2021, 12:41pm UTC](https://community.freefem.org/t/call-petsc-matrix-operator-matdiagonalset/1050 "2021-06-21T12:41:33Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [June 22, 2021, 3:36pm UTC](https://community.freefem.org/t/call-petsc-matrix-operator-matdiagonalset/1050/4 "2021-06-22T15:36:43Z")

</div>

> [@Copy variables between different meshes with PETSc](https://community.freefem.org/t/copy-variables-between-different-meshes-with-petsc/390):
>
> Dear Sir or Madam, I would like to use different 2 meshes with PETSc. Additionally, variables want to be copied from each other. However, as shown following codes, the direct copy, such as “v=u”, does not work. Would you please let me know how to do it? Thank you very much in advance. Best regards, Tak // $ ff-mpirun -np 4 script.edp -wg -ne load “PETSc” macro dimension()2// EOM include “macro\_ddm.idp” meshN Sh1=square(30,30,[x,y]); meshN Sh2=square(50,50,[x,y]); buildDmesh(Sh1) b…

---

_[View the full topic](https://community.freefem.org/t/call-petsc-matrix-operator-matdiagonalset/1050)._
