OGS
ShapePrism6-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 ShapePrism6::computeShapeFunction(const T_X& x, T_N& N)
8{
9 const double L1 = x[0];
10 const double L2 = x[1];
11 const double t = x[2];
12 N[0] = 0.5 * (1.0 - L1 - L2) * (1.0 - t);
13 N[1] = 0.5 * L1 * (1.0 - t);
14 N[2] = 0.5 * L2 * (1.0 - t);
15 N[3] = 0.5 * (1.0 - L1 - L2) * (1.0 + t);
16 N[4] = 0.5 * L1 * (1.0 + t);
17 N[5] = 0.5 * L2 * (1.0 + t);
18}
19
20template <class T_X, class T_N>
21void ShapePrism6::computeGradShapeFunction(const T_X& x, T_N& dN)
22{
23 const double L1 = x[0];
24 const double L2 = x[1];
25 const double t = x[2];
26 // dN/dL1
27 dN[0] = -0.5 * (1.0 - t);
28 dN[1] = -dN[0];
29 dN[2] = 0.0;
30 dN[3] = -0.5 * (1.0 + t);
31 dN[4] = -dN[3];
32 dN[5] = 0.0;
33 // dN/dL2
34 dN[6] = dN[0];
35 dN[7] = 0.0;
36 dN[8] = -dN[0];
37 dN[9] = dN[3];
38 dN[10] = 0.0;
39 dN[11] = -dN[3];
40 // dN/dt
41 dN[12] = -0.5 * (1.0 - L1 - L2);
42 dN[13] = -0.5 * L1;
43 dN[14] = -0.5 * L2;
44 dN[15] = -dN[12];
45 dN[16] = -dN[13];
46 dN[17] = -dN[14];
47}
48
49} // namespace NumLib
static void computeGradShapeFunction(const T_X &x, T_N &dN)
static void computeShapeFunction(const T_X &x, T_N &N)