512 {
514
515 const auto *fe =
516 dynamic_cast<const FlatPrismElementForcesAndSourcesCore *>(ptrFE);
517 if (!fe)
519 "TIE prism RHS operator is attached to a wrong finite element");
520
521 const auto nb_gauss_pts = getGaussPts().size2();
522 if (!nb_gauss_pts || nb_gauss_pts % 2) {
524 "Expected concatenated [slave|master] TIE Gauss points");
525 }
526 const auto nb_slave_gauss = nb_gauss_pts / 2;
527 if (
lambdaPtr->size1() != nb_gauss_pts) {
529 "TIE multiplier values at Gauss points were not prepared "
530 "before RHS assembly");
531 }
532
535 "Unexpected number of TIE prism vector dofs on rows");
536
539
540 auto &row_n = row_data.getN();
541 if (!row_n.size1() || !row_n.size2())
543 if (row_n.size1() != nb_gauss_pts)
545 "Unexpected number of Gauss points on TIE displacement block");
546
547 const int nb_row_base = nbRows /
SPACE_DIM;
548 if (static_cast<size_t>(nb_row_base) > row_n.size2())
550 "More TIE displacement bases than shape functions");
553 "Unexpected TIE multiplier matrix size: size2=%d expected=%d",
555 if (locF.size() != static_cast<size_t>(nbRows))
557 "Unexpected TIE U RHS block size: rowSide=%d rowType=%d "
558 "nbRows=%d locF.size()=%d row_n=(%d,%d) lambda=(%d,%d)",
559 rowSide, rowType, nbRows, static_cast<int>(locF.size()),
560 static_cast<int>(row_n.size1()), static_cast<int>(row_n.size2()),
563
564 auto t_w = getFTensor0IntegrationWeight();
565 for (size_t gg = 0; gg != nb_slave_gauss; ++gg) {
567 for (int rr = 0; rr != nb_row_base; ++rr) {
569 const double row_sign = base_on_slave ? 1.0 : -1.0;
570 const auto row_gg = base_on_slave ? gg : gg + nb_slave_gauss;
571 if (row_gg >= row_n.size1())
573 "TIE U RHS Gauss index out of range: rowSide=%d rowType=%d "
574 "rr=%d row_gg=%d row_n.size1()=%d nb_slave_gauss=%d",
575 rowSide, rowType, rr, static_cast<int>(row_gg),
576 static_cast<int>(row_n.size1()),
577 static_cast<int>(nb_slave_gauss));
578 auto t_row_base = row_data.getFTensor0N(row_gg, rr);
579 const double row_base = t_row_base;
580 if (row_base != 0.) {
581 auto t_row_rhs = getFTensor1FromPtr<SPACE_DIM>(&locF[
SPACE_DIM * rr]);
583 t_row_rhs(dd) +=
584 row_sign * row_base * slave_alpha * (*lambdaPtr)(gg,
dd);
585 }
586 ++t_row_base;
587 }
588
589 ++t_w;
590 }
591
593 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
bool isOnPrismTieTrace(const int side, const EntityType type)
bool isOnSlaveTieRowBase(const int rr, const int row_side, const EntityType row_type)
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
double getSlaveFaceArea()