\subsection{Unidimensional mesh with {\tt gmsh}}
% =============================================

The simplest unidimensional mesh is a line:
\fiindex{\filesuffix{.msh} gmsh mesh}%
\fiindex{\filesuffix{.mshcad} gmsh geometry}%
\pindex{gmsh}%
\exindex{line.mshcad}%
\cindex{geometry!line}%
\myexamplenocxx{line.mshcad}%
The mesh generation command writes:
\begin{verbatim}
  gmsh -1 line.mshcad -format msh2 -o line.msh
\end{verbatim}
\pindex{msh2geo}%
\fiindex{\filesuffix{.geo} mesh}%
Then, the conversion to \filesuffix{.geo} format and the visualization:
\begin{verbatim}
  msh2geo line.msh > line.geo
  geo line
\end{verbatim}

% =============================================
\subsection{Bidimensional mesh with {\tt gmsh}}
% =============================================
\label{sec-gmsh}%
  \begin{figure}[htb]
     \mbox{} \hspace{-1cm}
     \begin{tabular}{ccc}
          \includegraphics[width=7cm]{square-gmsh-geo.pdf} &
	  \hspace{0.56cm}
          \includegraphics[width=8cm]{cube-gmsh-geo.png} &
          \stereoglasses
     \end{tabular}
     \caption{Visualization of the \code{gmsh} meshes \file{square.geo} and \file{cube.geo}.}
     \label{fig-gmsh-meshes}
  \end{figure}
We first create a \reffile{square.mshcad} file:
\cindex{geometry!square}%
\myexamplenocxx{square.mshcad}%
  This is an uniform mesh with element size \var{h} = 0.1.
  We refer to the \code{gmsh} documentation~\cite{gmsh} for the 
  complete file format description.
  Next, enter the mesh generator commands:
\begin{verbatim}
  gmsh -2 square.mshcad -format msh2 -o square.msh
\end{verbatim}
  Then, enter the translation command:
\pindex{msh2geo}%
\fiindex{\filesuffix{.geo} mesh}%
\begin{verbatim}
  msh2geo square.msh > square.geo
\end{verbatim}
  This command creates a \file{square.geo} file.
  Look at the mesh via the command:
\begin{verbatim}
  geo square
\end{verbatim}
  Remark that the domain names, defined in the .mshcad file,
  are included in the gmsh .msh input file and are
  propagated in the .geo by the format conversion.

% =============================================
\subsection{Tridimensional mesh with {\tt gmsh}}
% =============================================

First, create a \reffile{cube.mshcad} file:
\exindex{cube.mshcad}%
\cindex{geometry!cube}%
\myexamplenocxx{cube.mshcad}%
Next, enter the mesh generator commands:
\begin{verbatim}
        gmsh -3 cube.mshcad -format msh2 -o cube.msh
\end{verbatim}
Then, enter the translation command:
\begin{verbatim}
        msh2geo cube.msh > cube.geo
\end{verbatim}
This command creates a \file{cube.geo} file.
Look at the mesh via the command:
\begin{verbatim}
        geo cube
        geo cube.geo -cut
\end{verbatim}
The second command allows one to see inside the mesh.
