OGS
NumLib::ShapeHex20 Class Reference

Detailed Description

Shape function for a 20-nodes hex element in natural coordinates

Definition at line 16 of file ShapeHex20.h.

#include <ShapeHex20.h>

Public Types

using MeshElement = MeshLib::Hex20

Static Public Member Functions

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

Static Public Attributes

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

Member Typedef Documentation

◆ MeshElement

Definition at line 39 of file ShapeHex20.h.

Member Function Documentation

◆ computeGradShapeFunction()

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

Evaluate derivatives of the shape function at the given point

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

Definition at line 85 of file ShapeHex20-impl.h.

86{
87 const double r = rst[0];
88 const double s = rst[1];
89 const double t = rst[2];
90 const static double sign1[] = {-1.0, 1.0, 1.0};
91 const static double sign2[] = {1.0, -1.0, 1.0};
92 const static double sign3[] = {1.0, 1.0, -1.0};
93 for (int i = 0; i < 3; i++)
94 {
95 dN[20 * i + 0] = dShapeFunctionHexHQ_Corner(r, s, t, i);
96 dN[20 * i + 1] = sign1[i] * dShapeFunctionHexHQ_Corner(-r, s, t, i);
97 dN[20 * i + 2] =
98 sign1[i] * sign2[i] * dShapeFunctionHexHQ_Corner(-r, -s, t, i);
99 dN[20 * i + 3] = sign2[i] * dShapeFunctionHexHQ_Corner(r, -s, t, i);
100 dN[20 * i + 4] = sign3[i] * dShapeFunctionHexHQ_Corner(r, s, -t, i);
101 dN[20 * i + 5] =
102 sign1[i] * sign3[i] * dShapeFunctionHexHQ_Corner(-r, s, -t, i);
103 dN[20 * i + 6] = sign1[i] * sign2[i] * sign3[i] *
104 dShapeFunctionHexHQ_Corner(-r, -s, -t, i);
105 dN[20 * i + 7] =
106 sign2[i] * sign3[i] * dShapeFunctionHexHQ_Corner(r, -s, -t, i);
107
108 dN[20 * i + 8] = dShapeFunctionHexHQ_Middle(r, s, t, i);
109 dN[20 * i + 10] = sign2[i] * dShapeFunctionHexHQ_Middle(r, -s, t, i);
110 dN[20 * i + 14] =
111 sign2[i] * sign3[i] * dShapeFunctionHexHQ_Middle(r, -s, -t, i);
112 dN[20 * i + 12] = sign3[i] * dShapeFunctionHexHQ_Middle(r, s, -t, i);
113
114 {
115 int const co = (i + 2) % 3;
116 dN[20 * i + 11] = dShapeFunctionHexHQ_Middle(s, t, r, co);
117 dN[20 * i + 15] =
118 sign3[i] * dShapeFunctionHexHQ_Middle(s, -t, r, co);
119 dN[20 * i + 13] =
120 sign1[i] * sign3[i] * dShapeFunctionHexHQ_Middle(s, -t, -r, co);
121 dN[20 * i + 9] =
122 sign1[i] * dShapeFunctionHexHQ_Middle(s, t, -r, co);
123 }
124
125 {
126 int const co = (i + 1) % 3;
127 dN[20 * i + 16] = dShapeFunctionHexHQ_Middle(t, r, s, co);
128 dN[20 * i + 17] =
129 sign1[i] * dShapeFunctionHexHQ_Middle(t, -r, s, co);
130 dN[20 * i + 18] =
131 sign1[i] * sign2[i] * dShapeFunctionHexHQ_Middle(t, -r, -s, co);
132 dN[20 * i + 19] =
133 sign2[i] * dShapeFunctionHexHQ_Middle(t, r, -s, co);
134 }
135 }
136}
double dShapeFunctionHexHQ_Corner(const double r, const double s, const double t, const int ty)
double dShapeFunctionHexHQ_Middle(const double r, const double s, const double t, const int ty)

◆ computeShapeFunction()

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

Evaluate the shape function at the given point

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

Definition at line 53 of file ShapeHex20-impl.h.

54{
55 const double r = rst[0];
56 const double s = rst[1];
57 const double t = rst[2];
58
59 N[0] = ShapeFunctionHexHQ_Corner(r, s, t);
60 N[1] = ShapeFunctionHexHQ_Corner(-r, s, t);
61 N[2] = ShapeFunctionHexHQ_Corner(-r, -s, t);
62 N[3] = ShapeFunctionHexHQ_Corner(r, -s, t);
63 N[4] = ShapeFunctionHexHQ_Corner(r, s, -t);
64 N[5] = ShapeFunctionHexHQ_Corner(-r, s, -t);
65 N[6] = ShapeFunctionHexHQ_Corner(-r, -s, -t);
66 N[7] = ShapeFunctionHexHQ_Corner(r, -s, -t);
67
68 N[8] = ShapeFunctionHexHQ_Middle(r, s, t);
69 N[10] = ShapeFunctionHexHQ_Middle(r, -s, t);
70 N[14] = ShapeFunctionHexHQ_Middle(r, -s, -t);
71 N[12] = ShapeFunctionHexHQ_Middle(r, s, -t);
72
73 N[11] = ShapeFunctionHexHQ_Middle(s, t, r);
74 N[15] = ShapeFunctionHexHQ_Middle(s, -t, r);
75 N[13] = ShapeFunctionHexHQ_Middle(s, -t, -r);
76 N[9] = ShapeFunctionHexHQ_Middle(s, t, -r);
77
78 N[16] = ShapeFunctionHexHQ_Middle(t, r, s);
79 N[17] = ShapeFunctionHexHQ_Middle(t, -r, s);
80 N[18] = ShapeFunctionHexHQ_Middle(t, -r, -s);
81 N[19] = ShapeFunctionHexHQ_Middle(t, r, -s);
82}
double ShapeFunctionHexHQ_Corner(const double r, const double s, const double t)
double ShapeFunctionHexHQ_Middle(const double r, const double s, const double t)

References NumLib::N.

Member Data Documentation

◆ DIM

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

Definition at line 40 of file ShapeHex20.h.

◆ NPOINTS

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

Definition at line 41 of file ShapeHex20.h.

◆ ORDER

int NumLib::ShapeHex20::ORDER = 2
staticconstexpr

Definition at line 42 of file ShapeHex20.h.

◆ reference_element_centre

std::array NumLib::ShapeHex20::reference_element_centre = {0.0, 0.0, 0.0}
staticconstexpr

Definition at line 37 of file ShapeHex20.h.

37{0.0, 0.0, 0.0};

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