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

Constructor & Destructor Documentation

◆ OpTiePrismRhs()

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

Definition at line 413 of file ElasticTie.hpp.

414 : TiePrismRhsBase("LAMBDA", "LAMBDA", OPROW, nullptr),
415 dispPtr(disp_ptr) {
416 if (!dispPtr)
417 THROW_MESSAGE("Pointers are not set");
418 }
#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 420 of file ElasticTie.hpp.

420{ return getAreaF3(); }

◆ iNtegrate()

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

Definition at line 423 of file ElasticTie.hpp.

423 {
425
426 const auto *fe =
427 dynamic_cast<const FlatPrismElementForcesAndSourcesCore *>(ptrFE);
428 if (!fe)
429 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
430 "TIE prism RHS operator is attached to a wrong finite element");
431
432 const auto nb_gauss_pts = getGaussPts().size2();
433 if (!nb_gauss_pts || nb_gauss_pts % 2) {
434 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
435 "Expected concatenated [slave|master] TIE Gauss points");
436 }
437 const auto nb_slave_gauss = nb_gauss_pts / 2;
438 if (dispPtr->size1() != nb_gauss_pts) {
439 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
440 "TIE displacement values at Gauss points were not prepared "
441 "before RHS assembly");
442 }
443
444 if (nbRows % SPACE_DIM)
445 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
446 "Unexpected number of LAMBDA dofs on TIE prism rows");
447
448 auto &row_n = row_data.getN();
449 if (!row_n.size1() || !row_n.size2())
451 if (row_n.size1() != nb_gauss_pts)
452 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
453 "Unexpected number of Gauss points on TIE multiplier block");
454
455 const int nb_row_base = nbRows / SPACE_DIM;
456 if (static_cast<size_t>(nb_row_base) > row_n.size2())
457 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
458 "More TIE multiplier bases than shape functions");
459 if (dispPtr->size2() != SPACE_DIM)
460 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
461 "Unexpected TIE displacement matrix size: size2=%d expected=%d",
462 static_cast<int>(dispPtr->size2()), SPACE_DIM);
463 if (locF.size() != static_cast<size_t>(nbRows))
464 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
465 "Unexpected TIE RHS block size: rowSide=%d rowType=%d nbRows=%d "
466 "locF.size()=%d row_n=(%d,%d) disp=(%d,%d)",
467 rowSide, rowType, nbRows, static_cast<int>(locF.size()),
468 static_cast<int>(row_n.size1()), static_cast<int>(row_n.size2()),
469 static_cast<int>(dispPtr->size1()),
470 static_cast<int>(dispPtr->size2()));
471
472 auto t_w = getFTensor0IntegrationWeight();
473 for (size_t gg = 0; gg != nb_slave_gauss; ++gg) {
474 const double slave_alpha = getSlaveFaceArea() * t_w;
475 auto t_row_base = row_data.getFTensor0N(gg, 0);
476 for (int rr = 0; rr != nb_row_base; ++rr) {
477 const double row_base = t_row_base;
478 if (row_base != 0.) {
479 auto t_row_rhs = getFTensor1FromPtr<SPACE_DIM>(&locF[SPACE_DIM * rr]);
480 for (int dd = 0; dd != SPACE_DIM; ++dd) {
481 t_row_rhs(dd) += row_base * slave_alpha *
482 ((*dispPtr)(gg, dd) -
483 (*dispPtr)(gg + nb_slave_gauss, dd));
484 }
485 }
486 ++t_row_base;
487 }
488
489 ++t_w;
490 }
491
493 }
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 496 of file ElasticTie.hpp.


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