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 141 of file LinearBMatrix.h.

143{
144 if constexpr (DisplacementDim == 3)
145 {
146 for (int i = 0; i < NPOINTS; ++i)
147 {
148 auto const B_bar_i = B_bar.col(i);
149
150 // The following loop is based on the following facts:
151 // B1 (dN/dx) is the 1st element of the 1st column of B,
152 // B2 (dN/dy) is the 2nd element of the 2nd column of B,
153 // B3 (dN/dz) is the 3rd element of the 3rd column of B.
154 for (int k = 0; k < 3; k++)
155 {
156 // k-th column of B matrix at node i
157 auto B_i_k = B.col(k * NPOINTS + i);
158
159 B_i_k.template segment<3>(0) -=
160 Eigen::Vector3d::Constant((B_i_k[k] - B_bar_i[k]) / 3.0);
161 }
162 }
163
164 return;
165 }
166
167 // 2D or axisymmetry
168 for (int i = 0; i < NPOINTS; ++i)
169 {
170 auto B_i_0 = B.col(i);
171 auto B_i_1 = B.col(NPOINTS + i);
172
173 auto const B_bar_i = B_bar.col(i);
174
175 double const b0_dil_pertubation =
176 is_axially_symmetric
177 ? (B_i_0[0] - B_bar_i[0] + B_i_0[2] - B_bar_i[2])
178 : (B_i_0[0] - B_bar_i[0]);
179
180 B_i_0.template segment<3>(0) -=
181 Eigen::Vector3d::Constant((b0_dil_pertubation) / 3.);
182 B_i_1.template segment<3>(0) -=
183 Eigen::Vector3d::Constant((B_i_1[1] - B_bar_i[1]) / 3.);
184 }
185}

◆ fillBMatrix2DCartesianPart()

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

Definition at line 28 of file LinearBMatrix.h.

29{
30 for (int i = 0; i < NPOINTS; ++i)
31 {
32 B(1, NPOINTS + i) = dNdx(1, i);
33 B(3, i) = dNdx(1, i) / std::sqrt(2);
34 B(3, NPOINTS + i) = dNdx(0, i) / std::sqrt(2);
35 B(0, i) = dNdx(0, i);
36 }
37}