Debian Codegraph @

packages/pamgen/mesh_spec_lt/pamgen_element_dictionary.C

raw
1 // @HEADER
2 // *****************************************************************************
3 // Pamgen Package
4 //
5 // Copyright 2004 NTESS and the Pamgen contributors.
6 // SPDX-License-Identifier: LGPL-2.1-or-later
7 // *****************************************************************************
8 // @HEADER
9
10 #include "pamgen_code_types.h"
11 #include "pamgen_element_dictionary.h"
12
13 namespace PAMGEN_NEVADA {
14
15
16 // if you add an element type, you must be consistant with the arrays defined
17 // below and you should make sure that element_dictionary.h is in sync.
18
19 extern const int NUM_ELEMENT_TYPES = MAX_EL_TYPES;
20
21 extern const Element_Info element_info[MAX_EL_TYPES] = {
22 // nodes, edges, faces, npf, nsp, class
23 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // UNKNOWN_ELEMENT
24 { 1, 0, 0, 0, 1, EL_CONTINUUM }, // CIRCLE
25 { 1, 0, 0, 0, 1, EL_CONTINUUM }, // SPHERE
26 { 4, 4, 4, 2, 1, EL_CONTINUUM }, // QUAD4
27 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // QUAD8
28 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // QUAD9
29 { 3, 3, 3, 2, 1, EL_CONTINUUM }, // TRI3
30 { 6, 3, 3, 3, 3, EL_CONTINUUM }, // TRI6
31 { 4, 4, 4, 2, 3, EL_CONTINUUM }, // TRI7
32 { 4, 4, 2, 4, 3, EL_STRUCTURAL }, // SHELL4
33 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // SHELL8
34 { 8, 12, 6, 4, 1, EL_CONTINUUM }, // HEX8
35 { 20, 12, 6, 8, 1, EL_CONTINUUM }, // HEX20
36 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // HEX27
37 { 4, 6, 4, 3, 1, EL_CONTINUUM }, // TET4 - c
38 { 8, 6, 4, 4, 1, EL_CONTINUUM }, // TET8 - c+f
39 { 10, 6, 4, 6, 5, EL_CONTINUUM }, // TET10 - c+e
40 { 8, 12, 6, 4, 4, EL_CONTINUUM }, // TET15 - c+f+e
41 { 6, 9, 5, 4, 1, EL_CONTINUUM }, // WEDGE6
42 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // WEDGE18
43 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // BEAM2
44 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // BEAM3
45 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // TRUSS2
46 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // TRUSS3
47 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // STRUCT1D
48 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // STRUCT2D
49 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // STRUCT3D
50 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // SFACET3D
51 { 5, 8, 5, 4, 1, EL_CONTINUUM }, // PYRAMID5
52 { 0, 0, 0, 0, 0, EL_UNKNOWN }, // SEG2
53 { 0, 0, 0, 0, 0, EL_UNKNOWN } // SEG3
54 };
55
56 // Maximum nodes per face
57 extern const int nodes_per_face[] = {0, 1, 1, 2, 3,
58 3, 2, 3, 3, 4,
59 8, 4, 8, 8, 3, 4,
60 6, 7, 4, 8, 2,
61 3, 2, 3, 2, 2,
62 4, 4, 4, 1, 1};
63
64 extern const int faces_per_element[] = {0, 1, 1, 4, 4,
65 4, 3, 3, 3, 6,
66 6, 6, 6, 6, 4, 4,
67 4, 4, 5, 5, 2,
68 2, 2, 2, 2, 4,
69 6, 6, 5, 2, 2};
70
71 extern const int edges_per_element[] = { 0, 0, 0, 4, 0,
72 0, 3, 3, 4, 4,
73 0,12, 12, 0, 6, 6,
74 6,12, 9, 0, 0,
75 0, 0, 0, 0, 0,
76 0, 0, 8, 0, 0};
77
78 /* translations tables do not include the nonstandard element TET8 */
79
80 /* node to side translation tables -
81 * These tables are used to look up the side number based on the
82 * first and second node in the side/face list. The side node order
83 * is found in the original Exodus document, SAND87-2997. The element
84 * node order is found in the ExodusII document, SAND92-2137. These
85 * tables were generated by following the right-hand rule for determining
86 * the outward normal. Note: Only the more complex 3-D shapes require
87 * these tables, the simple shapes are trivial - the first node found
88 * is also the side number.
89 */
90
91 extern const int shell_node_to_side_table[2][8] = {
92 // 1 2 3 4 node 1
93 {2,4, 3,1, 4,2, 1,3}, // node 2
94 {1,2, 1,2, 1,2, 1,2} // side #
95 };
96
97 extern const int tetra_node_to_side_table[2][12] = {
98 // 1 2 3 4 node 1
99 {2,3,4, 1,3,4, 4,1,2, 1,2,3}, // node 2
100 {1,4,3, 4,2,1, 2,3,4, 1,2,3} // side #
101 };
102
103 extern const int wedge_node_to_side_table[2][18] = {
104 // 1 2 3 4 5 6 node 1
105 {2,4,3, 5,1,3, 6,1,2, 1,6,5, 6,2,4, 4,3,5}, // node 2
106 {1,3,4, 1,4,2, 2,3,4, 1,3,5, 5,2,1, 5,3,2} // side #
107 };
108
109 extern const int hex_node_to_side_table[2][24] = {
110 // 1 2 3 4 5 6 7 8 node 1
111 {4,2,5, 1,3,6, 7,4,2, 3,1,8, 6,8,1, 5,2,7, 8,6,3, 7,5,4},// node 2
112 {5,1,4, 5,2,1, 2,3,5, 5,4,3, 6,4,1, 1,2,6, 6,2,3, 3,6,4} // side #
113 };
114
115 /* side to node translation tables -
116 * These tables are used to look up the side number based on the
117 * first and second node in the side/face list. The side node order
118 * is found in the original Exodus document, SAND87-2997. The element
119 * node order is found in the ExodusII document, SAND92-2137. These
120 * tables were generated by following the right-hand rule for determining
121 * the outward normal.
122 */
123
124 extern const int tri_side_to_node_table[3][3] = {
125 // 1 2 3 side
126 {1,2,4}, {2,3,5}, {3,1,6} // nodes
127 };
128
129 extern const int quad_side_to_node_table[4][3] = {
130 // 1 2 3 4 side
131 {1,2,5}, {2,3,6}, {3,4,7}, {4,1,8} // nodes
132 };
133
134 extern const int shell_side_to_node_table[2][8] = {
135 // 1 2 side
136 {1,2,3,4,5,6,7,8}, {1,4,3,2,8,7,6,5} // nodes
137 };
138
139 extern const int tetra_side_to_node_table[4][7] = {
140 // 1 2 3 4 side
141 {1,2,4,5,9,8,13}, {2,3,4,6,10,9,14}, {1,4,3,8,10,7,15}, {1,3,2,7,6,5,12} // nodes
142 };
143
144 extern const int wedge_side_to_node_table[5][8] = {
145 // 1 2 3 side
146 {1,2,5,4,7,11,13,10}, {2,3,6,5,8,12,14,11}, {1,4,6,3,10,15,12,9}, // nodes
147 // 4 5 side
148 {1,3,2,0,9,8,7,0}, {4,5,6,0,13,14,15,0} // nodes
149 };
150
151 extern const int hex_side_to_node_table[6][8] = {
152 // 1 2 3 side
153 {1,2,6,5,9,14,17,13}, {2,3,7,6,10,15,18,14}, {3,4,8,7,11,16,19,15},// nodes
154 // 4 5 6 side
155 {1,5,8,4,13,20,16,12},{1,4,3,2,12,11,10,9}, {5,6,7,8,17,18,19,20} // nodes
156 };
157
158 extern const int face_bit_mask[6] = {1, 2, 4, 8, 16, 32};
159
160 const char* Element_Type_Names[NUM_ELEMENT_TYPES] = {
161 "UNKNOWN_ELEMENT",
162 "CIRCLE",
163 "SPHERE",
164 "QUAD4",
165 "QUAD8",
166 "QUAD9",
167 "TRI3",
168 "TRI6",
169 "TRI7",
170 "SHELL4",
171 "SHELL8",
172 "HEX8",
173 "HEX20",
174 "HEX27",
175 "TET4",
176 "TET8",
177 "TET10",
178 "TET15",
179 "WEDGE6",
180 "WEDGE18",
181 "BEAM2",
182 "BEAM3",
183 "TRUSS2",
184 "TRUSS3",
185 "STRUCT1D",
186 "STRUCT2D",
187 "STRUCT3D",
188 "SFACET3D",
189 "PYRAMID5",
190 "SEG2",
191 "SEG3" };
192
193 } // end namespace PAMGEN_NEVADA {
194