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

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

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

Public Member Functions

 OpTiePrismRhsU (const std::string &field_name, boost::shared_ptr< MatrixDouble > lambda_ptr)
 
double getSlaveFaceArea ()
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data) override
 

Private Attributes

boost::shared_ptr< MatrixDouble > lambdaPtr
 

Detailed Description

Definition at line 651 of file ElasticTie.hpp.

Constructor & Destructor Documentation

◆ OpTiePrismRhsU()

ElasticTie::OpTiePrismRhsU::OpTiePrismRhsU ( const std::string &  field_name,
boost::shared_ptr< MatrixDouble >  lambda_ptr 
)
inline

Definition at line 653 of file ElasticTie.hpp.

655 : TiePrismRhsBase(field_name, field_name, OPROW, nullptr),
656 lambdaPtr(lambda_ptr) {
657 if (!lambdaPtr)
658 THROW_MESSAGE("Pointers are not set");
659 }
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
FormsIntegrators< FlatPrismElementForcesAndSourcesCore::UserDataOperator >::Assembly< A >::OpBase TiePrismRhsBase
constexpr auto field_name
boost::shared_ptr< MatrixDouble > lambdaPtr

Member Function Documentation

◆ getSlaveFaceArea()

double ElasticTie::OpTiePrismRhsU::getSlaveFaceArea ( )
inline

Definition at line 661 of file ElasticTie.hpp.

661{ return getAreaF3(); }

◆ iNtegrate()

MoFEMErrorCode ElasticTie::OpTiePrismRhsU::iNtegrate ( EntitiesFieldData::EntData &  row_data)
inlineoverrideprotected

Definition at line 664 of file ElasticTie.hpp.

664 {
666
667 const auto *fe =
668 dynamic_cast<const FlatPrismElementForcesAndSourcesCore *>(ptrFE);
669 if (!fe)
670 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
671 "TIE prism RHS operator is attached to a wrong finite element");
672
673 const auto nb_gauss_pts = getGaussPts().size2();
674 if (!nb_gauss_pts || nb_gauss_pts % 2) {
675 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
676 "Expected concatenated [slave|master] TIE Gauss points");
677 }
678 const auto nb_slave_gauss = nb_gauss_pts / 2;
679 if (lambdaPtr->size1() != nb_gauss_pts) {
680 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
681 "TIE multiplier values at Gauss points were not prepared "
682 "before RHS assembly");
683 }
684
685 if (nbRows % SPACE_DIM)
686 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
687 "Unexpected number of TIE prism vector dofs on rows");
688
689 if (!isOnPrismTieTrace(rowSide, rowType))
691
692 auto &row_n = row_data.getN();
693 if (!row_n.size1() || !row_n.size2())
695 if (row_n.size1() != nb_gauss_pts)
696 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
697 "Unexpected number of Gauss points on TIE displacement block");
698
699 const int nb_row_base = nbRows / SPACE_DIM;
700 if (static_cast<size_t>(nb_row_base) > row_n.size2())
701 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
702 "More TIE displacement bases than shape functions");
703 if (lambdaPtr->size2() != SPACE_DIM)
704 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
705 "Unexpected TIE multiplier matrix size: size2=%d expected=%d",
706 static_cast<int>(lambdaPtr->size2()), SPACE_DIM);
707 if (locF.size() != static_cast<size_t>(nbRows))
708 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
709 "Unexpected TIE U RHS block size: rowSide=%d rowType=%d "
710 "nbRows=%d locF.size()=%d row_n=(%d,%d) lambda=(%d,%d)",
711 rowSide, rowType, nbRows, static_cast<int>(locF.size()),
712 static_cast<int>(row_n.size1()), static_cast<int>(row_n.size2()),
713 static_cast<int>(lambdaPtr->size1()),
714 static_cast<int>(lambdaPtr->size2()));
715
716 auto t_w = getFTensor0IntegrationWeight();
717 for (size_t gg = 0; gg != nb_slave_gauss; ++gg) {
718 const double slave_alpha = getSlaveFaceArea() * t_w;
719 for (int rr = 0; rr != nb_row_base; ++rr) {
720 const bool base_on_slave = isOnSlaveTieRowBase(rr, rowSide, rowType);
721 const double row_sign = base_on_slave ? 1.0 : -1.0;
722 const auto row_gg = base_on_slave ? gg : gg + nb_slave_gauss;
723 if (row_gg >= row_n.size1())
724 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
725 "TIE U RHS Gauss index out of range: rowSide=%d rowType=%d "
726 "rr=%d row_gg=%d row_n.size1()=%d nb_slave_gauss=%d",
727 rowSide, rowType, rr, static_cast<int>(row_gg),
728 static_cast<int>(row_n.size1()),
729 static_cast<int>(nb_slave_gauss));
730 auto t_row_base = row_data.getFTensor0N(row_gg, rr);
731 const double row_base = t_row_base;
732 if (row_base != 0.) {
733 auto t_row_rhs = getFTensor1FromPtr<SPACE_DIM>(&locF[SPACE_DIM * rr]);
734 for (int dd = 0; dd != SPACE_DIM; ++dd)
735 t_row_rhs(dd) +=
736 row_sign * row_base * slave_alpha * (*lambdaPtr)(gg, dd);
737 }
738 ++t_row_base;
739 }
740
741 ++t_w;
742 }
743
745 }
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

◆ lambdaPtr

boost::shared_ptr<MatrixDouble> ElasticTie::OpTiePrismRhsU::lambdaPtr
private

Definition at line 748 of file ElasticTie.hpp.


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