OGS
ProcessLib::NonLinearBMatrix Namespace Reference

Functions

template<int DisplacementDim, int NPOINTS, typename BMatrixType, typename GradientVectorType, typename N_Type, typename DNDX_Type>
BMatrixType computeBMatrix (DNDX_Type const &dNdx, N_Type const &N, GradientVectorType const &grad_u, const double radius, const bool is_axially_symmetric)

Function Documentation

◆ computeBMatrix()

template<int DisplacementDim, int NPOINTS, typename BMatrixType, typename GradientVectorType, typename N_Type, typename DNDX_Type>
BMatrixType ProcessLib::NonLinearBMatrix::computeBMatrix ( DNDX_Type const & dNdx,
N_Type const & N,
GradientVectorType const & grad_u,
const double radius,
const bool is_axially_symmetric )

Fills a non linear B-matrix based on given shape function dN/dx values and displacement gradient.

Definition at line 22 of file NonLinearBMatrix.h.

27{
28 static_assert(0 < DisplacementDim && DisplacementDim <= 3,
29 "NonLinearBMatrix::computeBMatrix: DisplacementDim must be "
30 "in range [1,3].");
31
32 BMatrixType B = BMatrixType::Zero(
34 NPOINTS * DisplacementDim);
35
36 switch (DisplacementDim)
37 {
38 case 3:
39 for (int i = 0; i < NPOINTS; ++i)
40 {
41 B(0, i) = dNdx(0, i) * grad_u[0];
42 B(1, i) = dNdx(1, i) * grad_u[1];
43 B(2, i) = dNdx(2, i) * grad_u[2];
44
45 B(0, NPOINTS + i) = dNdx(0, i) * grad_u[3];
46 B(1, NPOINTS + i) = dNdx(1, i) * grad_u[4];
47 B(2, NPOINTS + i) = dNdx(2, i) * grad_u[5];
48
49 B(0, 2 * NPOINTS + i) = dNdx(0, i) * grad_u[6];
50 B(1, 2 * NPOINTS + i) = dNdx(1, i) * grad_u[7];
51 B(2, 2 * NPOINTS + i) = dNdx(2, i) * grad_u[8];
52
53 B(3, i) = (dNdx(1, i) * grad_u[0] + dNdx(0, i) * grad_u[1]) /
54 std::sqrt(2);
55 B(4, i) = (dNdx(2, i) * grad_u[1] + dNdx(1, i) * grad_u[2]) /
56 std::sqrt(2);
57 B(5, i) = (dNdx(2, i) * grad_u[0] + dNdx(0, i) * grad_u[2]) /
58 std::sqrt(2);
59
60 B(3, NPOINTS + i) =
61 (dNdx(1, i) * grad_u[3] + dNdx(0, i) * grad_u[4]) /
62 std::sqrt(2);
63 B(4, NPOINTS + i) =
64 (dNdx(2, i) * grad_u[4] + dNdx(1, i) * grad_u[5]) /
65 std::sqrt(2);
66 B(5, NPOINTS + i) =
67 (dNdx(2, i) * grad_u[3] + dNdx(0, i) * grad_u[5]) /
68 std::sqrt(2);
69
70 B(3, 2 * NPOINTS + i) =
71 (dNdx(1, i) * grad_u[6] + dNdx(0, i) * grad_u[7]) /
72 std::sqrt(2);
73 B(4, 2 * NPOINTS + i) =
74 (dNdx(2, i) * grad_u[7] + dNdx(1, i) * grad_u[8]) /
75 std::sqrt(2);
76 B(5, 2 * NPOINTS + i) =
77 (dNdx(2, i) * grad_u[6] + dNdx(0, i) * grad_u[8]) /
78 std::sqrt(2);
79 }
80 break;
81 case 2:
82 for (int i = 0; i < NPOINTS; ++i)
83 {
84 B(0, i) = dNdx(0, i) * grad_u[0];
85 B(1, i) = dNdx(1, i) * grad_u[1];
86 // B(2, i) = 0;
87
88 B(0, NPOINTS + i) = dNdx(0, i) * grad_u[2];
89 B(1, NPOINTS + i) = dNdx(1, i) * grad_u[3];
90 // B(2, NPOINTS + i) = 0;
91
92 B(3, i) = (dNdx(1, i) * grad_u[0] + dNdx(0, i) * grad_u[1]) /
93 std::sqrt(2);
94 B(3, NPOINTS + i) =
95 (dNdx(1, i) * grad_u[2] + dNdx(0, i) * grad_u[3]) /
96 std::sqrt(2);
97 }
98 if (is_axially_symmetric)
99 {
100 for (int i = 0; i < NPOINTS; ++i)
101 {
102 B(2, i) = grad_u[4] * N[i] / radius;
103 }
104 }
105 break;
106 default:
107 break;
108 }
109
110 return B;
111}
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.

References MathLib::KelvinVector::kelvin_vector_dimensions().

Referenced by ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), and ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete().