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\section{The {\classtitle Interpolation} class}
18
19The purpose of the {\class Interpolation} class is to store data related to finite element
20interpolation. It concerns only general description of an interpolation: type of the finite
21element interpolation (Lagrange, Hermite, ...), a subtype among standard, Gauss-Lobatto (only
22for Lagrange) and first or second family (only for Nedelec), the "order" of the interpolation
23for Lagrange family and the space conformity (L2,H1,Hdiv,...). For instance, a Lagrange standard
24P1 with H1 conforming is the classic P1 Lagrange interpolation but a Lagrange standard P1 with
25L2 conforming means a discontinuous interpolation (like Galerkin discontinuous approximation)
26where the vertices of an element are not shared. For the moment, this class is only intended
27to support the following choices:
28\begin{center}
29\begin{tabular}{|l|l|l|}
30  \hline
31  type & subtype & order \\
32  \hline
33  Lagrange & standard, Gauss-Lobatto & any order \\
34 \hline
35  Hermite & standard &  \\
36  \hline
37  Crouzet-Raviart & standard &  order 1\\
38  \hline
39  Raviart-Thomas & standard &  any order\\
40   \hline
41  Nedelec & first or second family &  any order\\
42	\hline
43  Nedelec face & first or second family &  any order\\
44  	\hline
45  Nedelec edge & first or second family &  any order\\
46    	\hline
47\end{tabular}
48\end{center}
49\begin{remark}
50Nedelec face and Nedelec edge are specific to 3D. Nedelec face corresponds to the 2D Raviart-Thomas family and Nedelec edge corresponds to the 2D Nedelec family.
51\end{remark}\\
52
53\begin{remark}
54The {\class Interpolation} class  is intended to support a lot of finite element family but all are not available. See  child classes of {\class RefElement} class to know which families are actually available.
55\end{remark}
56
57This class is mainly used with the {\class GeomElement} class (definition of the geometric
58transformation) and the {\class Space} class (definition of the finite element approximation
59related to the discretized space).\\
60
61The class {\class Interpolation} has the following attributes:
62\vspace{.2cm}
63\begin{lstlisting}
64class Interpolation
65{private:
66   const FEType type_;       //!interpolation type
67   const FESubType subtype_; //!interpolation subtype
68   const number_t numtype_;  //!additionnal number type (degree for Lagrange)
69   SobolevType conformSpace_;//!conforming space
70   bool isoparametric_;      //!isoparametric flag
71   bool isoparametric_;      //!isoparametric flag
72   String name_;             //!name of the interpolation type
73   String subname_;          //!interpolation sub_name
74...
75};
76\end{lstlisting}
77\vspace{.2cm}
78\textbf{FEType}, \textbf{FESubType} and \textbf{SpaceType} are enumerations defined in the
79\emph{config.hpp}  file as follow:
80\vspace{.2cm}
81\begin{lstlisting}[]{}
82enum SobolevType{L2=0,H1,Hdiv,Hcurl,Hrot=Hcurl,H2,Hinf};
83enum FEType     {Lagrange,Hermite,CrouzeixRaviart,Nedelec,RaviartThomas, NedelecFace, NedelecEdge};
84enum FESubType  {standard=0,gaussLobatto,firstFamily,secondFamily};
85\end{lstlisting}
86\vspace{.2cm}
87
88In addition, there are a static attribute to manage a unique list of instanciated {\class Interpolation}
89objects.
90\vspace{.2cm}
91\begin{lstlisting}[]{}
92static std::vector<Interpolation*> theInterpolations;
93\end{lstlisting}
94\vspace{.2cm}
95This class proposes some access member functions and  functions returning some interpolation
96properties:
97\vspace{.2cm}
98\begin{lstlisting}[]{}
99FEType type() const {return type_;}
100FESubType subtype() const {return subtype_;}
101number_t numtype() const {return numtype_;}
102SobolevType conformSpace() const {return conformSpace_; }
103String name() const {return name_;}
104String subName() const {return subname_;}
105String conformSpaceName() const;
106bool isIsoparametric() const {return isoparametric_;}
107void isIsoparametric(bool is) {isoparametric_ = is;}
108bool isContinuous();
109bool areDofsAllScalar();
110number_t maximumDegree();
111\end{lstlisting}
112\vspace{.2cm}
113some error member functions:
114\vspace{.2cm}
115\begin{lstlisting}[]{}
116void badType() const;
117void badSubType() const;
118void badSpace() const;
119void badType(const number_t) const;
120void badSubType(const number_t) const;
121void badDegree(const number_t) const;
122\end{lstlisting}
123\vspace{.2cm}
124There is only one explicit constructor (no copy constructor):
125\vspace{.2cm}
126\begin{lstlisting}[]{}
127Interpolation(FEType, FESubType, number_t, SobolevType);
128\end{lstlisting}
129\vspace{.2cm}
130that initializes the attributes and add the created object in the static list \textbf{theInterpolations}.
131\\
132
133The process creating a {\class Interpolation} object is governed by other classes (in particular
134the {\class Space} class) using the function:
135\vspace{.2cm}
136\begin{lstlisting}[]{}
137Interpolation* findInterpolation(FEType, FESubType, number_t, SpaceType);
138Interpolation& interpolation(FEType, FESubType, number_t, SobolevType);
139\end{lstlisting}
140\vspace{.2cm}
141These functions try to find an existing {\class Interpolation} object corresponding to the given
142parameters, if it does not exist one, a new object is created by calling the constructor.\\
143
144It is possible to work with a collection of {\class Interpolation} objects that are handles as a vector by the {\class Interpolations} class (see the definition of {\class PCollection}). It may be used as following:
145\vspace{.1cm}
146\begin{lstlisting}[]
147Interpolations ints(3);
148for(Number i=1;i<=3;i++) ints(i)=interpolation(Lagrange,_standard,i,H1);
149\end{lstlisting}
150\displayInfos{library=finiteElements, header=Interpolation.hpp, implementation=Interpolation.cpp,
151test=test\_Interpolation.cpp, header dep={config.h, utils.h}}
152
153