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 BCElement.hpp 19 \authors E. Lunéville 20 \since 28 nov 2017 21 \date 28 nov 2017 22 23 \brief Definition of Buffa-Christiansen elements 24 25 Buffa-Christiansen elements are defined on the dual mesh of a mesh 26 This file provides the definition of class 27 28 BCRTElement : dual of the RT element (2d) 29 30 It inherits from the ExtendElement virtual class that is referenced by Element class 31 Note that BC element does not use reference element 32 33 */ 34 35 // ############################## IN PROGRESS ######################################## 36 37 #ifndef BCELEMENT_HPP 38 #define BCELEMENT_HPP 39 40 namespace xlifepp 41 { 42 43 /*! ExtendedElement class is a virtual class handling elements that are not standard 44 for instance, Buffa-Christiansen elements 45 ExtendElement objects are referenced by Element objects 46 */ 47 class ExtendedElement 48 { 49 public: 50 virtual string_t name()const =0 ; ~ExtendedElement()51 virtual ~ExtendedElement(){} 52 }; 53 54 //! class describing a part of BC-RT shape function : sub RT shape function 55 class BCRTShapeFunctionPart 56 { 57 public: 58 const GeomElement* gelt_p;//!< pointer to element supporting sub RT shape function 59 number_t sub_elt_num; //!< sub element number in element 60 number_t edge_num; //!< edge number related to sub RT shape function 61 real_t coeff; //!< coefficient related to sub RT shape function BCRTShapeFunctionPart(const GeomElement * ge,number_t sen,number_t en,real_t c)62 BCRTShapeFunctionPart(const GeomElement* ge, number_t sen, number_t en, real_t c) 63 : gelt_p(ge),sub_elt_num(sen), edge_num(en), coeff(c) {} 64 }; 65 66 //! class describing a BC-RT shape function that is a linear combination of RT shape function defined on sub triangle 67 class BCRTShapeFunction 68 { 69 public: 70 std::list<BCRTShapeFunctionPart> shapeParts; 71 }; 72 73 /*! class describing a BC-RT element considered as an element defined on a triangle of the primal mesh 74 in this interpretation, element has inner dofs and outer dofs 75 */ 76 77 class BCRTElement: public ExtendedElement 78 { 79 public: 80 /*! dofs numbers ordered as follows 81 inner dofs "located" on triangle edges (3) 82 outer dofs located on edges connected to vertex i (except triangle edges) 83 */ 84 std::vector<BCRTShapeFunction> shapeFunctions; 85 addShapePart(number_t i,const GeomElement * ge,number_t sen,number_t en,real_t c)86 void addShapePart(number_t i, const GeomElement* ge, number_t sen, number_t en, real_t c) 87 {shapeFunctions[i].shapeParts.push_back(BCRTShapeFunctionPart(ge,sen,en,c));} 88 name() const89 virtual string_t name() const {return "BC-RT element";} 90 // the following function 1. leads to compilation error and 2. is unused ==> commented 91 // virtual ShapeValues computeShapeValues(const Point&, bool withderivative, 92 // Vector<real_t>* =0) const {} //!< compute BCRT shape values at a point 93 }; 94 95 } // end of namespace xlifepp 96 97 #endif // BCELEMENT_HPP 98