Mesh handling

In this section of the tutorial the user can learn how to generate, read and partition meshes for their use in the library. Although LifeV currently supports several mesh formats (medit, netgen, gmsh, etc.), for the time being in these tutorial we focus only on the medit format. A mesh in medit format has the extension *.mesh. To generate meshes, the developers of the LifeV library mostly use the open-source software gmsh. Please refer to the documentation of gmsh for detailed instructions about mesh generation. The mesh file generated using gmsh needs some additional pre-processing before it is actually ready to be used by LifeV: in fact, we need to convert it from the gmsh (whose extension is .msh) to the medit mesh format trough a python script. Once the mesh is ready it can be loaded by LifeV to carry out finite-element computations.

We notice that the mesh generated can be loaded (i) as a whole (meaning not partitioned) or (ii) already partitioned. The user must pay attention to the approach to be used depending on his/her needs.

In parallel runs, the first approach involve that each MPI process reads the whole not partitioned mesh. Then, through the Parmetis library or by the Zoltan package of Trilinos, we partition the mesh allocating each local mesh subdomain to the different processes and eventually we clean from memory the not partitioned mesh.

Using the second approach the user can partition beforehand the whole computational mesh into a certain number of subdomains, save them to file and then, when launching the parallel computation each MPI process will load his own local mesh subdomain.

When running simulations on parallel machines using large meshes (say, meshes comprised by millions of elements), we highly recommend to partition the mesh offline.

  1. Basics of mesh generation - In this tutorial we generate the mesh of a cube using gmsh and we convert it to the medit format
  2. Read a mesh - In this tutorial the user can learn how to read a mesh in LifeV
  3. Mesh partitioning - In this tutorial we show how to partition a mesh
  4. Offline mesh partitioning - In this tutorial we show how to partition and save to file a mesh partitioned