Reading mesh MPI

Dear forum,

I am running FreeFEM++ 4.8 version on Windows 10. I am trying to run the program in parallel. I started to study the examples available but it seems I have an error when it comes to reading existing mesh files. laplace-2d-SLEPc-complex example works perfectly fine but navier-stokes-2d-SLEPc-complex doesn’t load. In this example it seems that the reading mesh command is: loadDmesh(Th, “navier-stokes-2d”) .I also tried another file with the “classical” mesh Th=readmesh(“Mesh.msh”); and I get the same error. I attach a screenshot with the error and the way I call the file. Is there another command to read the mesh when using MPI? Thank you in advance for the help.

This is a linear stability analysis solver, you first need to run navier-stokes-2d-PETSc.edp. Did you do so?

Hello @prj

I did run navier-stokes-2d-PETSc.edp, it computes the mesh, I mean I can see the plot with the mesh but I still get an error. I attached you the error from PETSc. Also, due to the error it doesn’t save the mesh.

Maybe you don’t have write access to the folder, do you launch your terminal as an administrator?

Thank you, it seems that running it as administrator solved the problem. However I would have 2 more questions:

  1. From the PETSc file
    There is the command: saveDmesh(Th, “navier-stokes-2d”), but when the simulation ends, it doesn’t save the file. What type of file is it? Should I write something in terminal to save it?
  2. -np calls the number of the cores or the logical processors? I’m asking because I did the test on a laptop with 4 cores/8 logical cores but when I set -np 10, for example, it still works.
  1. the mesh is saved in a distributed fashion, hence the D in saveDmesh. It should create multiple .msh files, each corresponding to a specific subdomain. The naming convention is navier-stokes-2d_X_Y.msh where Y is the number of MPI ranks, and X is the MPI rank (ranging from 0 to Y).
  2. -np is the number of MPI ranks, it is independent of the number of cores or logical processors, i.e., you can oversubscribe, but it’s best to set the value to the number of logical cores.

Thank you very much for the explanations!
Is it possible to run a parallel simulation with SLEPc-complex if you already have a mesh which is not saved in a distributed fashion or which is another type than .msh? Or with MUMPS?

For example, now I already have the flow solution from another simulation which was done one a single core and the mesh but when I try to read the mesh I get the attached error (current line = 5 is the line with the readmesh command)

load “SLEPc-complex”
// READING THE MESH //

mesh Th=readmesh(“Mesh.msh”);
plot (Th, cmm=“Mesh.msh”, wait=true);

Yes, of course, it’s possible, most of the example from the distribution actually assume that you start from an initial global mesh, like what you want to do. Regarding you problem, I’m guessing it’s just a problem of I/O, probably your mesh file is not at the proper location.

The mesh is in the same directory with the .edp file. Usually it is enough to call it. I manually added the path in the .edp file and now it works.
Thank you again for your time!

load “SLEPc-complex”
// READING THE MESH //

mesh Th=readmesh(“D:\\Test\\Mesh.msh”);
plot (Th, cmm=“Mesh.msh”, wait=true);