LifeV
ExpressionVectorFromNonConstantScalar.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 element-wise multiplication between expressions are defined.
30 
31  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
32 
33  @date 08-2012
34  */
35 
36 #ifndef EXPRESSION_VECTORFROMNONCONSTANTSCALAR_HPP
37 #define EXPRESSION_VECTORFROMNONCONSTANTSCALAR_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 ExpressionEmult Class for representing the transpose operation of an expression
50 /*!
51  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
52 
53  This class represents the transpose operation in the expression tree.
54 
55  <b> Template parameters </b>
56 
57  <i>ExpressionType</i>: The expression to be transposed.
58 
59  <b> Template requirements </b>
60 
61  <i>ExpressionType</i>: Copiable, static display method
62 
63 
64 */
65  template <typename ExpressionType, UInt FieldDim>
66  class ExpressionVectorFromNonConstantScalar : public ExpressionBase< ExpressionVectorFromNonConstantScalar<ExpressionType, FieldDim> >
67 {
68 public:
69 
70  //! @name Public Types
71  //@{
72 
73  // No real need, just for ease of coding
74  typedef ExpressionBase< ExpressionVectorFromNonConstantScalar <ExpressionType, FieldDim> > base_Type;
75 
76  //@}
77 
78 
79  //! @name Constructors & Destructor
80  //@{
81 
82  //! Full constructor
83  ExpressionVectorFromNonConstantScalar (const ExpressionType& expr)
84  : base_Type(), M_expr (expr) {}
85 
86  //! Copy constructor
87  ExpressionVectorFromNonConstantScalar (const ExpressionVectorFromNonConstantScalar<ExpressionType, FieldDim>& expression)
88  : base_Type(), M_expr (expression.M_expr) {}
89 
90  //! Destructor
91  ~ExpressionVectorFromNonConstantScalar() {}
92 
93  //@}
94 
95 
96  //! @name Methods
97  //@{
98 
99  //! Display method
100  static void display (std::ostream& out = std::cout)
101  {
102  out << " vector small from expression ";
103  ExpressionType::display (out);
104  }
105 
106  //@}
107 
108 
109  //! @name Get Methods
110  //@{
111 
112  //! Getter for the expression that we transpose
113  const ExpressionType& exprEx() const
114  {
115  return M_expr;
116  }
117 
118 
119  //@}
120 
121 private:
122 
123  //! @name Private Methods
124  //@{
125 
126  //! No default constructor
127  ExpressionVectorFromNonConstantScalar();
128 
129  //@}
130 
131  // Expression that we transpose
132  ExpressionType M_expr;
133 
134 };
135 
136 
137 // transpose The generic function for the determinant of an expression.
138 /*!
139  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
140 
141  Function used in construction of the expression tree. To avoid shadowing
142  other functions, it uses the ExpressionBase type to distinguish expressions
143  from other types.
144 
145  <b> Template parameters </b>
146 
147  <i>ExpressionType</i>: The expression of which we compute the trace
148 
149  <b> Template requirements </b>
150 
151  <i>ExpressionType</i>: Same as in LifeV::ExpressionVectorFromNonConstantScalar
152 
153 */
154 template< typename ExpressionType, UInt FieldDim >
155 ExpressionVectorFromNonConstantScalar<ExpressionType, FieldDim>
156 vectorFromScalar (const ExpressionBase<ExpressionType>& expr)
157 {
158  return ExpressionVectorFromNonConstantScalar<ExpressionType, FieldDim> (expr.cast() );
159 }
160 
161 } // Namespace ExpressionAssembly
162 
163 } // Namespace LifeV
164 #endif
void updateInverseJacobian(const UInt &iQuadPt)
class ExpressionBase Base class (static polymorphism, CRTP sense) for all the expressions used in ass...
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191