v0.16.3
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
CohesiveElement::CohesiveInterfaceElement::OpLhs Struct Reference

Operator calculate element stiffens matrix. More...

#include "tutorials/cor-12_cohesive_interface/src/CohesiveInterfaceElement.hpp"

Inheritance diagram for CohesiveElement::CohesiveInterfaceElement::OpLhs:
[legend]
Collaboration diagram for CohesiveElement::CohesiveInterfaceElement::OpLhs:
[legend]

Public Member Functions

 OpLhs (const std::string field_name, CommonData &common_data, PhysicalEquation &physical_eqations)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Public Attributes

CommonData & commonData
 
PhysicalEquation & physicalEqations
 
MatrixDouble K
 
MatrixDouble D
 
MatrixDouble ND
 

Detailed Description

Operator calculate element stiffens matrix.

Definition at line 501 of file CohesiveInterfaceElement.hpp.

Constructor & Destructor Documentation

◆ OpLhs()

CohesiveElement::CohesiveInterfaceElement::OpLhs::OpLhs ( const std::string  field_name,
CommonData &  common_data,
PhysicalEquation &  physical_eqations 
)
inline

Definition at line 505 of file CohesiveInterfaceElement.hpp.

507 : FlatPrismElementForcesAndSourcesCore::UserDataOperator(
508 field_name, ForcesAndSourcesCore::UserDataOperator::OPROWCOL),
509 commonData(common_data), physicalEqations(physical_eqations) {
510 sYmm = false;
511 }
constexpr auto field_name

Member Function Documentation

◆ doWork()

MoFEMErrorCode CohesiveElement::CohesiveInterfaceElement::OpLhs::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data 
)
inline

Definition at line 514 of file CohesiveInterfaceElement.hpp.

517 {
519
520 try {
521 int nb_row = row_data.getIndices().size();
522 if (nb_row == 0)
524 int nb_col = col_data.getIndices().size();
525 if (nb_col == 0)
527 if (physicalEqations.pRisms.find(
528 getNumeredEntFiniteElementPtr()->getEnt()) ==
529 physicalEqations.pRisms.end()) {
531 }
532 ND.resize(nb_row, 3);
533 K.resize(nb_row, nb_col);
534 K.clear();
535 int nb_gauss_pts = row_data.getN().size1();
536 for (int gg = 0; gg < nb_gauss_pts; gg++) {
538 getFEMethod());
539 double w = getGaussPts()(2, gg) *
540 cblas_dnrm2(3, &getNormalsAtGaussPtsF3()(gg, 0), 1) * 0.5;
541 ND.clear();
542 for (int nn = 0; nn < nb_row / 3; nn++) {
543 for (int dd = 0; dd < 3; dd++) {
544 for (int DD = 0; DD < 3; DD++) {
545 ND(3 * nn + dd, DD) += row_data.getN(gg)[nn] * D(dd, DD);
546 }
547 }
548 }
549 for (int nn = 0; nn < nb_row / 3; nn++) {
550 for (int dd = 0; dd < 3; dd++) {
551 for (int NN = 0; NN < nb_col / 3; NN++) {
552 for (int DD = 0; DD < 3; DD++) {
553 K(3 * nn + dd, 3 * NN + DD) +=
554 w * ND(3 * nn + dd, DD) * col_data.getN(gg)[NN];
555 }
556 }
557 }
558 }
559 }
560 CHKERR MatSetValues(getFEMethod()->snes_B, nb_row,
561 &row_data.getIndices()[0], nb_col,
562 &col_data.getIndices()[0], &K(0, 0), ADD_VALUES);
563 } catch (const std::exception &ex) {
564 std::ostringstream ss;
565 ss << "throw in method: " << ex.what() << std::endl;
566 SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, "%s",
567 ss.str().c_str());
568 }
570 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_STD_EXCEPTION_THROW
Definition definitions.h:39
#define CHKERR
Inline error check.
#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
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
virtual MoFEMErrorCode calculateTangentStiffeness(MatrixDouble &tangent_matrix, int gg, CommonData &common_data, const FEMethod *fe_method)
Calculate tangent stiffness.

Member Data Documentation

◆ commonData

CommonData& CohesiveElement::CohesiveInterfaceElement::OpLhs::commonData

Definition at line 503 of file CohesiveInterfaceElement.hpp.

◆ D

MatrixDouble CohesiveElement::CohesiveInterfaceElement::OpLhs::D

Definition at line 513 of file CohesiveInterfaceElement.hpp.

◆ K

MatrixDouble CohesiveElement::CohesiveInterfaceElement::OpLhs::K

Definition at line 513 of file CohesiveInterfaceElement.hpp.

◆ ND

MatrixDouble CohesiveElement::CohesiveInterfaceElement::OpLhs::ND

Definition at line 513 of file CohesiveInterfaceElement.hpp.

◆ physicalEqations

PhysicalEquation& CohesiveElement::CohesiveInterfaceElement::OpLhs::physicalEqations

Definition at line 504 of file CohesiveInterfaceElement.hpp.


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