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

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

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

Public Member Functions

 OpTiePrismRhs (boost::shared_ptr< MatrixDouble > disp_ptr)
 
double getSlaveFaceArea ()
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data) override
 

Private Attributes

boost::shared_ptr< MatrixDouble > dispPtr
 

Detailed Description

Definition at line 563 of file ElasticTie.hpp.

Constructor & Destructor Documentation

◆ OpTiePrismRhs()

ElasticTie::OpTiePrismRhs::OpTiePrismRhs ( boost::shared_ptr< MatrixDouble >  disp_ptr)
inline

Definition at line 565 of file ElasticTie.hpp.

566 : TiePrismRhsBase("LAMBDA", "LAMBDA", OPROW, nullptr),
567 dispPtr(disp_ptr) {
568 if (!dispPtr)
569 THROW_MESSAGE("Pointers are not set");
570 }
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
FormsIntegrators< FlatPrismElementForcesAndSourcesCore::UserDataOperator >::Assembly< A >::OpBase TiePrismRhsBase
boost::shared_ptr< MatrixDouble > dispPtr

Member Function Documentation

◆ getSlaveFaceArea()

double ElasticTie::OpTiePrismRhs::getSlaveFaceArea ( )
inline

Definition at line 572 of file ElasticTie.hpp.

572{ return getAreaF3(); }

◆ iNtegrate()

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

Definition at line 575 of file ElasticTie.hpp.

575 {
577
578 const auto *fe =
579 dynamic_cast<const FlatPrismElementForcesAndSourcesCore *>(ptrFE);
580 if (!fe)
581 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
582 "TIE prism RHS operator is attached to a wrong finite element");
583
584 const auto nb_gauss_pts = getGaussPts().size2();
585 if (!nb_gauss_pts || nb_gauss_pts % 2) {
586 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
587 "Expected concatenated [slave|master] TIE Gauss points");
588 }
589 const auto nb_slave_gauss = nb_gauss_pts / 2;
590 if (dispPtr->size1() != nb_gauss_pts) {
591 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
592 "TIE displacement values at Gauss points were not prepared "
593 "before RHS assembly");
594 }
595
596 if (nbRows % SPACE_DIM)
597 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
598 "Unexpected number of LAMBDA dofs on TIE prism rows");
599
600 auto &row_n = row_data.getN();
601 if (!row_n.size1() || !row_n.size2())
603 if (row_n.size1() != nb_gauss_pts)
604 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
605 "Unexpected number of Gauss points on TIE multiplier block");
606
607 const int nb_row_base = nbRows / SPACE_DIM;
608 if (static_cast<size_t>(nb_row_base) > row_n.size2())
609 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
610 "More TIE multiplier bases than shape functions");
611 if (dispPtr->size2() != SPACE_DIM)
612 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
613 "Unexpected TIE displacement matrix size: size2=%d expected=%d",
614 static_cast<int>(dispPtr->size2()), SPACE_DIM);
615 if (locF.size() != static_cast<size_t>(nbRows))
616 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
617 "Unexpected TIE RHS block size: rowSide=%d rowType=%d nbRows=%d "
618 "locF.size()=%d row_n=(%d,%d) disp=(%d,%d)",
619 rowSide, rowType, nbRows, static_cast<int>(locF.size()),
620 static_cast<int>(row_n.size1()), static_cast<int>(row_n.size2()),
621 static_cast<int>(dispPtr->size1()),
622 static_cast<int>(dispPtr->size2()));
623
624 auto t_w = getFTensor0IntegrationWeight();
625 for (size_t gg = 0; gg != nb_slave_gauss; ++gg) {
626 const double slave_alpha = getSlaveFaceArea() * t_w;
627 auto t_row_base = row_data.getFTensor0N(gg, 0);
628 for (int rr = 0; rr != nb_row_base; ++rr) {
629 const double row_base = t_row_base;
630 if (row_base != 0.) {
631 auto t_row_rhs = getFTensor1FromPtr<SPACE_DIM>(&locF[SPACE_DIM * rr]);
632 for (int dd = 0; dd != SPACE_DIM; ++dd) {
633 t_row_rhs(dd) += row_base * slave_alpha *
634 ((*dispPtr)(gg, dd) -
635 (*dispPtr)(gg + nb_slave_gauss, dd));
636 }
637 }
638 ++t_row_base;
639 }
640
641 ++t_w;
642 }
643
645 }
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 ...
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

◆ dispPtr

boost::shared_ptr<MatrixDouble> ElasticTie::OpTiePrismRhs::dispPtr
private

Definition at line 648 of file ElasticTie.hpp.


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