OGS
ShapeHex8-impl.h
Go to the documentation of this file.
1
11namespace NumLib
12{
13template <class T_X, class T_N>
14void ShapeHex8::computeShapeFunction(const T_X& r, T_N& N)
15{
16 N[0] = (1.0 - r[0]) * (1.0 - r[1]) * (1.0 - r[2]) * 0.125;
17 N[1] = (1.0 + r[0]) * (1.0 - r[1]) * (1.0 - r[2]) * 0.125;
18 N[2] = (1.0 + r[0]) * (1.0 + r[1]) * (1.0 - r[2]) * 0.125;
19 N[3] = (1.0 - r[0]) * (1.0 + r[1]) * (1.0 - r[2]) * 0.125;
20 N[4] = (1.0 - r[0]) * (1.0 - r[1]) * (1.0 + r[2]) * 0.125;
21 N[5] = (1.0 + r[0]) * (1.0 - r[1]) * (1.0 + r[2]) * 0.125;
22 N[6] = (1.0 + r[0]) * (1.0 + r[1]) * (1.0 + r[2]) * 0.125;
23 N[7] = (1.0 - r[0]) * (1.0 + r[1]) * (1.0 + r[2]) * 0.125;
24}
25
26template <class T_X, class T_N>
27void ShapeHex8::computeGradShapeFunction(const T_X& r, T_N& dN)
28{
29 // dN/dx
30 dN[0] = -(1.0 - r[1]) * (1.0 - r[2]) * 0.125;
31 dN[1] = -dN[0];
32 dN[2] = +(1.0 + r[1]) * (1.0 - r[2]) * 0.125;
33 dN[3] = -dN[2];
34 dN[4] = -(1.0 - r[1]) * (1.0 + r[2]) * 0.125;
35 dN[5] = -dN[4];
36 dN[6] = +(1.0 + r[1]) * (1.0 + r[2]) * 0.125;
37 dN[7] = -dN[6];
38
39 // dN/dy
40 dN[8] = -(1.0 - r[0]) * (1.0 - r[2]) * 0.125;
41 dN[9] = -(1.0 + r[0]) * (1.0 - r[2]) * 0.125;
42 dN[10] = -dN[9];
43 dN[11] = -dN[8];
44 dN[12] = -(1.0 - r[0]) * (1.0 + r[2]) * 0.125;
45 dN[13] = -(1.0 + r[0]) * (1.0 + r[2]) * 0.125;
46 dN[14] = -dN[13];
47 dN[15] = -dN[12];
48
49 // dN/dz
50 dN[16] = -(1.0 - r[0]) * (1.0 - r[1]) * 0.125;
51 dN[17] = -(1.0 + r[0]) * (1.0 - r[1]) * 0.125;
52 dN[18] = -(1.0 + r[0]) * (1.0 + r[1]) * 0.125;
53 dN[19] = -(1.0 - r[0]) * (1.0 + r[1]) * 0.125;
54 dN[20] = -dN[16];
55 dN[21] = -dN[17];
56 dN[22] = -dN[18];
57 dN[23] = -dN[19];
58}
59
60} // namespace NumLib
static void computeGradShapeFunction(const T_X &r, T_N &dN)
static void computeShapeFunction(const T_X &r, T_N &N)