OGS
NumLib::ShapeHex20 Class Reference

Detailed Description

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

Definition at line 21 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 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 42 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 92 of file ShapeHex20-impl.h.

93{
94 const double r = rst[0];
95 const double s = rst[1];
96 const double t = rst[2];
97 const static double sign1[] = {-1.0, 1.0, 1.0};
98 const static double sign2[] = {1.0, -1.0, 1.0};
99 const static double sign3[] = {1.0, 1.0, -1.0};
100 for (int i = 0; i < 3; i++)
101 {
102 dN[20 * i + 0] = dShapeFunctionHexHQ_Corner(r, s, t, i);
103 dN[20 * i + 1] = sign1[i] * dShapeFunctionHexHQ_Corner(-r, s, t, i);
104 dN[20 * i + 2] =
105 sign1[i] * sign2[i] * dShapeFunctionHexHQ_Corner(-r, -s, t, i);
106 dN[20 * i + 3] = sign2[i] * dShapeFunctionHexHQ_Corner(r, -s, t, i);
107 dN[20 * i + 4] = sign3[i] * dShapeFunctionHexHQ_Corner(r, s, -t, i);
108 dN[20 * i + 5] =
109 sign1[i] * sign3[i] * dShapeFunctionHexHQ_Corner(-r, s, -t, i);
110 dN[20 * i + 6] = sign1[i] * sign2[i] * sign3[i] *
111 dShapeFunctionHexHQ_Corner(-r, -s, -t, i);
112 dN[20 * i + 7] =
113 sign2[i] * sign3[i] * dShapeFunctionHexHQ_Corner(r, -s, -t, i);
114
115 dN[20 * i + 8] = dShapeFunctionHexHQ_Middle(r, s, t, i);
116 dN[20 * i + 10] = sign2[i] * dShapeFunctionHexHQ_Middle(r, -s, t, i);
117 dN[20 * i + 14] =
118 sign2[i] * sign3[i] * dShapeFunctionHexHQ_Middle(r, -s, -t, i);
119 dN[20 * i + 12] = sign3[i] * dShapeFunctionHexHQ_Middle(r, s, -t, i);
120
121 {
122 int const co = (i + 2) % 3;
123 dN[20 * i + 11] = dShapeFunctionHexHQ_Middle(s, t, r, co);
124 dN[20 * i + 15] =
125 sign3[i] * dShapeFunctionHexHQ_Middle(s, -t, r, co);
126 dN[20 * i + 13] =
127 sign1[i] * sign3[i] * dShapeFunctionHexHQ_Middle(s, -t, -r, co);
128 dN[20 * i + 9] =
129 sign1[i] * dShapeFunctionHexHQ_Middle(s, t, -r, co);
130 }
131
132 {
133 int const co = (i + 1) % 3;
134 dN[20 * i + 16] = dShapeFunctionHexHQ_Middle(t, r, s, co);
135 dN[20 * i + 17] =
136 sign1[i] * dShapeFunctionHexHQ_Middle(t, -r, s, co);
137 dN[20 * i + 18] =
138 sign1[i] * sign2[i] * dShapeFunctionHexHQ_Middle(t, -r, -s, co);
139 dN[20 * i + 19] =
140 sign2[i] * dShapeFunctionHexHQ_Middle(t, r, -s, co);
141 }
142 }
143}
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 60 of file ShapeHex20-impl.h.

61{
62 const double r = rst[0];
63 const double s = rst[1];
64 const double t = rst[2];
65
66 N[0] = ShapeFunctionHexHQ_Corner(r, s, t);
67 N[1] = ShapeFunctionHexHQ_Corner(-r, s, t);
68 N[2] = ShapeFunctionHexHQ_Corner(-r, -s, t);
69 N[3] = ShapeFunctionHexHQ_Corner(r, -s, t);
70 N[4] = ShapeFunctionHexHQ_Corner(r, s, -t);
71 N[5] = ShapeFunctionHexHQ_Corner(-r, s, -t);
72 N[6] = ShapeFunctionHexHQ_Corner(-r, -s, -t);
73 N[7] = ShapeFunctionHexHQ_Corner(r, -s, -t);
74
75 N[8] = ShapeFunctionHexHQ_Middle(r, s, t);
76 N[10] = ShapeFunctionHexHQ_Middle(r, -s, t);
77 N[14] = ShapeFunctionHexHQ_Middle(r, -s, -t);
78 N[12] = ShapeFunctionHexHQ_Middle(r, s, -t);
79
80 N[11] = ShapeFunctionHexHQ_Middle(s, t, r);
81 N[15] = ShapeFunctionHexHQ_Middle(s, -t, r);
82 N[13] = ShapeFunctionHexHQ_Middle(s, -t, -r);
83 N[9] = ShapeFunctionHexHQ_Middle(s, t, -r);
84
85 N[16] = ShapeFunctionHexHQ_Middle(t, r, s);
86 N[17] = ShapeFunctionHexHQ_Middle(t, -r, s);
87 N[18] = ShapeFunctionHexHQ_Middle(t, -r, -s);
88 N[19] = ShapeFunctionHexHQ_Middle(t, r, -s);
89}
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 43 of file ShapeHex20.h.

◆ NPOINTS

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

Definition at line 44 of file ShapeHex20.h.

◆ ORDER

int NumLib::ShapeHex20::ORDER = 2
staticconstexpr

Definition at line 45 of file ShapeHex20.h.


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