1%%%%%%%%%%%%%%%%%%%
2% XLiFE++ is an extended library of finite elements written in C++
3%     Copyright (C) 2014  Lunéville, Eric; Kielbasiewicz, Nicolas; Lafranche, Yvon; Nguyen, Manh-Ha; Chambeyron, Colin
4%
5%     This program is free software: you can redistribute it and/or modify
6%     it under the terms of the GNU General Public License as published by
7%     the Free Software Foundation, either version 3 of the License, or
8%     (at your option) any later version.
9%     This program is distributed in the hope that it will be useful,
10%     but WITHOUT ANY WARRANTY; without even the implied warranty of
11%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12%     GNU General Public License for more details.
13%     You should have received a copy of the GNU General Public License
14%     along with this program.  If not, see <http://www.gnu.org/licenses/>.
15%%%%%%%%%%%%%%%%%%%
16
17\xlifepp allows you to read various mesh file formats. The constructor to use is defined as follows:
18\vspace{.2cm}
19\begin{lstlisting}[frame=none]
20//! constructor from a file
21Mesh (const String& filename, const String& meshname, IOFormat mft, Number nodesDim);
22\end{lstlisting}
23
24The arguments are:
25\begin{description}
26\item[\tt filename] is the name of the mesh file,
27\item[\tt meshname] is the name of the mesh, for log purpose, Default value is empty string.
28\item[\tt mft] defines the mesh format. It can take four values as we can see on the examples hereafter.
29\item[\tt nodesDim] defines minimal number of coordinates of each vertex. Default is 0 for automatic behavior. Normally, you should not have to use this argument.
30\end{description}
31
32\begin{lstlisting}
33// loading a VTK mesh file
34Mesh m1("mesh.vtk", "My Mesh M1", vtk);
35// loading a VTU mesh file
36Mesh m2("mesh.vtu", "My Mesh M2", vtu);
37// loading a GMSH mesh file
38Mesh m3("mesh.msh", "My Mesh M3", msh);
39// loading a GMSH script file
40Mesh m4("mesh.geo", "My Mesh M4", geo);
41// loading a MELINA mesh file
42Mesh m5("mesh.mel", "My Mesh M5", mel);
43// loading a PLY mesh file
44Mesh m6("mesh.ply", "My Mesh M6", ply);
45\end{lstlisting}
46which create six {\class Mesh} objects called m1, m2, m3, m4, m5 and m6.
47
48\begin{itemize}
49\item To have more information about the VTK and VTU file formats, please go to \url{http://www.paraview.org}
50\item The \melina file format is the input format of the \melina finite element library, ancestor of \xlifepp. For more information, please go to \url{http://anum-maths.univ-rennes1.fr/melina/danielmartin/melina/}
51\item To have more information on the PLY file format, please go to \url{http://paulbourke.net/dataformats/ply}.
52\item To have more information about \gmsh, please go to \url{http://geuz.org/gmsh/}. You will have everything you need about the msh format and about the geo scripts. \\
53\begin{remark}
54If you load a geo file, \xlifepp will call \gmsh to create the corresponding msh file, which is then read. Consequently, \gmsh needs to be installed on your computer and the executable file, called {\tt gmsh}, should be found through your PATH environment variable. If \gmsh is installed after \xlifepp, \xlifepp needs to be reinstalled.
55\end{remark}
56\end{itemize}
57
58\vspace{.2cm}
59