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 RefHexahedron.cpp
19 \authors D. Martin, N. Kielbasiewicz
20 \since 11 jan 2003
21 \since 6 aug 2012
22
23 \brief Implementation of xlifepp::RefHexahedron class members and related functions
24 */
25
26 #include "RefHexahedron.hpp"
27 #include "LagrangeHexahedron.hpp"
28 #include "NedelecEdgeHexahedron.hpp"
29 #include "../Interpolation.hpp"
30 #include "utils.h"
31
32 namespace xlifepp
33 {
34
35 //! selectRefHexahedron construction of a Reference Element by interpolation type and interpolation subtype
selectRefHexahedron(const Interpolation * int_p)36 RefElement* selectRefHexahedron(const Interpolation* int_p)
37 {
38 switch ( int_p->type )
39 {
40 case _Lagrange:
41 switch ( int_p->subtype )
42 {
43 case _standard: return new LagrangeStdHexahedron(int_p); break;
44 case _GaussLobatto: return new LagrangeGLHexahedron(int_p); break;
45 default: int_p->badSubType(_hexahedron); break;
46 }
47 case _Nedelec_Edge :
48 switch ( int_p->subtype )
49 {
50 case _firstFamily : return new NedelecEdgeFirstHexahedronPk(int_p); break;
51 default: int_p->badSubType(_hexahedron); break;
52 }
53 default: break;
54 }
55
56 // Throw error messages
57 trace_p->push("selectRefHexahedron");
58 int_p->badType(_hexahedron);
59 trace_p->pop();
60 return 0;
61 }
62
63 } // end of namespace xlifepp
64