OGS
ProcessLib::LinearBMatrix::detail Namespace Reference

Functions

template<int NPOINTS, typename DNDX_Type, typename BMatrixType>
void fillBMatrix2DCartesianPart (DNDX_Type const &dNdx, BMatrixType &B)
template<int DisplacementDim, int NPOINTS, typename BBarMatrixType, typename BMatrixType>
void applyBbar (BBarMatrixType const &B_bar, BMatrixType &B, const bool is_axially_symmetric)

Function Documentation

◆ applyBbar()

template<int DisplacementDim, int NPOINTS, typename BBarMatrixType, typename BMatrixType>
void ProcessLib::LinearBMatrix::detail::applyBbar ( BBarMatrixType const & B_bar,
BMatrixType & B,
const bool is_axially_symmetric )

Definition at line 116 of file LinearBMatrix.h.

118{
119 if constexpr (DisplacementDim == 3)
120 {
121 for (int i = 0; i < NPOINTS; ++i)
122 {
123 auto const B_bar_i = B_bar.col(i);
124
125 // The following loop is based on the following facts:
126 // B1 (dN/dx) is the 1st element of the 1st column of B,
127 // B2 (dN/dy) is the 2nd element of the 2nd column of B,
128 // B3 (dN/dz) is the 3rd element of the 3rd column of B.
129 for (int k = 0; k < 3; k++)
130 {
131 // k-th column of B matrix at node i
132 auto B_i_k = B.col(k * NPOINTS + i);
133
134 B_i_k.template segment<3>(0) -=
135 Eigen::Vector3d::Constant((B_i_k[k] - B_bar_i[k]) / 3.0);
136 }
137 }
138
139 return;
140 }
141
142 // 2D or axisymmetry
143 for (int i = 0; i < NPOINTS; ++i)
144 {
145 auto B_i_0 = B.col(i);
146 auto B_i_1 = B.col(NPOINTS + i);
147
148 auto const B_bar_i = B_bar.col(i);
149
150 if (is_axially_symmetric)
151 {
152 double const b0_dil_pertubation =
153 (B_i_0[0] - B_bar_i[0] + B_i_0[2] - B_bar_i[2]);
154 B_i_0.template segment<3>(0) -=
155 Eigen::Vector3d::Constant((b0_dil_pertubation) / 3.);
156 B_i_1.template segment<3>(0) -=
157 Eigen::Vector3d::Constant((B_i_1[1] - B_bar_i[1]) / 3.);
158 continue;
159 }
160
161 // Plane strain
162 B_i_0.template segment<2>(0) -=
163 Eigen::Vector2d::Constant((B_i_0[0] - B_bar_i[0]) / 2.);
164 B_i_1.template segment<2>(0) -=
165 Eigen::Vector2d::Constant((B_i_1[1] - B_bar_i[1]) / 2.);
166 }
167}

Referenced by ProcessLib::LinearBMatrix::computeBMatrixPossiblyWithBbar().

◆ fillBMatrix2DCartesianPart()

template<int NPOINTS, typename DNDX_Type, typename BMatrixType>
void ProcessLib::LinearBMatrix::detail::fillBMatrix2DCartesianPart ( DNDX_Type const & dNdx,
BMatrixType & B )

Definition at line 19 of file LinearBMatrix.h.

20{
21 for (int i = 0; i < NPOINTS; ++i)
22 {
23 B(1, NPOINTS + i) = dNdx(1, i);
24 B(3, i) = dNdx(1, i) / std::sqrt(2);
25 B(3, NPOINTS + i) = dNdx(0, i) / std::sqrt(2);
26 B(0, i) = dNdx(0, i);
27 }
28}

Referenced by ProcessLib::LinearBMatrix::computeBMatrix().