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
151
152
153
154 for (int k = 0; k < 3; k++)
155 {
156
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
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 if (is_axially_symmetric)
176 {
177 double const b0_dil_pertubation =
178 (B_i_0[0] - B_bar_i[0] + B_i_0[2] - B_bar_i[2]);
179 B_i_0.template segment<3>(0) -=
180 Eigen::Vector3d::Constant((b0_dil_pertubation) / 3.);
181 B_i_1.template segment<3>(0) -=
182 Eigen::Vector3d::Constant((B_i_1[1] - B_bar_i[1]) / 3.);
183 continue;
184 }
185
186
187 B_i_0.template segment<2>(0) -=
188 Eigen::Vector2d::Constant((B_i_0[0] - B_bar_i[0]) / 2.);
189 B_i_1.template segment<2>(0) -=
190 Eigen::Vector2d::Constant((B_i_1[1] - B_bar_i[1]) / 2.);
191 }
192}