# Global solution with PETSc

**URL:** <https://community.freefem.org/t/global-solution-with-petsc/239>\
**Category:** General Discussion\
**Created:** [February 6, 2020, 1:23pm UTC](https://community.freefem.org/t/global-solution-with-petsc/239 "2020-02-06T13:23:18Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![jgonzalez49](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jgonzalez49](https://community.freefem.org/u/jgonzalez49)\
**Post date:** [August 7, 2020, 2:25pm UTC](https://community.freefem.org/t/global-solution-with-petsc/239/8 "2020-08-07T14:25:28Z")

</div>

That works perfectly, thank you. I’ve been reviewing the other active thread [here](https://community.freefem.org/t/saving-and-loading-global-distibuted-arrays/493) and now see that the createMat command is common to the two examples you had mentioned at the top that specifically gather the results at the end of the program.

As a followup question (maybe better moved to the below mentioned thread if more pertinent), I notice that the file output of this now matches the [description of the output files of another user](https://community.freefem.org/t/plotmpi-how-to-get-plot-display-for-parallelization-hpddm/162/5) when they were using an older version of one of the examples and generated a single PVD file and four VTU files. The suggestion you gave made use of a [revised version of that example](https://github.com/FreeFem/FreeFem-sources/commit/ba61bcbfd00e10a44e750ba15ae3f8adf540889a) which made use of the line

`export("sol_stokes_3d_io", Th, sol, orderAndName, comm);`

and it looks like that fixed the issue for them. In the [most recent version of the example](https://github.com/FreeFem/FreeFem-sources/blob/master/examples/hpddm/stokes-io-3d.edp#L92), that line has been again revised to now read:

`savevtk("stokes-io-3d.vtu", Th, [u, uB, uC], uD, order = fforder, dataname = "velocity pressure");`

Is it advisable to switch back to the earlier `export` command to create a single VTU file as the output, or is there a way to alter my current version of the code to do so?

[stokes-3d-PETScagain.edp](https://community.freefem.org/uploads/short-url/Ao5JQT5ewCCvceiHrNkwk2kIAeP.edp) (2.0 KB)

---

_[View the full topic](https://community.freefem.org/t/global-solution-with-petsc/239)._
