v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ElasticTie::OpTiePrismLhs Struct Reference

#include "tutorials/vec-11_elastic_tie_mesh/src/ElasticTie.hpp"

Inheritance diagram for ElasticTie::OpTiePrismLhs:
[legend]
Collaboration diagram for ElasticTie::OpTiePrismLhs:
[legend]

Public Member Functions

 OpTiePrismLhs (const std::string &row_field_name, const std::string &col_field_name, const bool assemble_transpose=false)
 
double getSlaveFaceArea ()
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data) override
 

Protected Attributes

std::string rowFieldName
 
std::string colFieldName
 

Detailed Description

Definition at line 602 of file ElasticTie.hpp.

Constructor & Destructor Documentation

◆ OpTiePrismLhs()

ElasticTie::OpTiePrismLhs::OpTiePrismLhs ( const std::string &  row_field_name,
const std::string &  col_field_name,
const bool  assemble_transpose = false 
)
inline

Definition at line 604 of file ElasticTie.hpp.

607 : TiePrismLhsBase(row_field_name, col_field_name, OPROWCOL, nullptr),
608 rowFieldName(row_field_name), colFieldName(col_field_name) {
609 sYmm = false;
610 this->assembleTranspose = assemble_transpose;
611 }
FormsIntegrators< FlatPrismElementForcesAndSourcesCore::UserDataOperator >::Assembly< A >::OpBase TiePrismLhsBase

Member Function Documentation

◆ getSlaveFaceArea()

double ElasticTie::OpTiePrismLhs::getSlaveFaceArea ( )
inline

Definition at line 613 of file ElasticTie.hpp.

613{ return getAreaF3(); }

◆ iNtegrate()

MoFEMErrorCode ElasticTie::OpTiePrismLhs::iNtegrate ( EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data 
)
inlineoverrideprotected

Definition at line 619 of file ElasticTie.hpp.

620 {
622
623 const auto *fe =
624 dynamic_cast<const FlatPrismElementForcesAndSourcesCore *>(ptrFE);
625 if (!fe)
626 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
627 "TIE prism operator is attached to a wrong finite element");
628
629 if (nbRows % SPACE_DIM || nbCols % SPACE_DIM)
630 SETERRQ(
631 PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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",
635 rowFieldName.c_str(), colFieldName.c_str(), rowSide, colSide,
636 rowType, colType, nbRows, nbCols);
637
638 if (colFieldName != "LAMBDA")
640
641 const auto nb_gauss_pts = getGaussPts().size2();
642 if (!nb_gauss_pts || nb_gauss_pts % 2) {
643 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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)
659 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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())
664 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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))
668 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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)",
672 rowFieldName.c_str(), colFieldName.c_str(), rowSide, colSide,
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
678 if (!isOnPrismTieTrace(rowSide, rowType))
680
681 auto t_w = getFTensor0IntegrationWeight();
682 for (size_t gg = 0; gg != nb_slave_gauss; ++gg) {
683 const double slave_alpha = getSlaveFaceArea() * t_w;
684 for (int rr = 0; rr != nb_row_base; ++rr) {
685 const bool base_on_slave = isOnSlaveTieRowBase(rr, rowSide, rowType);
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())
689 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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",
693 rowFieldName.c_str(), colFieldName.c_str(), rowSide, rowType,
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;
700 for (int dd = 0; dd != SPACE_DIM; ++dd)
701 locMat(SPACE_DIM * rr + dd, SPACE_DIM * cc + dd) += value;
702 ++t_col_base;
703 }
704 ++t_row_base;
705 }
706 ++t_w;
707 }
708
710 }
constexpr int SPACE_DIM
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#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)
Definition ddTensor0.hpp:33

Member Data Documentation

◆ colFieldName

std::string ElasticTie::OpTiePrismLhs::colFieldName
protected

Definition at line 617 of file ElasticTie.hpp.

◆ rowFieldName

std::string ElasticTie::OpTiePrismLhs::rowFieldName
protected

Definition at line 616 of file ElasticTie.hpp.


The documentation for this struct was generated from the following file: