v0.13.1
Public Member Functions | Public Attributes | List of all members
CohesiveElement::CohesiveInterfaceElement::OpCalculateGapGlobal Struct Reference

Operator calculate gap, normal vector and rotation matrix. More...

#include <users_modules/basic_finite_elements/cohesive_interface/src/CohesiveInterfaceElement.hpp>

Inherits FlatPrismElementForcesAndSourcesCore::UserDataOperator.

Collaboration diagram for CohesiveElement::CohesiveInterfaceElement::OpCalculateGapGlobal:
[legend]

Public Member Functions

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

Public Attributes

CommonDatacommonData
 

Detailed Description

Operator calculate gap, normal vector and rotation matrix.

Definition at line 342 of file CohesiveInterfaceElement.hpp.

Constructor & Destructor Documentation

◆ OpCalculateGapGlobal()

CohesiveElement::CohesiveInterfaceElement::OpCalculateGapGlobal::OpCalculateGapGlobal ( const std::string  field_name,
CommonData common_data 
)

Definition at line 345 of file CohesiveInterfaceElement.hpp.

345 :
346 FlatPrismElementForcesAndSourcesCore::UserDataOperator(field_name,ForcesAndSourcesCore::UserDataOperator::OPROW),
347 commonData(common_data) {}
ForcesAndSourcesCore::UserDataOperator UserDataOperator
constexpr auto field_name

Member Function Documentation

◆ doWork()

MoFEMErrorCode CohesiveElement::CohesiveInterfaceElement::OpCalculateGapGlobal::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)

Definition at line 349 of file CohesiveInterfaceElement.hpp.

350 {
352 try {
353 int nb_dofs = data.getIndices().size();
354 if(nb_dofs == 0) MoFEMFunctionReturnHot(0);
355 int nb_gauss_pts = data.getN().size1();
356 if(type == MBVERTEX) {
357 commonData.R.resize(nb_gauss_pts);
358 for(int gg = 0;gg<nb_gauss_pts;gg++) {
359 commonData.R[gg].resize(3,3);
360 double nrm2_normal = 0;
361 double nrm2_tangent1 = 0;
362 double nrm2_tangent2 = 0;
363 for(int dd = 0;dd<3;dd++) {
364 nrm2_normal += pow(getNormalsAtGaussPtsF3()(gg,dd),2);
365 nrm2_tangent1 += pow(getTangent1AtGaussPtF3()(gg,dd),2);
366 nrm2_tangent2 += pow(getTangent2AtGaussPtF3()(gg,dd),2);
367 }
368 nrm2_normal = sqrt(nrm2_normal);
369 nrm2_tangent1 = sqrt(nrm2_tangent1);
370 nrm2_tangent2 = sqrt(nrm2_tangent2);
371 for(int dd = 0;dd<3;dd++) {
372 commonData.R[gg](0,dd) = getNormalsAtGaussPtsF3()(gg,dd)/nrm2_normal;
373 commonData.R[gg](1,dd) = getTangent1AtGaussPtF3()(gg,dd)/nrm2_tangent1;
374 commonData.R[gg](2,dd) = getTangent2AtGaussPtF3()(gg,dd)/nrm2_tangent2;
375 }
376 }
377 }
378 if(type == MBVERTEX) {
379 commonData.gapGlob.resize(nb_gauss_pts,3);
380 commonData.gapGlob.clear();
381 }
382 for(int gg = 0;gg<nb_gauss_pts;gg++) {
383 for(int dd = 0;dd<3;dd++) {
384 commonData.gapGlob(gg,dd) += cblas_ddot(
385 nb_dofs/3,&data.getN(gg)[0],1,&data.getFieldData()[dd],3);
386 }
387 }
388 } catch (const std::exception& ex) {
389 std::ostringstream ss;
390 ss << "throw in method: " << ex.what() << std::endl;
391 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
392 }
394 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
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

◆ commonData

CommonData& CohesiveElement::CohesiveInterfaceElement::OpCalculateGapGlobal::commonData

Definition at line 344 of file CohesiveInterfaceElement.hpp.


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