# feelpp_mesh_partitioner

`feelpp_mesh_partitioner` is a simple application which can generate a partitioned mesh and save it in a Feel++ specific `json+hdf5` file format. The generated mesh can then be loaded very efficiently in parallel.

## 1. Options

`feelpp_mesh_partitioner` requires some options.

 Name Description Default value `dim` dimension of the mesh 3 `shape` shape of the mesh elements Simplex `part` number of desired partitions `ifile` name or path to the mesh `ofile` output filename prefix (without extension) `odir` output directory

## 2. Examples

We are now using the `feelpp/toolboxes:latest` docker images as described in the User Manual to demonstrate `feelpp_mesh_partitioner` usage. We use the meshes in `src/feelpp/data/gmsh/primitives` in the docker image.

Starting the docker `feelpp/toolboxes:latest`
``docker run -ti -v \$HOME/feel:/feel feelpp/toolboxes:latest``

## 3. Generating a single mesh partitioning

We generate a mesh partitioned on 4 cores with the following command

``feelpp_mesh_partitioner --part 4  --ifile src/feelpp/data/gmsh/primitives/torus.geo --ofile torus``

You should have in the current directory 4 files

``````ls torus*
torus.geo  torus.h5  torus.json  torus.msh``````

Now the file `torus.json` can be loaded in a Feel++ application distributed on 4 cores.

### 3.1. Generating multiple mesh partitioning

Often we are interested in a set of partitioned meshes in order to do a speed-up study. `feelpp_mesh_partitioner` is the right tool for that. Let’s consider a set of partitions $\mathcal{P}=\{2, 4, 8, 16, 32 \}$.

``feelpp_mesh_partitioner --part 2 4 8 16 32  --ifile src/feelpp/data/gmsh/primitives/torus.geo --odir torus``

You should have in the directory `torus` (thanks to the `odir` option) 5 partitioned meshes

``````ls torus*
torus_p16.h5    torus_p2.h5    torus_p32.h5    torus_p4.h5    torus_p8.h5
torus_p16.json  torus_p2.json  torus_p32.json  torus_p4.json  torus_p8.json``````
 The mesh filenames contain the partition information.