v0.16.0
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

CommonDatacommonData
 
PhysicalEquationphysicalEqations
 
MatrixDouble K
 
MatrixDouble D
 
MatrixDouble ND
 

Detailed Description

Operator calculate element stiffens matrix.

Definition at line 496 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 500 of file CohesiveInterfaceElement.hpp.

502 : FlatPrismElementForcesAndSourcesCore::UserDataOperator(
503 field_name, ForcesAndSourcesCore::UserDataOperator::OPROWCOL),
504 commonData(common_data), physicalEqations(physical_eqations) {
505 sYmm = false;
506 }
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 509 of file CohesiveInterfaceElement.hpp.

512 {
514
515 try {
516 int nb_row = row_data.getIndices().size();
517 if (nb_row == 0)
519 int nb_col = col_data.getIndices().size();
520 if (nb_col == 0)
522 if (physicalEqations.pRisms.find(
523 getNumeredEntFiniteElementPtr()->getEnt()) ==
524 physicalEqations.pRisms.end()) {
526 }
527 ND.resize(nb_row, 3);
528 K.resize(nb_row, nb_col);
529 K.clear();
530 int nb_gauss_pts = row_data.getN().size1();
531 for (int gg = 0; gg < nb_gauss_pts; gg++) {
533 getFEMethod());
534 double w = getGaussPts()(2, gg) *
535 cblas_dnrm2(3, &getNormalsAtGaussPtsF3()(gg, 0), 1) * 0.5;
536 ND.clear();
537 for (int nn = 0; nn < nb_row / 3; nn++) {
538 for (int dd = 0; dd < 3; dd++) {
539 for (int DD = 0; DD < 3; DD++) {
540 ND(3 * nn + dd, DD) += row_data.getN(gg)[nn] * D(dd, DD);
541 }
542 }
543 }
544 for (int nn = 0; nn < nb_row / 3; nn++) {
545 for (int dd = 0; dd < 3; dd++) {
546 for (int NN = 0; NN < nb_col / 3; NN++) {
547 for (int DD = 0; DD < 3; DD++) {
548 K(3 * nn + dd, 3 * NN + DD) +=
549 w * ND(3 * nn + dd, DD) * col_data.getN(gg)[NN];
550 }
551 }
552 }
553 }
554 }
555 CHKERR MatSetValues(getFEMethod()->snes_B, nb_row,
556 &row_data.getIndices()[0], nb_col,
557 &col_data.getIndices()[0], &K(0, 0), ADD_VALUES);
558 } catch (const std::exception &ex) {
559 std::ostringstream ss;
560 ss << "throw in method: " << ex.what() << std::endl;
561 SETERRQ(PETSC_COMM_SELF, 1, ss.str().c_str());
562 }
564 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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 498 of file CohesiveInterfaceElement.hpp.

◆ D

MatrixDouble CohesiveElement::CohesiveInterfaceElement::OpLhs::D

Definition at line 508 of file CohesiveInterfaceElement.hpp.

◆ K

MatrixDouble CohesiveElement::CohesiveInterfaceElement::OpLhs::K

Definition at line 508 of file CohesiveInterfaceElement.hpp.

◆ ND

MatrixDouble CohesiveElement::CohesiveInterfaceElement::OpLhs::ND

Definition at line 508 of file CohesiveInterfaceElement.hpp.

◆ physicalEqations

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

Definition at line 499 of file CohesiveInterfaceElement.hpp.


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