v0.16.0
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 499 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 501 of file ElasticTie.hpp.

503 : TiePrismRhsBase(field_name, field_name, OPROW, nullptr),
504 lambdaPtr(lambda_ptr) {
505 if (!lambdaPtr)
506 THROW_MESSAGE("Pointers are not set");
507 }
#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 509 of file ElasticTie.hpp.

509{ return getAreaF3(); }

◆ iNtegrate()

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

Definition at line 512 of file ElasticTie.hpp.

512 {
514
515 const auto *fe =
516 dynamic_cast<const FlatPrismElementForcesAndSourcesCore *>(ptrFE);
517 if (!fe)
518 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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) {
523 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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) {
528 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
529 "TIE multiplier values at Gauss points were not prepared "
530 "before RHS assembly");
531 }
532
533 if (nbRows % SPACE_DIM)
534 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
535 "Unexpected number of TIE prism vector dofs on rows");
536
537 if (!isOnPrismTieTrace(rowSide, rowType))
539
540 auto &row_n = row_data.getN();
541 if (!row_n.size1() || !row_n.size2())
543 if (row_n.size1() != nb_gauss_pts)
544 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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())
549 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
550 "More TIE displacement bases than shape functions");
551 if (lambdaPtr->size2() != SPACE_DIM)
552 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
553 "Unexpected TIE multiplier matrix size: size2=%d expected=%d",
554 static_cast<int>(lambdaPtr->size2()), SPACE_DIM);
555 if (locF.size() != static_cast<size_t>(nbRows))
556 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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()),
561 static_cast<int>(lambdaPtr->size1()),
562 static_cast<int>(lambdaPtr->size2()));
563
564 auto t_w = getFTensor0IntegrationWeight();
565 for (size_t gg = 0; gg != nb_slave_gauss; ++gg) {
566 const double slave_alpha = getSlaveFaceArea() * t_w;
567 for (int rr = 0; rr != nb_row_base; ++rr) {
568 const bool base_on_slave = isOnSlaveTieRowBase(rr, rowSide, rowType);
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())
572 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
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]);
582 for (int dd = 0; dd != SPACE_DIM; ++dd)
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 }
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 596 of file ElasticTie.hpp.


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