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{DoF management}\label{s.dof} 18 19\subsection{The {\classtitle Dof} class} 20 21Linked to the {\class Space} class, the {\class DoF} class stores characteristics of degree 22of freedom. Degree of freedom is like a key index of components of element of space. Generally, 23it handles a numeric index and carries some additional informations. For instance, in case 24of Lagrange interpolation it carries the geometrical point associated to the basis function. 25From {\class DoF} class inherit the classes {\class FeDoF} and {\class SpDoF}. 26\vspace{.1cm} 27\begin{lstlisting} 28class Dof 29{protected : 30 number_t id_; //id of dof 31 DofType doftype_; //type of dof 32 public : 33 Dof(DofType t=_otherDof, number_t i=0); 34 virtual~Dof(){}; 35 DofType dofType()const; 36 number_t id() const; 37 number_t& id(); 38 virtual void print(std::ostream&) const; 39 friend std::ostream& operator<<(std::ostream&, const Dof &); 40}; 41\end{lstlisting} 42\vspace{.2cm} 43The type of DoF are enumerated by 44\vspace{.1cm} 45\begin{lstlisting}[] 46enum DofType {_feDof,_spDof,_otherDof}; 47\end{lstlisting} 48\vspace{.2cm} 49 50\subsection{{\classtitle FeDof} and {\classtitle SpDof} classes} 51 52Inherited classes are very simple: 53\vspace{.1cm} 54\begin{lstlisting} 55class FeDof: public Dof 56{protected : 57 FeSpace* space_p; // pointer to FeSpace 58 const RefDof* refDof_p; // pointer to a Reference D.o.F 59 bool shared_; // implies D.o.F is shared between elements 60 Vector<Real> derVector_; // direction vector(s) of a derivative D.o.F (specific interpolation) 61 Vector<Real> projVector_; // direction vector(s) of a projection D.o.F (specific interpolation) 62 std::vector<std::pair<Element*, Number> > inElements; // list of elements related to Dof and local number of dof in elements 63 public : 64 FeDof(); 65 FeDof(FeSpace& sp, number_t i=0) 66 virtual void print(std::ostream&) const; 67}; 68\end{lstlisting} 69\vspace{.2cm} 70\begin{lstlisting} 71class SpDof : public Dof 72{protected : 73 SpSpace * space_p; //pointer to SpSpace 74public : 75 SpDof() 76 SpDof(SpSpace& sp, number_t i) 77 virtual void print(std::ostream&) const; 78}; 79\end{lstlisting} 80\vspace{.2cm} 81 82\displayInfos{library=space, header=DoF.hpp, implementation=DoF.cpp, test=test\_Space.cpp, 83header dep={config.h, utils.h}} 84 85\subsection{The {\classtitle DofComponent} class} 86 87This class defined an extended representation of dof, useful to adress components of a vector dof: 88\vspace{.1cm} 89\begin{lstlisting} 90class DofComponent 91{ 92public : 93 const Unknown* u_p; //unknown 94 Number dofnum; //dof number 95 Dimen numc; //component 96 97 DofComponent(const Unknown* u=0, Number dn=0, Dimen nc=1); 98 DofComponent dual() const; 99 void print(std::ostream& os) const; 100 friend std::ostream& operator<<(std::ostream&, const DofComponent&); 101}; 102\end{lstlisting} 103\vspace{.2cm} 104The \verb?dual()? function returns the 'dual' dof component. Besides, this class provides some comparison operators (partial ordering) : 105\vspace{.1cm} 106\begin{lstlisting} 107bool operator < (const DofComponent&, const DofComponent&); 108bool operator ==(const DofComponent&, const DofComponent&); 109bool operator !=(const DofComponent&, const DofComponent&); 110\end{lstlisting} 111\vspace{.1cm} 112and somefunctions manipulating list of component dofs : 113\vspace{.1cm} 114\begin{lstlisting} 115vector<DofComponent> createCdofs(const Unknown* u, const vector<Number>& dofs); 116vector<Number> renumber(const vector<DofComponent>&, const vector<DofComponent>&); 117\end{lstlisting} 118\vspace{.1cm} 119 120\displayInfos{library=space, header=DoF.hpp, implementation=DoF.cpp, test=test\_Space.cpp, 121header dep={config.h, utils.h}} 122