Difference between vector.getArray() and x.array

The .vector wraps the .x as an petsc array.
The .x.array lists all values on the process (including ghosts), while vector does not show have the ghost values available.

Internally in dolfinx, the access to ghost values is crucial for easy parallel access of data.
Dolfinx provides the wrapper to petsc such that one can easily interface with the petsc4py interface.

2 Likes