Skip to content

Commit fd900b5

Browse files
authored
Merge pull request #3604 from roystgnr/l2_hierarchic_prism
Hierarchic (and L2_HIERARCHIC) FE prism support
2 parents c965dd6 + 9341cc9 commit fd900b5

9 files changed

Lines changed: 804 additions & 0 deletions

File tree

include/utils/number_lookups.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ extern const unsigned char cube_number_page[];
3333
extern const unsigned char tetrahedral_number_row[];
3434
extern const unsigned char tetrahedral_number_column[];
3535
extern const unsigned char tetrahedral_number_page[];
36+
extern const unsigned char prism_number_triangle[];
37+
extern const unsigned char prism_number_page[];
3638

3739
} // namespace libMesh
3840

src/fe/fe_hierarchic.C

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ unsigned int hierarchic_n_dofs(const ElemType t, const Order o)
123123
libmesh_fallthrough();
124124
case HEX27:
125125
return ((o+1)*(o+1)*(o+1));
126+
case PRISM6:
127+
case PRISM15:
128+
libmesh_assert_less (o, 2);
129+
libmesh_fallthrough();
130+
case PRISM18:
131+
libmesh_assert_less (o, 3);
132+
libmesh_fallthrough();
133+
case PRISM20:
134+
case PRISM21:
135+
return ((o+1)*(o+1)*(o+2)/2);
126136
case TRI3:
127137
libmesh_assert_less (o, 2);
128138
libmesh_fallthrough();
@@ -275,6 +285,59 @@ unsigned int hierarchic_n_dofs_at_node(const ElemType t,
275285
libmesh_error_msg("ERROR: Invalid node ID " << n << " selected for HEX8/20/27!");
276286
}
277287

288+
case PRISM6:
289+
libmesh_assert_less (n, 6);
290+
libmesh_fallthrough();
291+
case PRISM15:
292+
libmesh_assert_less (n, 15);
293+
libmesh_assert_less (o, 2);
294+
libmesh_fallthrough();
295+
case PRISM18:
296+
libmesh_assert_less (n, 18);
297+
libmesh_assert_less (o, 3);
298+
libmesh_fallthrough();
299+
case PRISM20:
300+
// Internal DoFs are associated with the elem on a Prism20, or
301+
// node 20 on a Prism21
302+
libmesh_assert_less (n, 20);
303+
libmesh_fallthrough();
304+
case PRISM21:
305+
libmesh_assert_less (n, 21);
306+
switch (n)
307+
{
308+
case 0:
309+
case 1:
310+
case 2:
311+
case 3:
312+
case 4:
313+
case 5:
314+
return 1;
315+
316+
case 6:
317+
case 7:
318+
case 8:
319+
case 9:
320+
case 10:
321+
case 11:
322+
case 12:
323+
case 13:
324+
case 14:
325+
return (o-1);
326+
327+
case 15:
328+
case 16:
329+
case 17:
330+
return ((o-1)*(o-1));
331+
332+
case 18:
333+
case 19:
334+
return ((o-1)*(o-2)/2);
335+
case 20:
336+
return ((o-1)*(o-1)*(o-2)/2);
337+
default:
338+
libmesh_error_msg("ERROR: Invalid node ID " << n << " selected for TRI!");
339+
}
340+
278341
case TET4:
279342
libmesh_assert_less (o, 2);
280343
libmesh_assert_less (n, 4);
@@ -353,6 +416,17 @@ unsigned int hierarchic_n_dofs_per_elem(const ElemType t,
353416
return 0;
354417
case HEX27:
355418
return ((o-1)*(o-1)*(o-1));
419+
case PRISM6:
420+
case PRISM15:
421+
libmesh_assert_less (o, 2);
422+
libmesh_fallthrough();
423+
case PRISM18:
424+
libmesh_assert_less (o, 3);
425+
return 0;
426+
case PRISM20:
427+
return ((o-1)*(o-1)*(o-2)/2);
428+
case PRISM21: // Store interior DoFs on interior node
429+
return 0;
356430
case TET4:
357431
libmesh_assert_less (o, 2);
358432
libmesh_fallthrough();

0 commit comments

Comments
 (0)