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{Spectral basis management}
18
19\subsection{The {\classtitle SpectralBasis} class}
20
21For spectral finite elements, the basis is defined by a finite set of functions globally defined over a geometric domain. The {\class SpectralBasis} class is devoted to this set of functions over a spectral space. This class is defined as follows:
22
23\vspace{0.1cm}
24\begin{lstlisting}
25class SpectralBasis
26{
27  protected :
28    Number numberOfFun_;        //!< number of function in the basis
29    Number dimFun_;             //!< dimension of the spectral functions
30    const Domain* domain_;      //!< geometric domain support
31    ValueType returnedType_;    //!< type of returned value (one among _real, _complex)
32    StrucType returnedStruct_;  //!< structure of returned value (one among _scalar, _vector)
33    FuncFormType funcFormType_; //!< type of basis functions (_analytical,_interpolated)
34};
35\end{lstlisting}
36\vspace{0.1cm}
37
38The {\class SpectralBasis} class provides:
39\begin{itemize}
40\item One constructor
41\vspace{0.1cm}
42\begin{lstlisting}[]
43SpectralBasis(Number n, Number d, const Domain& g, ValueType r = _real, StrucType s = _scalar);
44\end{lstlisting}
45\vspace{0.1cm}
46\item Some accessors
47\vspace{0.1cm}
48\begin{lstlisting}[]
49Number numberOfFun() const;
50Dimen dimFun() const;
51Number dimSpace() const;
52FuncFormType funcFormType() const;
53\end{lstlisting}
54\vspace{0.1cm}
55\item some functions about the basis functions :
56\vspace{0.1cm}
57\begin{lstlisting}[]
58virtual Function& functions(); //!< return basis function object (only for SpectralBasisFun)
59template<typename T>
60T& functions(Number, const Point&, T&); //!< compute n-th function
61template<typename T>
62Vector<T>& functions(const Point& P, Vector<T>& res); //!< compute all functions
63\end{lstlisting}
64\vspace{0.1cm}
65\item some print functions
66\vspace{0.1cm}
67\begin{lstlisting}[]
68virtual void print(std::ostream&) const = 0;
69\end{lstlisting}
70\vspace{0.1cm}
71\end{itemize}
72
73As you may have noticed, the {\class SpectralBasis} class is an abstract class. Indeed, a spectral basis can be defined with an analytical expression or by a set of interpolate functions. That is why the {\class SpectralBasis} class has 2 childs : {\class SpectralBasisFun} and {\class SpectralBasisInt}.
74
75\subsection{The {\classtitle SpectralBasisFun} class}
76
77The {\class SpectralBasisFun} class is dedicated to a spectral basis defined with an analytical expression, namely a {\class Function} object.
78\vspace{0.1cm}
79\begin{lstlisting}
80class SpectralBasisFun : public SpectralBasis
81{
82  protected :
83    Function functions_;
84  public :
85    SpectralBasisFun(Domain&, Function&, Number, Number); //!< constructor
86};
87\end{lstlisting}
88\vspace{0.1cm}
89
90\subsection{The {\classtitle SpectralBasisInt} class}
91
92The {\class SpectralBasisInt} class is dedicated to a spectral basis defined by a set of interpolate functions, namely a set of {\class TermVector} objects:
93\vspace{0.1cm}
94\begin{lstlisting}
95class SpectralBasisInt : public SpectralBasis
96{
97  protected :
98    std::vector<TermVector*> functions_;
99  public :
100    SpectralBasisInt(Domain&, Number, Number);  //!< constructor
101};
102\end{lstlisting}
103\vspace{0.1cm}
104
105\displayInfos{library=space, header=SpectralBasis.hpp, implementation=SpectralBasis.cpp, test=test\_Space.cpp,
106header dep={config.h, utils.h, geometry.h}}
107