424 {
426
427 const size_t nb_gauss_pts = getGaussPts().size2();
428 const size_t row_nb_dofs = row_data.
getIndices().size();
429 const size_t col_nb_dofs = col_data.
getIndices().size();
430
431 if (row_nb_dofs && col_nb_dofs) {
432
433 auto t_normal = getFTensor1Normal();
434 const double ls = sqrt(t_normal(
i) * t_normal(
i));
436
437 auto t_disp = getFTensor1FromMat<3>(*(
commonDataPtr->mDispPtr));
438 auto t_traction =
440 auto t_coords = getFTensor1CoordsAtGaussPts();
441
442 auto t_w = getFTensor0IntegrationWeight();
444 size_t nb_face_functions = row_data.
getN().size2() / 3;
445
446 auto t_contact_normal =
448 auto t_gap = getFTensor0FromVec(*(
commonDataPtr->contactGapPtr));
449
450 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
451
452 const double alpha = t_w * getMeasure();
453
454 if (getNormalsAtGaussPts().size1() == nb_gauss_pts) {
456 auto t_n = getFTensor1FromPtr<3>(&*
n.data().begin());
457 t_normal(
i) = t_n(
i) / sqrt(t_n(
j) * t_n(
j));
458 }
459
460
461 Tensor2<double, 3, 3> t_P;
462 t_P(
i,
j) = t_contact_normal(
i) * t_contact_normal(
j);
463
464 Tensor2<double, 3, 3> t_Q;
466
469
470 size_t rr = 0;
471 for (; rr != row_nb_dofs / 3; ++rr) {
472 auto t_mat = getFTensor2FromArray<3, 3, 3>(locMat, 3 * rr);
473 const double row_base = t_row_base(
i) * t_normal(
i);
474
476
477 for (size_t cc = 0; cc != col_nb_dofs / 3; ++cc) {
478 const double col_base = t_col_base(
i) * t_normal(
i);
479 const double beta =
alpha * row_base * col_base;
480
481 t_mat(
i,
j) += (beta * diff_traction) * t_P(
i,
j);
482 t_mat(
i,
j) += beta * (*cache).cn_cont * t_Q(
i,
j);
483
484 ++t_col_base;
485 ++t_mat;
486 }
487
488 ++t_row_base;
489 }
490 for (; rr < nb_face_functions; ++rr)
491 ++t_row_base;
492
493 ++t_contact_normal;
494 ++t_gap;
495 ++t_disp;
496 ++t_traction;
497 ++t_coords;
498 ++t_w;
499 }
500
501 }
502
504}
#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< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
UBlasVector< double > VectorDouble
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
const VectorInt & getIndices() const
Get global indices of dofs on entity.