MAST3
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
utility.hpp
Go to the documentation of this file.
1 /*
2 * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3 * Copyright (C) 2013-2020 Manav Bhatia and MAST authors
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 #ifndef __mast_mesh_libmesh_utility_h__
21 #define __mast_mesh_libmesh_utility_h__
22 
23 // MAST includes
25 
26 // libMesh includes
27 #include <libmesh/elem.h>
28 #include <libmesh/enum_elem_type.h>
29 
30 namespace MAST {
31 namespace Mesh {
32 namespace libMeshWrapper {
33 namespace Utility {
34 
35 
39 inline uint_t n_linear_basis_nodes_on_elem(const libMesh::Elem& e) {
40 
41  switch (e.type()) {
42  case libMesh::QUAD4:
43  case libMesh::QUAD9:
44  return 4;
45  break;
46 
47  case libMesh::HEX8:
48  case libMesh::HEX27:
49  return 8;
50  break;
51 
52  default:
53  Error(false, "Elem type must be QUAD4/QUAD9 for 2D or HEX8/HEX27 for 3D");
54  }
55  return -1;
56 }
57 
58 
59 
60 } // namespace Utility
61 } // namespace libMesh
62 } // namespace Mesh
63 } // namespace MAST
64 
65 #endif // __mast_mesh_libmesh_utility_h__
#define Error(cond, msg)
Definition: exceptions.hpp:166
uint_t n_linear_basis_nodes_on_elem(const libMesh::Elem &e)
identifies number of ndoes on element
Definition: utility.hpp:39
unsigned int uint_t