620 {
622
623 const auto *fe =
624 dynamic_cast<const FlatPrismElementForcesAndSourcesCore *>(ptrFE);
625 if (!fe)
627 "TIE prism operator is attached to a wrong finite element");
628
630 SETERRQ(
632 "Unexpected number of TIE prism vector dofs on rows or columns: "
633 "rowField=%s colField=%s rowSide=%d colSide=%d rowType=%d colType=%d "
634 "nbRows=%d nbCols=%d",
636 rowType, colType, nbRows, nbCols);
637
640
641 const auto nb_gauss_pts = getGaussPts().size2();
642 if (!nb_gauss_pts || nb_gauss_pts % 2) {
644 "Expected concatenated [slave|master] TIE Gauss points");
645 }
646 const auto nb_slave_gauss = nb_gauss_pts / 2;
647 const int nb_row_base = nbRows /
SPACE_DIM;
648 const int nb_col_base = nbCols /
SPACE_DIM;
649
650 auto &col_n = col_data.getN();
651 if (!col_n.size1() || !col_n.size2())
653
654 auto &row_n = row_data.getN();
655 if (!row_n.size1() || !row_n.size2())
657
658 if (row_n.size1() != nb_gauss_pts || col_n.size1() != nb_gauss_pts)
660 "Unexpected number of Gauss points on TIE prism blocks");
661
662 if (static_cast<size_t>(nb_row_base) > row_n.size2() ||
663 static_cast<size_t>(nb_col_base) > col_n.size2())
665 "More TIE prism bases than shape functions");
666 if (locMat.size1() != static_cast<size_t>(nbRows) ||
667 locMat.size2() != static_cast<size_t>(nbCols))
669 "Unexpected TIE LHS block size: rowField=%s colField=%s "
670 "rowSide=%d colSide=%d rowType=%d colType=%d nbRows=%d "
671 "nbCols=%d locMat=(%d,%d) row_n=(%d,%d) col_n=(%d,%d)",
673 rowType, colType, nbRows, nbCols,
674 static_cast<int>(locMat.size1()), static_cast<int>(locMat.size2()),
675 static_cast<int>(row_n.size1()), static_cast<int>(row_n.size2()),
676 static_cast<int>(col_n.size1()), static_cast<int>(col_n.size2()));
677
680
681 auto t_w = getFTensor0IntegrationWeight();
682 for (size_t gg = 0; gg != nb_slave_gauss; ++gg) {
684 for (int rr = 0; rr != nb_row_base; ++rr) {
686 const double row_sign = base_on_slave ? 1.0 : -1.0;
687 const auto row_gg = base_on_slave ? gg : gg + nb_slave_gauss;
688 if (row_gg >= row_n.size1())
690 "TIE LHS Gauss index out of range: rowField=%s colField=%s "
691 "rowSide=%d rowType=%d rr=%d row_gg=%d row_n.size1()=%d "
692 "nb_slave_gauss=%d",
694 rr, static_cast<int>(row_gg), static_cast<int>(row_n.size1()),
695 static_cast<int>(nb_slave_gauss));
696 auto t_row_base = row_data.getFTensor0N(row_gg, rr);
697 auto t_col_base = col_data.getFTensor0N(gg, 0);
698 for (int cc = 0; cc != nb_col_base; ++cc) {
699 const double value = row_sign * slave_alpha * t_row_base * t_col_base;
702 ++t_col_base;
703 }
704 ++t_row_base;
705 }
706 ++t_w;
707 }
708
710 }
#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()