OGS
ShapePyra5-impl.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4namespace NumLib
5{
6template <class T_X, class T_N>
7void ShapePyra5::computeShapeFunction(const T_X& x, T_N& N)
8{
9 const double r = x[0];
10 const double s = x[1];
11 const double t = x[2];
12
13 N[0] = 0.125 * (1 - r) * (1 - s) * (1 - t);
14 N[1] = 0.125 * (1 + r) * (1 - s) * (1 - t);
15 N[2] = 0.125 * (1 + r) * (1 + s) * (1 - t);
16 N[3] = 0.125 * (1 - r) * (1 + s) * (1 - t);
17 N[4] = 0.5 * (1 + t);
18}
19
20template <class T_X, class T_N>
21void ShapePyra5::computeGradShapeFunction(const T_X& x, T_N& dN)
22{
23 const double r = x[0];
24 const double s = x[1];
25 const double t = x[2];
26 // dN/dL1
27 dN[0] = -0.125 * (1.0 - s) * (1.0 - t);
28 dN[1] = -dN[0];
29 dN[2] = 0.125 * (1.0 + s) * (1.0 - t);
30 dN[3] = -dN[2];
31 dN[4] = 0.0;
32 // dN/dL2
33 dN[5] = -0.125 * (1.0 - r) * (1.0 - t);
34 dN[6] = -0.125 * (1.0 + r) * (1.0 - t);
35 dN[7] = -dN[6];
36 dN[8] = -dN[5];
37 dN[9] = 0.0;
38 // dN/dt
39 dN[10] = -0.125 * (1.0 - r) * (1.0 - s);
40 dN[11] = -0.125 * (1.0 + r) * (1.0 - s);
41 dN[12] = -0.125 * (1.0 + r) * (1.0 + s);
42 dN[13] = -0.125 * (1.0 - r) * (1.0 + s);
43 dN[14] = 0.5;
44}
45
46} // namespace NumLib
static void computeGradShapeFunction(const T_X &x, T_N &dN)
static void computeShapeFunction(const T_X &x, T_N &N)