Line data Source code
1 : // The libMesh Finite Element Library. 2 : // Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 3 : 4 : // This library is free software; you can redistribute it and/or 5 : // modify it under the terms of the GNU Lesser General Public 6 : // License as published by the Free Software Foundation; either 7 : // version 2.1 of the License, or (at your option) any later version. 8 : 9 : // This library 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 GNU 12 : // Lesser General Public License for more details. 13 : 14 : // You should have received a copy of the GNU Lesser General Public 15 : // License along with this library; if not, write to the Free Software 16 : // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 : 18 : 19 : 20 : #ifndef LIBMESH_FACE_QUAD16_H 21 : #define LIBMESH_FACE_QUAD16_H 22 : 23 : // Local includes 24 : #include "libmesh/libmesh_common.h" 25 : #include "libmesh/face_quad.h" 26 : #include "libmesh/enum_order.h" 27 : 28 : namespace libMesh 29 : { 30 : 31 : 32 : 33 : /** 34 : * The \p QUAD16 is an element in 2D composed of 16 nodes. 35 : * It is numbered like this: 36 : * 37 : * \verbatim 38 : * 3 9 8 2 39 : * QUAD4: o---o---o---o 40 : * | 15 14 | eta 41 : * 10 o o o o 7 ^ 42 : * | 12 13 | | 43 : * 11 o o o o 6 | 44 : * | | o---> xi 45 : * o---o---o---o 46 : * 0 4 5 1 47 : * \endverbatim 48 : * 49 : * (xi, eta) in [-1,1]^2 are the reference element coordinates associated with 50 : * the given numbering. 51 : * 52 : * \author Benjamin S. Kirk, Micah D. Gale 53 : * \date 2026 54 : * \brief A 2D quadrilateral element with 4 nodes. 55 : */ 56 : class Quad16 : public Quad 57 : { 58 : public: 59 : 60 : /** 61 : * Constructor. By default this element has no parent. 62 : */ 63 : explicit 64 1083 : Quad16 (Elem * p=nullptr) : 65 1083 : Quad(num_nodes, p, _nodelinks_data) {} 66 : 67 : Quad16 (Quad16 &&) = delete; 68 : Quad16 (const Quad16 &) = delete; 69 : Quad16 & operator= (const Quad16 &) = delete; 70 : Quad16 & operator= (Quad16 &&) = delete; 71 1979 : virtual ~Quad16() = default; 72 : 73 1536 : virtual Point master_point (const unsigned int i) const override final 74 : { 75 384 : libmesh_assert_less(i, this->n_nodes()); 76 1536 : return Point(_master_points[i][0], 77 1536 : _master_points[i][1], 78 1920 : _master_points[i][2]); 79 : } 80 : 81 : /** 82 : * \returns \p QUAD16. 83 : */ 84 1483616 : virtual ElemType type () const override { return QUAD16; } 85 : 86 : /** 87 : * \returns 16. 88 : */ 89 317612 : virtual unsigned int n_nodes() const override { return 16; } 90 : 91 : /** 92 : * \returns 9. 93 : */ 94 0 : virtual unsigned int n_sub_elem() const override { return 9; } 95 : 96 : /** 97 : * \returns \p true if the specified (local) node number is a vertex. 98 : */ 99 : virtual bool is_vertex(const unsigned int i) const override; 100 : 101 : /** 102 : * \returns \p true if the specified (local) node number is an edge. 103 : */ 104 : virtual bool is_edge(const unsigned int i) const override; 105 : 106 : /** 107 : * \returns \p true if the specified (local) node number is a face. 108 : */ 109 : virtual bool is_face(const unsigned int i) const override; 110 : 111 : /** 112 : * \returns \p true if the specified (local) node number is on the 113 : * specified side. 114 : */ 115 : virtual bool is_node_on_side(const unsigned int n, 116 : const unsigned int s) const override; 117 : 118 : virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override; 119 : 120 : virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override; 121 : virtual unsigned int local_side_node(unsigned int side, 122 : unsigned int side_node) const override; 123 : 124 : /** 125 : * \returns \p true if the specified (local) node number is on the 126 : * specified edge (== is_node_on_side in 2D). 127 : */ 128 256 : virtual bool is_node_on_edge(const unsigned int n, 129 : const unsigned int e) const override 130 256 : { return this->is_node_on_side(n,e); } 131 : 132 : /** 133 : * \returns \p true if the element map is definitely affine within 134 : * numerical tolerances. 135 : */ 136 : virtual bool has_affine_map () const override; 137 : 138 : /** 139 : * \returns THIRD. 140 : */ 141 43750 : virtual Order default_order() const override 142 43750 : { return THIRD; } 143 : 144 : virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i) override; 145 : 146 : /** 147 : * Rebuilds an EDGE4 coincident with face i. 148 : */ 149 : virtual void build_side_ptr (std::unique_ptr<Elem> & elem, 150 : const unsigned int i) override; 151 : 152 : // Avoid hiding deprecated version with different signature 153 : using Elem::build_side_ptr; 154 : 155 : virtual void connectivity(const unsigned int sf, 156 : const IOPackage iop, 157 : std::vector<dof_id_type> & conn) const override; 158 : 159 : /** 160 : * Geometric constants for Quad16. 161 : */ 162 : static const int num_nodes = 16; 163 : static const int nodes_per_side = 4; 164 : 165 : /** 166 : * Master element node locations 167 : */ 168 : static const Real _master_points[16][3]; 169 : 170 : /** 171 : * This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ side to 172 : * element node numbers. 173 : */ 174 : static const unsigned int side_nodes_map[num_sides][nodes_per_side]; 175 : 176 : virtual void permute(unsigned int perm_num) override final; 177 : 178 : virtual void flip(BoundaryInfo *) override final; 179 : 180 : ElemType side_type (const unsigned int s) const override final; 181 : 182 : protected: 183 : 184 : /** 185 : * Data for links to nodes. 186 : */ 187 : Node * _nodelinks_data[num_nodes]; 188 : 189 : 190 : 191 : #ifdef LIBMESH_ENABLE_AMR 192 : 193 : /** 194 : * Matrix used to create the elements children. 195 : */ 196 0 : virtual Real embedding_matrix (const unsigned int, const unsigned int, const unsigned int) const override 197 0 : { libmesh_not_implemented(); return 0; } 198 : 199 : #endif // LIBMESH_ENABLE_AMR 200 : 201 : }; 202 : 203 : 204 : } // namespace libMesh 205 : 206 : #endif // LIBMESH_FACE_QUAD16_H