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

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

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

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

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