OGS
NumLib::ShapePrism15 Class Reference

Detailed Description

Shape function for a 15-nodes prism element in natural coordinates

Definition at line 15 of file ShapePrism15.h.

#include <ShapePrism15.h>

Public Types

using MeshElement = MeshLib::Prism15

Static Public Member Functions

template<class T_X, class T_N>
static void computeShapeFunction (const T_X &x, T_N &N)
template<class T_X, class T_N>
static void computeGradShapeFunction (const T_X &x, T_N &dN)

Static Public Attributes

static constexpr std::array reference_element_centre
static const unsigned DIM = MeshElement::dimension
static const unsigned NPOINTS = MeshElement::n_all_nodes
static constexpr int ORDER = 2

Member Typedef Documentation

◆ MeshElement

Member Function Documentation

◆ computeGradShapeFunction()

template<class T_X, class T_N>
void NumLib::ShapePrism15::computeGradShapeFunction ( const T_X & x,
T_N & dN )
static

Evaluate derivatives of the shape function at the given point

Parameters
[in]xnatural coordinates (r,s,t)
[out]dNa matrix of the derivatives

Definition at line 45 of file ShapePrism15-impl.h.

46{
47 const double L1 = x[0];
48 const double L2 = x[1];
49 const double L0 = 1.0 - L1 - L2;
50 const double t = x[2];
51 const double tt1 = 1.0 - t * t;
52
53 //---dN/dL1
54 double v1 = (4.0 * L0 - 1);
55 double v2 = (4.0 * L1 - 1);
56 // Vertex, bottom
57 dN[0] = -0.5 * (v1 * (1.0 - t) - tt1);
58 dN[1] = 0.5 * (v2 * (1.0 - t) - tt1);
59 dN[2] = 0.0;
60 // Vertex, top
61 dN[3] = -0.5 * (v1 * (1.0 + t) - tt1);
62 dN[4] = 0.5 * (v2 * (1.0 + t) - tt1);
63 dN[5] = 0.0;
64 // Middle point, bottom
65 dN[6] = 2.0 * (L0 - L1) * (1.0 - t);
66 dN[7] = 2.0 * L2 * (1.0 - t);
67 dN[8] = -dN[7];
68 // Middle point, top
69 dN[9] = 2.0 * (L0 - L1) * (1.0 + t);
70 dN[10] = 2.0 * L2 * (1.0 + t);
71 dN[11] = -dN[10];
72 // Middle point, center
73 dN[12] = -tt1;
74 dN[13] = tt1;
75 dN[14] = 0.0;
76
77 //---dN/dL2
78 v1 = (4.0 * L2 - 1);
79 // Vertex, bottom
80 dN[15] = dN[0];
81 dN[16] = 0.0;
82 dN[17] = 0.5 * (v1 * (1.0 - t) - tt1);
83 // Vertex, top
84 dN[18] = dN[3];
85 dN[19] = 0.0;
86 dN[20] = 0.5 * (v1 * (1.0 + t) - tt1);
87 // Middle point, bottom
88 dN[21] = -2.0 * L1 * (1.0 - t);
89 dN[22] = -dN[21];
90 v1 = 2.0 * (L0 - L2);
91 dN[23] = v1 * (1.0 - t);
92 // Middle point, top
93 dN[24] = -2.0 * L1 * (1.0 + t);
94 dN[25] = -dN[24];
95 dN[26] = v1 * (1.0 + t);
96 // Middle point, center
97 dN[27] = -tt1;
98 dN[28] = 0.0;
99 dN[29] = tt1;
100
101 //---dN/dt
102 v1 = 2.0 * L0 - 1;
103 v2 = 2.0 * L1 - 1;
104 double v3 = 2.0 * L2 - 1;
105 // Vertex, bottom
106 dN[30] = 0.5 * L0 * (-v1 + 2.0 * t);
107 dN[31] = 0.5 * L1 * (-v2 + 2.0 * t);
108 dN[32] = 0.5 * L2 * (-v3 + 2.0 * t);
109 // Vertex, top
110 dN[33] = 0.5 * L0 * (v1 + 2.0 * t);
111 dN[34] = 0.5 * L1 * (v2 + 2.0 * t);
112 dN[35] = 0.5 * L2 * (v3 + 2.0 * t);
113 // Middle point, bottom
114 dN[36] = -2.0 * L0 * L1;
115 dN[37] = -2.0 * L1 * L2;
116 dN[38] = -2.0 * L2 * L0;
117 // Middle point, top
118 dN[39] = -dN[36];
119 dN[40] = -dN[37];
120 dN[41] = -dN[38];
121 // Middle point, center
122 dN[42] = -2.0 * L0 * t;
123 dN[43] = -2.0 * L1 * t;
124 dN[44] = -2.0 * L2 * t;
125}

◆ computeShapeFunction()

template<class T_X, class T_N>
void NumLib::ShapePrism15::computeShapeFunction ( const T_X & x,
T_N & N )
static

Evaluate the shape function at the given point

Parameters
[in]xnatural coordinates (r,s,t)
[out]Na vector of calculated shape functions

Definition at line 7 of file ShapePrism15-impl.h.

8{
9 const double L1 = x[0];
10 const double L2 = x[1];
11 const double L0 = 1.0 - L1 - L2;
12 const double t = x[2];
13 const double tt1 = 1.0 - t * t;
14
15 double v1 = 2.0 * L0 - 1;
16 double v2 = 2.0 * L1 - 1;
17 double v3 = 2.0 * L2 - 1;
18 // Vertex, bottom
19 N[0] = 0.5 * L0 * (v1 * (1.0 - t) - tt1);
20 N[1] = 0.5 * L1 * (v2 * (1.0 - t) - tt1);
21 N[2] = 0.5 * L2 * (v3 * (1.0 - t) - tt1);
22 // Vertex, top
23 N[3] = 0.5 * L0 * (v1 * (1.0 + t) - tt1);
24 N[4] = 0.5 * L1 * (v2 * (1.0 + t) - tt1);
25 N[5] = 0.5 * L2 * (v3 * (1.0 + t) - tt1);
26
27 v1 = 2.0 * L0 * L1;
28 v2 = 2.0 * L1 * L2;
29 v3 = 2.0 * L2 * L0;
30 // Middle point, bottom
31 N[6] = v1 * (1.0 - t);
32 N[7] = v2 * (1.0 - t);
33 N[8] = v3 * (1.0 - t);
34 // Middle point, top
35 N[9] = v1 * (1.0 + t);
36 N[10] = v2 * (1.0 + t);
37 N[11] = v3 * (1.0 + t);
38 // Middle point, center
39 N[12] = L0 * tt1;
40 N[13] = L1 * tt1;
41 N[14] = L2 * tt1;
42}

References NumLib::N.

Member Data Documentation

◆ DIM

const unsigned NumLib::ShapePrism15::DIM = MeshElement::dimension
static

Definition at line 40 of file ShapePrism15.h.

◆ NPOINTS

const unsigned NumLib::ShapePrism15::NPOINTS = MeshElement::n_all_nodes
static

Definition at line 41 of file ShapePrism15.h.

◆ ORDER

int NumLib::ShapePrism15::ORDER = 2
staticconstexpr

Definition at line 42 of file ShapePrism15.h.

◆ reference_element_centre

std::array NumLib::ShapePrism15::reference_element_centre
staticconstexpr
Initial value:
= {1. / 3., 1. / 3.,
0.0}

Definition at line 36 of file ShapePrism15.h.

36 {1. / 3., 1. / 3.,
37 0.0};

The documentation for this class was generated from the following files: