# PETSc error of ChangeNumbering

**URL:** <https://community.freefem.org/t/petsc-error-of-changenumbering/2509>\
**Category:** General Discussion\
**Created:** [May 29, 2023, 3:51pm UTC](https://community.freefem.org/t/petsc-error-of-changenumbering/2509 "2023-05-29T15:51:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yhao](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@yhao](https://community.freefem.org/u/yhao)\
**Post date:** [May 29, 2023, 3:51pm UTC](https://community.freefem.org/t/petsc-error-of-changenumbering/2509/1 "2023-05-29T15:51:21Z")

</div>

Hi,

I am working on 3D Navier Stokes equations. I use Newton’s method. We met an error when executing ChangeNumbering from Freefem to PETSc:

```auto
Assertion fail : (ptIn->N() == ptA->_A->getDof())
	line :2946, in file PETSc-code.hpp

```

I am not sure what happened here. Could you help me out? I attach the code here.  
[ns\_3d.edp](https://community.freefem.org/uploads/short-url/xMu5XGyg8Y0XKAdCsu2xmVhRQFz.edp) (3.4 KB)  
[05.mesh.zip](https://community.freefem.org/uploads/short-url/qwT7gt21Xozg20CeV5TftEuvN9u.zip) (7.8 MB)

Thank you!

---

<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:** [May 29, 2023, 4:05pm UTC](https://community.freefem.org/t/petsc-error-of-changenumbering/2509/2 "2023-05-29T16:05:39Z")

</div>

You need to call `buildDmesh()` before you define your local `fespace` named `SpaceVector`.

---

<div class="post-metadata">

**Author:** ![yhao](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@yhao](https://community.freefem.org/u/yhao)\
**Post date:** [May 29, 2023, 6:08pm UTC](https://community.freefem.org/t/petsc-error-of-changenumbering/2509/3 "2023-05-29T18:08:20Z")

</div>

Hi prj,

Thank you so much! It is resolved!
