v0.16.3
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 754 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 756 of file ElasticTie.hpp.

759 : TiePrismLhsBase(row_field_name, col_field_name, OPROWCOL, nullptr),
760 rowFieldName(row_field_name), colFieldName(col_field_name) {
761 sYmm = false;
762 this->assembleTranspose = assemble_transpose;
763 }
FormsIntegrators< FlatPrismElementForcesAndSourcesCore::UserDataOperator >::Assembly< A >::OpBase TiePrismLhsBase

Member Function Documentation

◆ getSlaveFaceArea()

double ElasticTie::OpTiePrismLhs::getSlaveFaceArea ( )
inline

Definition at line 765 of file ElasticTie.hpp.

765{ return getAreaF3(); }

◆ iNtegrate()

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

Definition at line 771 of file ElasticTie.hpp.

772 {
774
775 const auto *fe =
776 dynamic_cast<const FlatPrismElementForcesAndSourcesCore *>(ptrFE);
777 if (!fe)
778 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
779 "TIE prism operator is attached to a wrong finite element");
780
781 if (nbRows % SPACE_DIM || nbCols % SPACE_DIM)
782 SETERRQ(
783 PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
784 "Unexpected number of TIE prism vector dofs on rows or columns: "
785 "rowField=%s colField=%s rowSide=%d colSide=%d rowType=%d colType=%d "
786 "nbRows=%d nbCols=%d",
787 rowFieldName.c_str(), colFieldName.c_str(), rowSide, colSide,
788 rowType, colType, nbRows, nbCols);
789
790 if (colFieldName != "LAMBDA")
792
793 const auto nb_gauss_pts = getGaussPts().size2();
794 if (!nb_gauss_pts || nb_gauss_pts % 2) {
795 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
796 "Expected concatenated [slave|master] TIE Gauss points");
797 }
798 const auto nb_slave_gauss = nb_gauss_pts / 2;
799 const int nb_row_base = nbRows / SPACE_DIM;
800 const int nb_col_base = nbCols / SPACE_DIM;
801
802 auto &col_n = col_data.getN();
803 if (!col_n.size1() || !col_n.size2())
805
806 auto &row_n = row_data.getN();
807 if (!row_n.size1() || !row_n.size2())
809
810 if (row_n.size1() != nb_gauss_pts || col_n.size1() != nb_gauss_pts)
811 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
812 "Unexpected number of Gauss points on TIE prism blocks");
813
814 if (static_cast<size_t>(nb_row_base) > row_n.size2() ||
815 static_cast<size_t>(nb_col_base) > col_n.size2())
816 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
817 "More TIE prism bases than shape functions");
818 if (locMat.size1() != static_cast<size_t>(nbRows) ||
819 locMat.size2() != static_cast<size_t>(nbCols))
820 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
821 "Unexpected TIE LHS block size: rowField=%s colField=%s "
822 "rowSide=%d colSide=%d rowType=%d colType=%d nbRows=%d "
823 "nbCols=%d locMat=(%d,%d) row_n=(%d,%d) col_n=(%d,%d)",
824 rowFieldName.c_str(), colFieldName.c_str(), rowSide, colSide,
825 rowType, colType, nbRows, nbCols,
826 static_cast<int>(locMat.size1()), static_cast<int>(locMat.size2()),
827 static_cast<int>(row_n.size1()), static_cast<int>(row_n.size2()),
828 static_cast<int>(col_n.size1()), static_cast<int>(col_n.size2()));
829
830 if (!isOnPrismTieTrace(rowSide, rowType))
832
833 auto t_w = getFTensor0IntegrationWeight();
834 for (size_t gg = 0; gg != nb_slave_gauss; ++gg) {
835 const double slave_alpha = getSlaveFaceArea() * t_w;
836 for (int rr = 0; rr != nb_row_base; ++rr) {
837 const bool base_on_slave = isOnSlaveTieRowBase(rr, rowSide, rowType);
838 const double row_sign = base_on_slave ? 1.0 : -1.0;
839 const auto row_gg = base_on_slave ? gg : gg + nb_slave_gauss;
840 if (row_gg >= row_n.size1())
841 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
842 "TIE LHS Gauss index out of range: rowField=%s colField=%s "
843 "rowSide=%d rowType=%d rr=%d row_gg=%d row_n.size1()=%d "
844 "nb_slave_gauss=%d",
845 rowFieldName.c_str(), colFieldName.c_str(), rowSide, rowType,
846 rr, static_cast<int>(row_gg), static_cast<int>(row_n.size1()),
847 static_cast<int>(nb_slave_gauss));
848 auto t_row_base = row_data.getFTensor0N(row_gg, rr);
849 auto t_col_base = col_data.getFTensor0N(gg, 0);
850 for (int cc = 0; cc != nb_col_base; ++cc) {
851 const double value = row_sign * slave_alpha * t_row_base * t_col_base;
852 for (int dd = 0; dd != SPACE_DIM; ++dd)
853 locMat(SPACE_DIM * rr + dd, SPACE_DIM * cc + dd) += value;
854 ++t_col_base;
855 }
856 ++t_row_base;
857 }
858 ++t_w;
859 }
860
862 }
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 769 of file ElasticTie.hpp.

◆ rowFieldName

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

Definition at line 768 of file ElasticTie.hpp.


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