# Reset the Dirichelet boundary condition

**URL:** <https://community.freefem.org/t/reset-the-dirichelet-boundary-condition/1104>\
**Category:** General Discussion\
**Created:** [July 19, 2021, 10:45am UTC](https://community.freefem.org/t/reset-the-dirichelet-boundary-condition/1104 "2021-07-19T10:45:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [July 19, 2021, 10:45am UTC](https://community.freefem.org/t/reset-the-dirichelet-boundary-condition/1104/1 "2021-07-19T10:45:45Z")

</div>

Dear all,

Is the an example about resetting the Dirichlet boundary condition after modifying a PETSc matrix?

For example,

Mat A;  
A=a(Vh, Vh, tgv=-1);  
rhs=a(0,Vh, tgv=-1);  
**a modification of A and rhs;**

We then need to reset the locking conditions in A and rhs.

Best,  
Yongxing.

---

<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:** [July 19, 2021, 3:17pm UTC](https://community.freefem.org/t/reset-the-dirichelet-boundary-condition/1104/2 "2021-07-19T15:17:47Z")

</div>

No, you need to copy the matrix before you modify it if you need the conditions back in afterwards.
