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 Element} class} 18 19A finite element is mainly defined by its geometric support and its finite element interpolation. It carries also its dof numbering. The dedicated {\class Element} class is defined as follows: 20 21\vspace{0.1cm} 22\begin{lstlisting}[deletekeywords={[3] dofNumbers}] 23class Element 24{ 25 protected: 26 FeSpace* feSpace_p; //pointer to Finite Element parent space 27 Number number_; //element number in FeSpace 28 public: 29 FeSubSpace* feSubSpace_p; //pointer to Finite Element parent sub space 30 RefElement* refElt_p; //pointer to reference element object 31 GeomElement* geomElt_p; //pointer to Geometric Element support 32 std::vector<Number> dofNumbers; //global numbering of element dofs 33 std::vector<Element*> parents_; // parent elements when a side of element 34}; 35\end{lstlisting} 36\vspace{0.1cm} 37 38The {\class Element} class provides: 39\begin{itemize} 40\item One constructor 41\vspace{0.1cm} 42\begin{lstlisting}[] 43Element(FeSpace*, Number, RefElement*, GeomElement*, FeSubspace*=0); 44\end{lstlisting} 45\vspace{0.1cm} 46\item Some accessors 47\vspace{0.1cm} 48\begin{lstlisting}[] 49Dimen dim() const; //dimension of the element 50Number number() const; //return number_ attribute 51ShapeType shapeType() const; //shape of the element 52FEType feType() const; //FE type ( _Lagrange, _Hermite, ...) 53Number feOrder() const; //FE numtype (order for Lagrange) 54Dimen dimFun() const; //dimension of shape functions 55\end{lstlisting} 56\vspace{0.1cm} 57\item a dofs renumbering function and a tool to get index of dof 58\vspace{0.1cm} 59\begin{lstlisting}[] 60void dofsRenumbered(const std::vector<Number>&, std::vector<FeDof>&); 61number_t refDofNumber(number_t) const; 62\end{lstlisting} 63\vspace{0.1cm} 64\item some utilities to compute normal vectors at a physical point and to access to: 65\vspace{0.1cm} 66\begin{lstlisting}[] 67ShapeValues computeShapeValues(const Point&, bool withderivative = false) const; 68Vector<real_t> computeNormalVector(const Point&) const; 69Vector<real_t> computeNormalVector() const; 70const Vector<real_t>& normalVector() const; 71Vector<real_t>& normalVector(); 72\end{lstlisting} 73\vspace{0.1cm} 74\item some interpolation tools: 75\vspace{0.1cm} 76\begin{lstlisting}[] 77Point toReferenceSpace(const Point& p) const; // physical to reference space 78template<typename T> 79 T& interpolate(const Vector<T>&, const Point&, const std::vector<number_t>&, 80 T&, DiffOpType =_id) const; 81template<typename T> 82 Vector<T>& interpolate(const Vector<T>&, const Point&, 83 const std::vector<number_t>&, Vector<T>&, 84 DiffOpType =_id) const; 85template<typename T> 86 T& interpolate(const Vector<Vector<T> >&, const Point&, 87 const std::vector<number_t>&, T&, 88 DiffOpType = _id)const; 89template<typename T> 90 T& interpolate(const VectorEntry&, const Point&, 91 const std::vector<number_t>&, T&, 92 DiffOpType =_id)const; 93\end{lstlisting} 94\vspace{0.1cm} 95\begin{remark} 96Interpolation tools are useful when evaluating an element of FE space at a given point, say $P$. It is an expansive process requiring to locate the element containing the point $P$, to get its location in reference space (inverse map) to apply local interpolation. The previous {\var interpolate} functions are not concerned by the localization of element containing $P$, they only compute local interpolation. 97\end{remark} 98\item a function dedicated to split a finite element in first order finite elements 99\vspace{0.1cm} 100\begin{lstlisting}[deletekeywords={[3] map}] 101std::vector<std::pair<ShapeType, std::vector<Number> > > 102 splitO1(std::map<Number,Number>* renumbering) const; 103\end{lstlisting} 104\vspace{0.1cm} 105\item some print functions 106\vspace{0.1cm} 107\begin{lstlisting}[] 108void print(std::ostream&) const; //!< print utility 109friend std::ostream& operator<<(std::ostream&, const Element&); 110\end{lstlisting} 111\vspace{0.1cm} 112\end{itemize} 113 114\displayInfos{library=space, header=Element.hpp, implementation=Element.cpp, test=test\_Space.cpp, 115header dep={config.h, utils.h, finiteElements.h, geometry.h, Dof.hpp, SpectralBasis.hpp}} 116