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

Operator calculate right hand side vector. More...

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

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

Public Member Functions

 OpRhs (const std::string field_name, CommonData &common_data, PhysicalEquation &physical_eqations)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 

Public Attributes

CommonData & commonData
 
PhysicalEquation & physicalEqations
 
VectorDouble traction
 
VectorDouble Nf
 

Detailed Description

Operator calculate right hand side vector.

Definition at line 449 of file CohesiveInterfaceElement.hpp.

Constructor & Destructor Documentation

◆ OpRhs()

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

Definition at line 453 of file CohesiveInterfaceElement.hpp.

455 : FlatPrismElementForcesAndSourcesCore::UserDataOperator(
456 field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
457 commonData(common_data), physicalEqations(physical_eqations) {}
constexpr auto field_name

Member Function Documentation

◆ doWork()

MoFEMErrorCode CohesiveElement::CohesiveInterfaceElement::OpRhs::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData &  data 
)
inline

Definition at line 460 of file CohesiveInterfaceElement.hpp.

461 {
463
464 try {
465 int nb_dofs = data.getIndices().size();
466 if (nb_dofs == 0)
468 if (physicalEqations.pRisms.find(
469 getNumeredEntFiniteElementPtr()->getEnt()) ==
470 physicalEqations.pRisms.end()) {
472 }
473 Nf.resize(nb_dofs);
474 Nf.clear();
475 int nb_gauss_pts = data.getN().size1();
476 for (int gg = 0; gg < nb_gauss_pts; gg++) {
478 getFEMethod());
479 double w = getGaussPts()(2, gg) *
480 cblas_dnrm2(3, &getNormalsAtGaussPtsF3()(gg, 0), 1) * 0.5;
481 for (int nn = 0; nn < nb_dofs / 3; nn++) {
482 for (int dd = 0; dd < 3; dd++) {
483 Nf[3 * nn + dd] += w * data.getN(gg)[nn] * traction[dd];
484 }
485 }
486 }
487 CHKERR VecSetValues(getFEMethod()->snes_f, data.getIndices().size(),
488 &data.getIndices()[0], &Nf[0], ADD_VALUES);
489 } catch (const std::exception &ex) {
490 std::ostringstream ss;
491 ss << "throw in method: " << ex.what() << std::endl;
492 SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, "%s",
493 ss.str().c_str());
494 }
496 }
#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 VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
virtual MoFEMErrorCode calculateTraction(VectorDouble &traction, int gg, CommonData &common_data, const FEMethod *fe_method)
Calculate tractions.

Member Data Documentation

◆ commonData

CommonData& CohesiveElement::CohesiveInterfaceElement::OpRhs::commonData

Definition at line 451 of file CohesiveInterfaceElement.hpp.

◆ Nf

VectorDouble CohesiveElement::CohesiveInterfaceElement::OpRhs::Nf

Definition at line 459 of file CohesiveInterfaceElement.hpp.

◆ physicalEqations

PhysicalEquation& CohesiveElement::CohesiveInterfaceElement::OpRhs::physicalEqations

Definition at line 452 of file CohesiveInterfaceElement.hpp.

◆ traction

VectorDouble CohesiveElement::CohesiveInterfaceElement::OpRhs::traction

Definition at line 459 of file CohesiveInterfaceElement.hpp.


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