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 Term} class}
18
19The {\class Term} class is the abstract basis class of {\class TermVector}, {\class TermMatrix}, {\class SuTermVector}, {\class SuTermMatrix} classes. It collects general informations:
20\vspace{.1cm}
21\begin{lstlisting}[deletekeywords={[3] params}]
22class Term
23{
24protected :
25 String name_;                 //term name
26 TermType termType_;           //type of term
27 ComputingInfo computingInfo_; //computing information
28public :
29 Parameters params;            //a free zone to store additional data
30 static std::vector<Term *> theTerms;
31}
32\end{lstlisting}
33\vspace{.3cm}
34where \emph{TermType} enumerates the child types :
35\vspace{.1cm}
36\begin{lstlisting}
37enum TermType {_termUndef,_termVector,_termMatrix,_sutermVector,_sutermMatrix};
38\end{lstlisting}
39\vspace{.3cm}
40and {\class ComputingInfo} collect various computing informations:
41\vspace{.1cm}
42\begin{lstlisting}[deletekeywords={[3] storageAccess, storageType}]
43class ComputingInfo
44{
45public :
46bool isComputed;
47bool noAssembly;
48bool multithreading;
49bool useGpu;
50StorageType storageType;           //_cs,_skyline,_dense
51AccessType storageAccess;          //_row,_col,_dual,_sym
52EliminationMethod elimination;     //_noElimination, _pseudoElimination, _realElimination
53};
54\end{lstlisting}
55\vspace{.3cm}
56Using a static vector of {\class Term} pointers, the class maintains a list of all terms.\\
57
58This class provides a default constructor, declared \emph{protected} to forbid instantiation by user, and some basic functions (mainly accessors)
59\vspace{.1cm}
60\begin{lstlisting}[]{}
61Term(const String& na="", ComputingInfo ci=ComputingInfo()); //protected
62virtual ~Term();
63const String& name() const;
64String& name();
65TermType termType() const;
66TermType& termType();
67ComputingInfo computingInfo() const;
68ComputingInfo& computingInfo();
69bool& computed();
70bool computed() const;
71virtual void compute()=0;
72virtual void clear()=0;
73virtual void print(std::ostream&) const=0;
74friend std::ostream& operator<<(std::ostream&,const Term&);
75static void clearGlobalVector();
76};
77\end{lstlisting}
78\vspace{.3cm}
79Finally, some general functions (to compute and clear terms) are provided:
80\vspace{.1cm}
81\begin{lstlisting}[]{}
82void compute(Term&);
83void compute(Term&, Term&);
84...
85void clear(Term&);
86void clear(Term&, Term&);
87...
88\end{lstlisting}
89\vspace{.1cm}
90\displayInfos{
91library=term,
92header=Term.hpp,
93implementation=Term.cpp,
94test=test\_TermVector.cpp,
95header dep={essentialConditions.h, config.h, utils.h}
96}
97