LifeV
ExpressionDerivativeArcTan.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief File where the structures for the product between expressions are defined.
30 
31  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
32 
33  @date 07-2011
34  */
35 
36 #ifndef EXPRESSION_DERIVATIVEARCTAN_HPP
37 #define EXPRESSION_DERIVATIVEARCTAN_HPP
38 
39 #include <lifev/core/LifeV.hpp>
40 
41 #include <lifev/eta/expression/ExpressionBase.hpp>
42 
43 namespace LifeV
44 {
45 
46 namespace ExpressionAssembly
47 {
48 
49 //! class ExpressionPower Class for representing a product between two expressions.
50 /*!
51  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
52 
53  This class represents the product in the expression tree.
54 
55  <b> Template parameters </b>
56 
57  <i>LExpressionType</i>: The expression on the left side of the product operation.
58 
59  <i>RExpressionType</i>: The expression on the right side of the product operation.
60 
61  <b> Template requirements </b>
62 
63  <i>LExpressionType</i>: Copiable, static display method
64 
65  <i>RExpressionType</i>: Copiable, static display method
66 
67 */
68 template <typename BaseExpressionType>
69 class ExpressionDerivativeArcTan : public ExpressionBase< ExpressionDerivativeArcTan<BaseExpressionType> >
70 {
71 public:
72 
73  //! @name Public Types
74  //@{
75 
76  // No direct use, just ease of coding
77  typedef ExpressionBase< ExpressionDerivativeArcTan <BaseExpressionType> > base_Type;
78 
79  //@}
80 
81  //! @name Constructors & Destructor
82  //@{
83 
84  //! Full constructor using the two expressions
85  ExpressionDerivativeArcTan (const BaseExpressionType& l, const Real epsilon, const Real K)
86  : base_Type(), M_l (l), M_epsilon (epsilon), M_K (K) {}
87 
88  //! Copy constructor
89  ExpressionDerivativeArcTan (const ExpressionDerivativeArcTan<BaseExpressionType>& expression)
90  : base_Type(), M_l (expression.M_l), M_epsilon (expression.M_epsilon), M_K (expression.M_K) {}
91 
92  //! Destructor
93  ~ExpressionDerivativeArcTan() {}
94 
95  //@}
96 
97 
98  //! @name Methods
99  //@{
100 
101  //! Display method
102  static void display (std::ostream& out = std::cout)
103  {
104  out << " derAtan ( ";
105  BaseExpressionType::display (out);
106  out << " ) ";
107  }
108 
109  //@}
110 
111 
112  //! @name Private Methods
113  //@{
114 
115  //! Getter for the left hand side
116  const BaseExpressionType& base() const
117  {
118  return M_l;
119  }
120 
121  //! Getter for the right hand side
122  const Real& epsilon() const
123  {
124  return M_epsilon;
125  }
126 
127  //! Getter for the right hand side
128  const Real& K() const
129  {
130  return M_K;
131  }
132 
133  //@}
134 
135 private:
136 
137  //! @name Private Methods
138  //@{
139 
140  ExpressionDerivativeArcTan();
141 
142  //@}
143 
144 
145  // Left hand side
146  BaseExpressionType M_l;
147 
148  Real M_epsilon;
149 
150  Real M_K;
151 };
152 
153 
154 //! operator* The generic operator for the product between expressions.
155 /*!
156  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
157 
158  Operator used in construction of the expression tree. To avoid shadowing
159  other operator*, it uses the ExpressionBase type to distinguish expressions
160  from other types.
161 
162  <b> Template parameters </b>
163 
164  <i>LExpressionType</i>: The expression on the left side of the product operation.
165 
166  <i>RExpressionType</i>: The expression on the right side of the product operation.
167 
168  <b> Template requirements </b>
169 
170  <i>LExpressionType</i>: Same as in LifeV::ExpressionProduct
171 
172  <i>RExpressionType</i>: Same as in LifeV::ExpressionProduct
173 
174 */
175 
176 template< typename ExpressionType>
177 ExpressionDerivativeArcTan<ExpressionType>
178 derAtan (const ExpressionBase<ExpressionType>& l, const Real& epsilon, const Real& K)
179 {
180  return ExpressionDerivativeArcTan<ExpressionType> (l.cast(), epsilon, K);
181 }
182 
183 
184 } // Namespace ExpressionAssembly
185 
186 } // Namespace LifeV
187 
188 #endif
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
Definition: LifeV.hpp:175
class ExpressionBase Base class (static polymorphism, CRTP sense) for all the expressions used in ass...