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
17As an alternative to mesh an extruded geometry, it is possible to extrude a 1D or a 2D mesh using the following mesh constructor:
18
19\begin{lstlisting}
20Mesh(const Mesh& ms, const Point& O, const Point& D , number_t nbl,
21number_t namingDomain=0, number_t namingSection=0, number_t namingSide=0,
22const string_t& meshName="");
23\end{lstlisting}
24where $\vec{OD}$ defines the direction of extrusion and  $nbl$ the number of layers of same width (regular extrusion). More precisely, any point $M$ of the section mesh is extruded in $nbl$ points :
25$$M_k=M + O +k*\vec{OD}.$$
26When a 1D section, extruded mesh is made with quadrangles. When a 2D triangular mesh section, extruded mesh is made with prisms and  when a 2D quadrangular mesh section, extruded mesh is made with hexahedra.\\
27
28The boundary domains created by the extrusion process come from the boundary domains of the original section. This process is controlled by the 3 parameters {\var namingDomain}, {\var namingSection}, {\var namingSide} taking one of of the values 0, 1 or 2, with the following rules:\\
29
30\mbox{}\hspace{0.2cm}$\bullet$ 0 : domains are not created \\
31\mbox{}\hspace{0.2cm}$\bullet$ 1 : one extruded domain is created for any domain of the original section \\
32\mbox{}\hspace{0.2cm}$\bullet$ 2 : for each layer, one extruded domain is created for any domain of the original section \\
33\\
34Be cautious, the side domains of extruded domain are created from side domains of the given section. Thus, if the given section has no side domains, the extruded domains will have no side domains! The naming convention is the following:\\
35
36\mbox{}\hspace{0.2cm}$\bullet$ Domains and side domains keep their name with the extension "\_e"  or "\_e1", "\_e2", ..., "\_en" \\
37\mbox{}\hspace{0.2cm}$\bullet$ Section domains have the name of original domains with the extension "\_0",...,"\_n"  \\
38\mbox{}\hspace{0.2cm}$\bullet$ When {\var namingDomain=0}, the full domain is always created and named "Omega".\\
39
40The following figure illustrates the naming rules of domains.
41\begin{figure}[H]
42\begin{center}
43\includePict[scale=0.5]{mesh_extrusion.png}
44\end{center}
45\caption{Mesh extrusion, domains naming}
46\label{mesh_extrusion_domain}
47\end{figure}
48
49For instance, to mesh a tubular domain using the mesh extrusion of a crown:
50
51\begin{lstlisting}
52Disk dext(_center=Point(0.,0.), _radius=1.,_nnodes=20, _domain_name="Omega",
53          _side_names="Sigma");
54Disk dint(_center=Point(0.,0.), _radius=0.5,_nnodes=10,_side_names="Gamma");
55Mesh crown(dext-dint,_triangle,1,_gmsh);
56Mesh tube(crown,Point(0,0,0),Point(0,0,1),10,1,1,1);
57\end{lstlisting}
58\begin{figure}[H]
59\begin{center}
60\includePict[scale=0.3]{crown_extrude.png}
61\end{center}
62\caption{Tube prismatic mesh from extrusion of a crown mesh}
63\label{mesh_extrusion_crown}
64\end{figure}
65
66