Meshgen is a modest mesh generator for cartesian grid. The principle is very simple :
After downloading the Meshgen project from the server forge by means of svn (svn co –username your_login https://forge.limsi.fr/svn/MESHGEN/TRUNK)
The grid parameters are set in the input data file “data_meshgen.dat”. A simple example of a 2D grid is given here:
In the data file, each block of data is attributed to a direction (I,J or K).
Each direction can be split in several parts (segments) on which a specific distribution law is applied in order to place the discrete nodes.
Each distribution law is defined by means of namelists that are described at the end of this page.
For illustrating how that works, let consider a domain length $L$ (in an arbitrary direction) split in $2$ parts with lengths $L_1$ and $L_2$, respectively (see the figure below). Discrete coordinates are distributed with a given law (by considering here $N_1=6$ for the first segment, $N_2=8$ for the second one).
The origin coordinate is not included in the procedure. It is added by the code.
The coordinate located at the upper end of the segment belongs to this segment, not to the following one.
The available distribution functions are (click on function name to get details):
These functions get some parameters :
A template is provided here.
The block of data must be closed with the special namelist
&MESH_FUNCTION_DATA End_of_Data_Block = .true./
After setting the data set in the file “data_meshgen.dat”, run the command “meshgen.x”.
Few questions are asked :
For the case of MPI domain decomposition, further information is required to perform the appropriate domain decomposition
The grid data are recorded in the appropriate files that depend on the code previously selected:
For checking the grid features, a specific file named “report_meshgen.d” is created in which relevant data about the grid characteristics can be read.
Three other files named “check_mesh_I.d”, “check_mesh_J.d” and “check_mesh_K.d” are created. They are similar to “maillx.d”, “mailly.d” and “maillz.d” (see above). A 3rd column of data is associated to the cell size.