# Local numbering and Global numbering in PETSc

**URL:** <https://community.freefem.org/t/local-numbering-and-global-numbering-in-petsc/1985>\
**Category:** General Discussion\
**Created:** [September 3, 2022, 7:10am UTC](https://community.freefem.org/t/local-numbering-and-global-numbering-in-petsc/1985 "2022-09-03T07:10:02Z")\
**Posts on this page:** 4\
**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:** [September 3, 2022, 7:10am UTC](https://community.freefem.org/t/local-numbering-and-global-numbering-in-petsc/1985/1 "2022-09-03T07:10:02Z")

</div>

Hello, in PETSc, my understanding is that distributed data is a local number, that is, the number reordered in each CPU, so I think that in the above code

> fespace Vh(Th, Pk);
> 
> Vh u;
> 
> u = 0:Vh. ndof - 1;
> 
> plotD(Th, u, cmm = “Local numbering”)

Where the overall number is the original number of the geometric entity defined in the grid file, and the local number is the number reordered in each CPU,

> GlobalNumbering(A, u);
> 
> plotD(Th, u, cmm = “Global numbering”)

[Local\_numbering.edp](https://community.freefem.org/uploads/short-url/ygQmt3upH4vXkN9vuhPM21dkJvf.edp) (520 Bytes)

---

<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:** [September 3, 2022, 4:04pm UTC](https://community.freefem.org/t/local-numbering-and-global-numbering-in-petsc/1985/2 "2022-09-03T16:04:07Z")

</div>

What is the question?

---

<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:** [September 4, 2022, 1:17am UTC](https://community.freefem.org/t/local-numbering-and-global-numbering-in-petsc/1985/3 "2022-09-04T01:17:56Z")

</div>

As for local number and global number, I think they are opposite. Shouldn’t the former be a global number? After grid division, it should be a global number, and the latter should not be a local number?

---

<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:** [September 4, 2022, 5:44am UTC](https://community.freefem.org/t/local-numbering-and-global-numbering-in-petsc/1985/4 "2022-09-04T05:44:57Z")

</div>

```auto
u[] = 0:Vh.ndof - 1;

```

The above can’t be global, as there is no information or numbering exchange whatsoever.

```auto
GlobalNumbering(A, u[]); // this is a global ordering as the name of the function reads

```
