-
Notifications
You must be signed in to change notification settings - Fork 292
/
Copy pathcell_inf_hex18.h
304 lines (243 loc) · 9.71 KB
/
cell_inf_hex18.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
// The libMesh Finite Element Library.
// Copyright (C) 2002-2022 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef LIBMESH_CELL_INF_HEX18_H
#define LIBMESH_CELL_INF_HEX18_H
#include "libmesh/libmesh_config.h"
#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
// Local includes
#include "libmesh/cell_inf_hex.h"
namespace libMesh
{
/**
* The \p InfHex18 is an infinite element in 3D composed of 18 nodes.
* It is numbered like this:
* \verbatim
* INFHEX18: 7 14 6
* o o o closer to infinity
* : : |
* : : |
* : : |
* 15 : 17 : 13 |
* o : o : o |
* : : : | |
* : : : | |
* : : : | |
* 4 : : 12 : 5 | |
* o : : o : o | |
* | : : | : | | |
* | : : | : | | |
* | : : | 10: | | |
* | : 3o....|.........o....|....|....o
* | : . | | | / 2
* | : . | | | /
* | : . | | | /
* | :. | | |/
* | 11o | 16o | o base face
* | . | | / 9
* | . | | /
* | . | | /
* |. | |/
* o--------------o--------------o
* 0 8 1
* \endverbatim
*
* \author Daniel Dreyer
* \date 2002
* \brief A 3D infinite hexahedral element with 18 nodes.
*/
class InfHex18 final : public InfHex
{
public:
/**
* Constructor. By default this element has no parent.
*/
explicit
InfHex18 (Elem * p=nullptr) :
InfHex(InfHex18::n_nodes(), p, _nodelinks_data)
{}
InfHex18 (InfHex18 &&) = delete;
InfHex18 (const InfHex18 &) = delete;
InfHex18 & operator= (const InfHex18 &) = delete;
InfHex18 & operator= (InfHex18 &&) = delete;
virtual ~InfHex18() = default;
/**
* \returns 18. The \p InfHex18 has 18 nodes.
*/
virtual unsigned int n_nodes() const override { return num_nodes; }
/**
* \returns \p INFHEX18.
*/
virtual ElemType type () const override { return INFHEX18; }
/**
* \returns 4.
*/
virtual unsigned int n_sub_elem() const override { return 4; }
/**
* \returns SECOND.
*/
virtual Order default_order() const override;
/**
* \returns \p true if the specified (local) node number is a vertex.
*/
virtual bool is_vertex(const unsigned int i) const override;
/**
* \returns \p true if the specified (local) node number is an edge.
*/
virtual bool is_edge(const unsigned int i) const override;
/**
* \returns \p true if the specified (local) node number is a face.
*/
virtual bool is_face(const unsigned int i) const override;
/**
* \returns \p true if the specified (local) node number is on the
* specified side.
*/
virtual bool is_node_on_side(const unsigned int n,
const unsigned int s) const override;
virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;
virtual const unsigned int * nodes_on_side_ptr(const unsigned short s) const override final
{ return this->_nodes_on_side_ptr<InfHex18>(s); }
virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;
virtual const unsigned int * nodes_on_edge_ptr(const unsigned short e) const override final
{ return this->_nodes_on_edge_ptr<InfHex18>(e); }
/**
* \returns \p true if the specified (local) node number is on the
* specified edge.
*/
virtual bool is_node_on_edge(const unsigned int n,
const unsigned int e) const override;
/**
* \returns A \p QUAD9 built coincident with face 0, or an \p INFQUAD6
* built coincident with faces 1 to 4.
*
* \note The \p std::unique_ptr<Elem> takes care of freeing memory.
*/
virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i,
bool proxy=false) override;
/**
* Rebuilds a \p QUAD9 built coincident with face 0, or an \p
* INFQUAD6 built coincident with faces 1 to 4.
*/
virtual void build_side_ptr (std::unique_ptr<Elem> & elem,
const unsigned int i) override;
/**
* \returns An \p EDGE3 built coincident with edges 0-3, or an \p INFEDGE2
* built coincident with edges 4 to 11.
*
* \note that the \p std::unique_ptr<Elem> takes care of freeing memory.
*/
virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int i) override;
/**
* Rebuilds a \p EDGE3 built coincident with edges 0 to 3, or \p
* INFEDGE2 built coincident with edges 4 to 11.
*/
virtual void build_edge_ptr (std::unique_ptr<Elem> & edge, const unsigned int i) override;
/**
* Don't hide Elem::key() defined in the base class.
*/
using Elem::key;
/**
* \returns An id associated with the \p s side of this element.
* The id is not necessarily unique, but should be close. This is
* particularly useful in the \p MeshBase::find_neighbors() routine.
*
* We reimplement this method here for the \p InfHex18 since we can
* use the center node of the bottom face to provide a perfect (unique)
* key.
*/
virtual dof_id_type key (const unsigned int s) const override;
/**
* \returns \p InfHex18::side_nodes_map[side][side_node] after doing some range checking.
*/
virtual unsigned int local_side_node(unsigned int side,
unsigned int side_node) const override;
/**
* \returns \p InfHex18::edge_nodes_map[edge][edge_node] after doing some range checking.
*/
virtual unsigned int local_edge_node(unsigned int edge,
unsigned int edge_node) const override;
virtual void connectivity(const unsigned int sc,
const IOPackage iop,
std::vector<dof_id_type> & conn) const override;
unsigned int vtk_element_type (const unsigned int) const
{ return 12; }
/**
* \returns 2 for all edge nodes, 4 for face nodes.
*/
virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const override;
/**
* \returns The element-local number of the \f$ v^{th} \f$ vertex
* that defines the \f$ n^{th} \f$ second-order node.
*
* \note \p n is counted as depicted above, \f$ 8 \le n < 18 \f$.
*/
virtual unsigned short int second_order_adjacent_vertex (const unsigned int n,
const unsigned int v) const override;
/**
* \returns The child number \p c and element-local index \p v of the
* \f$ n^{th} \f$ second-order node on the parent element. See
* elem.h for further details.
*/
virtual std::pair<unsigned short int, unsigned short int>
second_order_child_vertex (const unsigned int n) const override;
/**
* Geometric constants for InfHex18.
*/
static const int num_nodes = 18;
static const int num_sides = 5;
static const int num_edges = 8;
static const int num_children = 4;
static const int nodes_per_side = 9;
static const int nodes_per_edge = 3;
/**
* This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ side to
* element node numbers.
*/
static const unsigned int side_nodes_map[num_sides][nodes_per_side];
/**
* This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ edge to
* element node numbers.
*/
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge];
virtual void permute(unsigned int perm_num) override final;
virtual void flip(BoundaryInfo *) override final;
ElemType side_type (const unsigned int s) const override final;
virtual unsigned int n_nodes_on_side(const unsigned short s) const override final
{ return this->_n_nodes_on_side<InfHex18, 3>(s); }
virtual unsigned int n_nodes_on_edge(const unsigned short e) const override final
{ return this->_n_nodes_on_edge_constant<InfHex18>(e) - ((e < 4) ? 0 : 1); }
protected:
/**
* Data for links to nodes.
*/
Node * _nodelinks_data[num_nodes];
#ifdef LIBMESH_ENABLE_AMR
/**
* Matrix used to create the elements children.
*/
virtual Real embedding_matrix (const unsigned int i,
const unsigned int j,
const unsigned int k) const override
{ return _embedding_matrix[i][j][k]; }
/**
* Matrix that computes new nodal locations/solution values
* from current nodes/solution.
*/
static const Real _embedding_matrix[num_children][num_nodes][num_nodes];
LIBMESH_ENABLE_TOPOLOGY_CACHES;
#endif // LIBMESH_ENABLE_AMR
};
} // namespace libMesh
#endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
#endif // LIBMESH_CELL_INF_HEX18_H