240 {
242
243 const size_t nb_row_dofs = row_data.
getIndices().size();
244 const size_t nb_col_dofs = col_data.
getIndices().size();
245 if (nb_row_dofs && nb_col_dofs) {
246
247 const size_t nb_integration_pts = row_data.
getN().size1();
248 const size_t nb_row_base_functions = row_data.
getN().size2();
249 auto t_w = getFTensor0IntegrationWeight();
251 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(*
matDPtr);
252
254 auto t_dE_dF = getFTensor4FromMat<3, 3, 3, 3>(dE_dF);
258
261 if (!LOGSTRAIN) {
263 for (int ii = 0; ii != 3; ++ii)
264 for (int jj = ii; jj != 3; ++jj)
265 for (int kk = 0; kk != 3; ++kk)
266 for (int ll = 0; ll != 3; ++ll)
267 for (int LL = 0; LL != 6; ++LL)
268 t_DL(ii, jj, LL) += t_D(ii, jj, kk, ll) * t_L(kk, ll, LL);
269 }
270
271 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
272 double alpha = getMeasure() * t_w;
273
274 if (LOGSTRAIN) {
276
277
278
279
280
281
282
283
284
285
286
287 D2_symm(
k,
l,
m,
n) = t_D(
m,
n,
i,
j) * t_dE_dF(
i,
j,
k,
l);
288
290 for (int ii = 0; ii != 3; ++ii)
291 for (int jj = 0; jj != 3; ++jj)
292 for (int kk = 0; kk != 3; ++kk)
293 for (int ll = 0; ll != 3; ++ll)
294 for (int LL = 0; LL != 6; ++LL)
295 t_DLs(ii, jj, LL) +=
296 D2_symm(ii, jj, kk, ll) * t_L(kk, ll, LL);
297 }
298
299 size_t rr = 0;
300 for (; rr != nb_row_dofs / 3; ++rr) {
301
303 &locMat(3 * rr + 0, 0), &locMat(3 * rr + 0, 1),
304 &locMat(3 * rr + 0, 2), &locMat(3 * rr + 0, 3),
305 &locMat(3 * rr + 0, 4), &locMat(3 * rr + 0, 5),
306 &locMat(3 * rr + 1, 0), &locMat(3 * rr + 1, 1),
307 &locMat(3 * rr + 1, 2), &locMat(3 * rr + 1, 3),
308 &locMat(3 * rr + 1, 4), &locMat(3 * rr + 1, 5),
309 &locMat(3 * rr + 2, 0), &locMat(3 * rr + 2, 1),
310 &locMat(3 * rr + 2, 2), &locMat(3 * rr + 2, 3),
311 &locMat(3 * rr + 2, 4), &locMat(3 * rr + 2, 5)};
312
315
316 if (LOGSTRAIN) {
317 t_tmp(
i,
L) = (t_DLs(
i,
j,
L) * (
alpha * t_row_diff_base(
j)));
318
319 } else
320 t_tmp(
i,
L) = (t_DL(
i,
j,
L) * (
alpha * t_row_diff_base(
j)));
321
322 for (size_t cc = 0; cc != nb_col_dofs / 6; ++cc) {
323
324 t_mat(
i,
L) -= (t_col_base * t_tmp(
i,
L));
325
326 ++t_mat;
327 ++t_col_base;
328 }
329
330 ++t_row_diff_base;
331 }
332
333 if (LOGSTRAIN)
334 ++t_dE_dF;
335
336 for (; rr < nb_row_base_functions; ++rr)
337 ++t_row_diff_base;
338 ++t_w;
339 }
340 }
341
343}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.