LifeV
ExpressionBase.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 base class for the expressions is defined
30 
31  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
32 
33  @date 07-2011
34  */
35 
36 #ifndef EXPRESSION_BASE_HPP
37 #define EXPRESSION_BASE_HPP
38 
39 #include <lifev/core/LifeV.hpp>
40 
41 namespace LifeV
42 {
43 
44 namespace ExpressionAssembly
45 {
46 
47 //! class ExpressionBase Base class (static polymorphism, CRTP sense) for all the expressions used in assembly procedures.
48 /*!
49  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
50 
51  This class is nothing else than an empty mother class for all the expressions, in order to
52  distinguish those classes from the other ones (acts like a type marker).
53 
54  <b> Template parameters </b>
55 
56  <i>DerivedType</i>: The type of the derived class.
57 
58  <b> Template requirements </b>
59 
60  <i>DerivedType</i>: Copiable
61 
62 */
63 template <typename DerivedType>
65 {
66 public:
67 
68  //! @name Public Types
69  //@{
70 
71  typedef DerivedType derived_Type;
72 
73  //@}
74 
75 
76  //! @name Constructors & Destructor
77  //@{
78 
79  //! Empty and only constructor
81 
82  //! Destructor
83  virtual ~ExpressionBase() {}
84 
85  //@}
86 
87 
88  //! @name Methods
89  //@{
90 
91  //! Method to cast away the type and get the real (DerivedType) object
92  const derived_Type& cast() const
93  {
94  return static_cast<const derived_Type&> (*this);
95  }
96 
97  //@}
98 
99 private:
100 
101  //! @name Private Methods
102  //@{
103 
104  //! No copy (avoid slicing)
105  ExpressionBase (const ExpressionBase<DerivedType>&);
106 
107  //! No equality (avoid slicing)
108  void operator= (const ExpressionBase<DerivedType>&);
109 
110  //@}
111 };
112 
113 
114 } // Namespace ExpressionAssembly
115 
116 } // Namespace LifeV
117 #endif
void operator=(const ExpressionBase< DerivedType > &)
No equality (avoid slicing)
ExpressionBase()
Empty and only constructor.
void updateInverseJacobian(const UInt &iQuadPt)
ExpressionBase(const ExpressionBase< DerivedType > &)
No copy (avoid slicing)
class ExpressionBase Base class (static polymorphism, CRTP sense) for all the expressions used in ass...
const derived_Type & cast() const
Method to cast away the type and get the real (DerivedType) object.