OGS
ShapeQuad4-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 ShapeQuad4::computeShapeFunction(const T_X& r, T_N& N)
8{
9 N[0] = (1.0 + r[0]) * (1.0 + r[1]) / 4;
10 N[1] = (1.0 - r[0]) * (1.0 + r[1]) / 4;
11 N[2] = (1.0 - r[0]) * (1.0 - r[1]) / 4;
12 N[3] = (1.0 + r[0]) * (1.0 - r[1]) / 4;
13}
14
15template <class T_X, class T_N>
16void ShapeQuad4::computeGradShapeFunction(const T_X& r, T_N& dN)
17{
18 dN[0] = +(1.0 + r[1]) / 4;
19 dN[1] = -(1.0 + r[1]) / 4;
20 dN[2] = -(1.0 - r[1]) / 4;
21 dN[3] = +(1.0 - r[1]) / 4;
22 dN[4] = +(1.0 + r[0]) / 4;
23 dN[5] = +(1.0 - r[0]) / 4;
24 dN[6] = -(1.0 - r[0]) / 4;
25 dN[7] = -(1.0 + r[0]) / 4;
26}
27
28} // namespace NumLib
static void computeGradShapeFunction(const T_X &r, T_N &dN)
static void computeShapeFunction(const T_X &r, T_N &N)