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_CELL_PRISM15_H 21 : #define LIBMESH_CELL_PRISM15_H 22 : 23 : // Local includes 24 : #include "libmesh/cell_prism.h" 25 : #include "libmesh/fe_reference_element_traits.h" 26 : 27 : namespace libMesh 28 : { 29 : 30 : /** 31 : * The \p Prism15 is an element in 3D composed of 15 nodes. 32 : * It is numbered like this: 33 : * 34 : * \verbatim 35 : * PRISM15: 36 : * 5 37 : * o 38 : * /:\ 39 : * / : \ 40 : * / : \ 41 : * / : \ 42 : * 14 o : o 13 43 : * / : \ 44 : * / : \ 45 : * / o 11 \ 46 : * 3 / : \4 47 : * o---------o---------o 48 : * | :12 | 49 : * | : | 50 : * | : | zeta 51 : * | o | ^ eta (into page) 52 : * | .2. | | / 53 : * | . . | |/ 54 : * 9 o . . o 10 o---> xi 55 : * | . . | 56 : * | 8 o o 7 | 57 : * | . . | 58 : * | . . | 59 : * | . . | 60 : * |. .| 61 : * o---------o---------o 62 : * 0 6 1 63 : * \endverbatim 64 : * 65 : * (xi, eta, zeta): { 0 <= xi <= 1 66 : * { 0 <= eta <= 1 67 : * { -1 <= zeta <= 1 68 : * { xi + eta <= 1 69 : * are the reference element coordinates associated with the given 70 : * numbering. 71 : * 72 : * \author Benjamin S. Kirk 73 : * \date 2003 74 : * \brief A 3D prismatic element with 15 nodes. 75 : */ 76 : class Prism15 final : public Prism 77 : { 78 : public: 79 : 80 : /** 81 : * Constructor. By default this element has no parent. 82 : */ 83 : explicit 84 9011 : Prism15 (Elem * p=nullptr) : 85 9011 : Prism(num_nodes, p, _nodelinks_data) 86 9011 : {} 87 : 88 : Prism15 (Prism15 &&) = delete; 89 : Prism15 (const Prism15 &) = delete; 90 : Prism15 & operator= (const Prism15 &) = delete; 91 : Prism15 & operator= (Prism15 &&) = delete; 92 15290 : virtual ~Prism15() = default; 93 : 94 : /** 95 : * \returns \p PRISM15. 96 : */ 97 121800464 : virtual ElemType type () const override { return PRISM15; } 98 : 99 : /** 100 : * \returns 15. 101 : */ 102 107284359 : virtual unsigned int n_nodes() const override { return num_nodes; } 103 : 104 : /** 105 : * \returns 1. 106 : */ 107 0 : virtual unsigned int n_sub_elem() const override { return 1; } 108 : 109 : /** 110 : * \returns \p true if the specified (local) node number is a vertex. 111 : */ 112 : virtual bool is_vertex(const unsigned int i) const override; 113 : 114 : /** 115 : * \returns \p true if the specified (local) node number is an edge. 116 : */ 117 : virtual bool is_edge(const unsigned int i) const override; 118 : 119 : /** 120 : * \returns \p true if the specified (local) node number is a face. 121 : */ 122 : virtual bool is_face(const unsigned int i) const override; 123 : 124 : /** 125 : * \returns \p true if the specified (local) node number is on the 126 : * specified side. 127 : */ 128 : virtual bool is_node_on_side(const unsigned int n, 129 : const unsigned int s) const override; 130 : 131 : virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override; 132 : 133 : virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override; 134 : 135 : /** 136 : * \returns \p true if the specified (local) node number is on the 137 : * specified edge. 138 : */ 139 : virtual bool is_node_on_edge(const unsigned int n, 140 : const unsigned int e) const override; 141 : 142 : /** 143 : * \returns \p true if the element map is definitely affine within 144 : * numerical tolerances. 145 : */ 146 : virtual bool has_affine_map () const override; 147 : 148 : /** 149 : * \returns SECOND. 150 : */ 151 : virtual Order default_order() const override; 152 : 153 : /** 154 : * \returns \p Prism15::side_nodes_map[side][side_node] after doing some range checking. 155 : */ 156 : virtual unsigned int local_side_node(unsigned int side, 157 : unsigned int side_node) const override; 158 : 159 : /** 160 : * \returns \p Prism15::edge_nodes_map[edge][edge_node] after doing some range checking. 161 : */ 162 : virtual unsigned int local_edge_node(unsigned int edge, 163 : unsigned int edge_node) const override; 164 : 165 : /** 166 : * Builds a \p QUAD8 or \p TRI6 built coincident with face i. 167 : * The \p std::unique_ptr<Elem> handles the memory aspect. 168 : */ 169 : virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i) override; 170 : 171 : /** 172 : * Rebuilds a \p QUAD8 or \p TRI6 built coincident with face i. 173 : */ 174 : virtual void build_side_ptr (std::unique_ptr<Elem> & elem, 175 : const unsigned int i) override; 176 : 177 : // Avoid hiding deprecated version with different signature 178 : using Elem::build_side_ptr; 179 : 180 : /** 181 : * Builds a \p EDGE3 or \p INFEDGE2 coincident with edge i. 182 : * The \p std::unique_ptr<Elem> handles the memory aspect. 183 : */ 184 : virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int i) override; 185 : 186 : /** 187 : * Rebuilds a \p EDGE3 built coincident with edges 0 to 2, or \p 188 : * INFEDGE2 built coincident with edges 3 to 5. 189 : */ 190 : virtual void build_edge_ptr (std::unique_ptr<Elem> & edge, const unsigned int i) override; 191 : 192 : virtual void connectivity(const unsigned int sc, 193 : const IOPackage iop, 194 : std::vector<dof_id_type> & conn) const override; 195 : /** 196 : * \returns 2 for all \p n. 197 : */ 198 0 : virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const override 199 0 : { return 2; } 200 : 201 : /** 202 : * \returns The element-local number of the \f$ v^{th} \f$ vertex 203 : * that defines the \f$ n^{th} \f$ second-order node. 204 : * 205 : * \note \p n is counted as depicted above, \f$ 6 \le n < 15 \f$. 206 : */ 207 : virtual unsigned short int second_order_adjacent_vertex (const unsigned int n, 208 : const unsigned int v) const override; 209 : 210 : /** 211 : * \returns The child number \p c and element-local index \p v of the 212 : * \f$ n^{th} \f$ second-order node on the parent element. See 213 : * elem.h for further details. 214 : */ 215 : virtual std::pair<unsigned short int, unsigned short int> 216 : second_order_child_vertex (const unsigned int n) const override; 217 : 218 : /** 219 : * Geometric constants for Prism15. 220 : */ 221 : static const int num_nodes = 15; 222 : static const int nodes_per_side = 8; 223 : static const int nodes_per_edge = 3; 224 : 225 : /** 226 : * This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ side to 227 : * element node numbers. 228 : */ 229 : static const ReferenceElementTable<num_sides, nodes_per_side> side_nodes_map; 230 : 231 : /** 232 : * This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ edge to 233 : * element node numbers. 234 : */ 235 : static const ReferenceElementTable<num_edges, nodes_per_edge> edge_nodes_map; 236 : 237 : /** 238 : * A specialization for computing the volume of a Prism15. 239 : */ 240 : virtual Real volume () const override; 241 : 242 : virtual void permute(unsigned int perm_num) override final; 243 : 244 : virtual void flip(BoundaryInfo *) override final; 245 : 246 : ElemType side_type (const unsigned int s) const override final; 247 : 248 : protected: 249 : 250 : /** 251 : * Data for links to nodes. 252 : */ 253 : Node * _nodelinks_data[num_nodes]; 254 : 255 : 256 : 257 : #ifdef LIBMESH_ENABLE_AMR 258 : 259 : /** 260 : * Matrix used to create the elements children. 261 : */ 262 377727 : virtual Real embedding_matrix (const unsigned int i, 263 : const unsigned int j, 264 : const unsigned int k) const override 265 377727 : { return _embedding_matrix[i][j][k]; } 266 : 267 : /** 268 : * Matrix that computes new nodal locations/solution values 269 : * from current nodes/solution. 270 : */ 271 : static const Real _embedding_matrix[num_children][num_nodes][num_nodes]; 272 : 273 369600 : LIBMESH_ENABLE_TOPOLOGY_CACHES; 274 : 275 : #endif 276 : 277 : }; 278 : 279 : } // namespace libMesh 280 : 281 : #endif // LIBMESH_CELL_PRISM15_H