@@ -10,7 +10,38 @@ fundamental research, as it keeps the cycle between the elaboration of a theory
## Distributed version
We implement the Lattice-Boltzmann Method with our library to test it with a three-dimensional cellular automaton. Each cell is containing an array of 27 floats.
We implement the Lattice-Boltzmann Method with our library to test it with a three-dimensional cellular automaton. The code is almost the same as the previous example, so we focus on custom types in this example. A cell in this cellular automaton is of type of array containing 27 floats. In MPI, there is no predeclared type of array, so we need to create one. Thanks to our library, it is possible to do that with a minimum code.
We need to declare a structure specifying a cell, so `lbm_values` is a struct containing an array of 27 floats. After that, in the `main` function, we describe the structure as follows:
* there is one field (`values`),
* the first field is containing 27 values,
* we compute where is located the field `values` in the structure,
* `values` is of type `MPI_FLOAT`.
Finally, we call our library function `create_type` with the previous parameters, and it returns an `MPI_Datatype` that can be pass to the function `dispatch_context_new`.