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 17When the {\bf structured mesh generator} is chosen (mg = {\tt\_structured}), one can create a mesh of order~1: 18\begin{itemize} 19\item of a segment, 20\item of a parallelogram with triangles or quadrangles, 21\item of a parallelepiped with hexahedra, prisms or pyramids. 22\end{itemize} 23One has to declare an object of type {\class Geometry}, more precisely of one of its derived type {\class Segment}, {\class Parallelogram}, {\class Rectangle}, {\class Square}, {\class Parallelepiped}, {\class Cuboid} or {\class Cube} using one of these constructors, that allow in particular to specifiy the mesh refinement by setting the number of points (nodes) on each edge, including the two endpoints. 24 25\medskip 26 27Example 1. 28 29\begin{lstlisting} 30Strings sn(2); 31sn[0] = "Sigma_1"; 32Mesh mesh1dP1(Segment(_xmin=0, _xmax=1, _nnodes=11, _side_names=sn), 1, _structured, "P1 mesh of [0,1], step=0.1"); 33\end{lstlisting} 34This builds a mesh of the interval $[0,1]$ with 10 subintervals. The boundary domain Sigma\_1, corresponding to the lower bound $0$ of the interval, will be created ; the other one will not be created since it has no name. The second argument is the mesh order ; in the case of a structured mesh, the only possible value is 1. 35\par 36It can be noticed that the segment may have been defined by two points in the plane or in the space as well. 37 38\medskip 39 40Example 2. 41 42\begin{lstlisting} 43Strings sn(4); 44sn[0] = "Gamma_1"; sn[2] = "Gamma_2"; 45Mesh mesh2dP1(Rectangle(_xmin=0, _xmax=1, _ymin=1, _ymax=3, _nnodes=Numbers(3, 5), _side_names=sn), _triangle, 1, _structured, "P1 mesh of [0,1]x[1,3]"); 46\end{lstlisting} 47This builds a mesh of the rectangle $[0,1]\times[1,3]$ with triangles. The interval $[0,1]$ is subdivided into 2 subintervals; the interval $[1,3]$ is subdivided into 4 subintervals. Only the two domains Gamma\_1 and Gamma\_2 will be created. 48For a rectangle $[a,b]\times[c,d]$, the correspondence of the sidenames is the following:\par 49sideNames[0] is $[a,b]\times{c}$, sideNames[1] is ${b}\times[c,d]$,\par 50sideNames[2] is $[a,b]\times{d}$, sideNames[3] is ${a}\times[c,d]$. 51 52\medskip 53 54Example 3. 55 56\begin{lstlisting} 57Strings sn(4); 58sn[0] = "Sigma_1"; sn[1] = "Sigma_2"; 59Mesh mesh2dQ1(Rectangle(_xmin=1, _xmax=2, _ymin=1, _ymax=3, _nnodes=Numbers(3, 5), _side_names=sn), _quadrangle, 1, _structured, "Q1 mesh of [1,2]x[1,3]"); 60\end{lstlisting} 61This builds a mesh of the rectangle $[1,2]\times[1,3]$ with quadrangles. Only the two domains Sigma\_1 and Sigma\_2 will be created. 62See example 2 for other commentaries. 63 64\medskip 65 66Example 4. 67 68\begin{lstlisting} 69Strings sn( "z=1", "z=5", "y=1", "y=3", "x=0", "x=1"); 70Mesh mesh3dQ1(Cuboid(_xmin=0, _xmax=1, _ymin=1, _ymax=3, _zmin=1, _zmax=5, _nnodes=Numbers(3, 5, 9), _side_names=sn), _hexahedron, 1, _structured, "Q1 mesh of [0,1]x[1,3]x[1,5]"); 71\end{lstlisting} 72This builds a mesh of the parallelepiped $[0,1]\times[1,3]\times[1,5]$ with hexahedra. The interval $[0,1]$ is subdivided into 2 subintervals ; the interval $[1,3]$ is subdivided into 4 subintervals ; the interval $[1,5]$ is subdivided into 8 subintervals. The 6 boundary domains will be created with their corresponding names. 73For a parallelepiped $[a,b]\times[c,d]\times[e,f]$, the correspondence of the sidenames is the following:\par 74 sideNames[0] is $[a,b]\times[c,d]\times{e}$, sideNames[1] is $[a,b]\times[c,d]\times{f}$,\par 75 sideNames[2] is $[a,b]\times{c}\times[e,f]$, sideNames[3] is $[a,b]\times{d}\times[e,f]$,\par 76 sideNames[4] is ${a}\times[c,d]\times[e,f]$, sideNames[5] is ${b}\times[c,d]\times[e,f]$. 77