# ChangeNumbering

**URL:** https://community.freefem.org/t/changenumbering/1771
**Category:** General Discussion
**Created:** [May 23, 2022, 3:24am UTC](https://community.freefem.org/t/changenumbering/1771 "2022-05-23T03:24:52Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)
#### Post date: [May 23, 2022, 3:24am UTC](https://community.freefem.org/t/changenumbering/1771/1 "2022-05-23T03:24:52Z")

</div>

The command

> ChangeNumbering(A, u, inPETSc, inverse = true, exchange = true);//

is because the number

> real[int] tab(10);//i=0,1,2,…,9

of FreeFem + + starts from zero, while the number of PETSc starts from one,  
so you want to switch the command?

---

<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 23, 2022, 6:26am UTC](https://community.freefem.org/t/changenumbering/1771/2 "2022-05-23T06:26:33Z")

</div>

This is not at all what the `ChangeNumbering` command is used for. Please go through this tutorial to understand what this command does: [Pierre Jolivet introduction to parallel FreeFEM part 1 - YouTube](https://www.youtube.com/watch?v=-Aw2O46V2bo).

---

<div class="post-metadata">

### Author: ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)
#### Post date: [May 25, 2022, 1:46am UTC](https://community.freefem.org/t/changenumbering/1771/3 "2022-05-25T01:46:37Z")

</div>

Hello, the video explanation is not very detailed, so I don’t quite understand the function of this command

> changeNumbering(dA, inOut, inOutPetsc, inverse = bool, exchange = bool)

---

<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 25, 2022, 5:29am UTC](https://community.freefem.org/t/changenumbering/1771/4 "2022-05-25T05:29:57Z")

</div>

Maybe this example will help [FreeFem-tutorial - Section 8 - example2.edp](http://jolivet.perso.enseeiht.fr/FreeFem-tutorial/section_8/example2.edp.html)? `ChangeNumbering` is just to go from PETSc to FreeFEM numbering back and forth. Both numbering start from 0, one is global while the other is local, that’s the only difference.

---

<div class="post-metadata">

### Author: ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)
#### Post date: [May 27, 2022, 2:35am UTC](https://community.freefem.org/t/changenumbering/1771/5 "2022-05-27T02:35:19Z")

</div>

Hello, Professor, take the solution vector u[] as an example. PETSc is the number on the global grid, and freefem++ is the number of the local grid?

---

<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 27, 2022, 5:53am UTC](https://community.freefem.org/t/changenumbering/1771/6 "2022-05-27T05:53:10Z")

</div>

No, `u[]` is in FreeFEM numbering (with overlap/duplicated unknowns) and the resulting vector is in PETSc numbering (without overlap/duplicated unknowns).

---

<div class="post-metadata">

### Author: ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)
#### Post date: [May 27, 2022, 7:54am UTC](https://community.freefem.org/t/changenumbering/1771/7 "2022-05-27T07:54:24Z")

</div>

Hello, according to your reply, will there be repeated unknowns because of ghost element? But what is ghost element?

---

<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 27, 2022, 8:05am UTC](https://community.freefem.org/t/changenumbering/1771/8 "2022-05-27T08:05:55Z")

</div>

This is explained in the screencast. These are buffer values shared among neighboring subdomains. This is very common in finite elements codes.

---

<div class="post-metadata">

### Author: ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)
#### Post date: [May 28, 2022, 1:51am UTC](https://community.freefem.org/t/changenumbering/1771/9 "2022-05-28T01:51:12Z")

</div>

In fact, the u[] of the solution is the value on the grid node, and its number is determined, equal to u[] .ndof, which does not produce repeated unknowns?

---

<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 28, 2022, 7:09am UTC](https://community.freefem.org/t/changenumbering/1771/10 "2022-05-28T07:09:58Z")

</div>

No, there are duplicated unknowns in u.
