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 /*!
18   \file HermiteTriangle.hpp
19   \authors D. Martin, N. Kielbasiewicz
20   \since 11 jan 2003
21   \date 6 aug 2012
22 
23   \brief Definition of the xlifepp::HermiteTriangle class
24 
25   xlifepp::HermiteTriangle defines Hermite Reference Element interpolation data on triangular elements
26 
27   member functions
28   ----------------
29     - interpolationData interpolation data
30     - sideNumbering  local numbering on edges
31     - pointCoordinates  point coordinates
32 
33   child classes
34   -------------
35     - xlifepp::HermiteStdTriangle Lagrange standard Reference Element
36  */
37 
38 #ifndef HERMITE_TRIANGLE_HPP
39 #define HERMITE_TRIANGLE_HPP
40 
41 #include "config.h"
42 #include "RefTriangle.hpp"
43 
44 namespace xlifepp
45 {
46 
47 class Interpolation;
48 
49 /*!
50   \class HermiteTriangle
51   defines Hermite Reference Element interpolation data on triangular elements
52 
53   Parent class  : RefTriangle
54   Child classes : HermiteStdTriangle
55  */
56 class HermiteTriangle : public RefTriangle
57 {
58   public:
59     HermiteTriangle(const Interpolation* interp_p); //!< constructor by interpolation
60     virtual ~HermiteTriangle(); //!< destructor
61 
62   protected:
63     void interpolationData(); //!< builds interpolation data on reference element
64     void sideNumbering(); //!< builds side numbering
65 
66     virtual void pointCoordinates() = 0; //!< builds point coordinates
67 
68 }; // end of class HermiteTriangle
69 
70 /*!
71   \class HermiteStdTriangle
72   template class child to class HermiteTriangle
73  */
74 template<number_t Pk>
75 class HermiteStdTriangle : public HermiteTriangle
76 {
77   public:
78     HermiteStdTriangle(const Interpolation* interp_p); //!< constructor by interpolation
79     ~HermiteStdTriangle(); //!< destructor
80     using RefElement::computeShapeValues;     //to unmask computeShapeValues(vector<real_t>::const_iterator, const bool)
81     void computeShapeValues(std::vector<real_t>::const_iterator it_pt, ShapeValues& shv, const bool withDeriv = true) const; //!< shape functions
82     void pointCoordinates(); //!< builds point coordinates on reference element
83 
84 }; // end of class HermiteStdTriangle
85 
86 } // end of namespace xlifepp
87 
88 #endif /* HERMITE_TRIANGLE_HPP */
89