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

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

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

Inheritance diagram for CohesiveElement::CohesiveInterfaceElement::OpCalculateGapGlobal:
[legend]
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

CommonData & commonData
 

Detailed Description

Operator calculate gap, normal vector and rotation matrix.

Definition at line 351 of file CohesiveInterfaceElement.hpp.

Constructor & Destructor Documentation

◆ OpCalculateGapGlobal()

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

Definition at line 355 of file CohesiveInterfaceElement.hpp.

356 : FlatPrismElementForcesAndSourcesCore::UserDataOperator(
357 field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
358 commonData(common_data) {}
constexpr auto field_name

Member Function Documentation

◆ doWork()

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

Definition at line 360 of file CohesiveInterfaceElement.hpp.

361 {
363 try {
364 int nb_dofs = data.getIndices().size();
365 if (nb_dofs == 0)
367 int nb_gauss_pts = data.getN().size1();
368 if (type == MBVERTEX) {
369 commonData.R.resize(nb_gauss_pts);
370 for (int gg = 0; gg < nb_gauss_pts; gg++) {
371 commonData.R[gg].resize(3, 3);
372 double nrm2_normal = 0;
373 double nrm2_tangent1 = 0;
374 double nrm2_tangent2 = 0;
375 for (int dd = 0; dd < 3; dd++) {
376 nrm2_normal += pow(getNormalsAtGaussPtsF3()(gg, dd), 2);
377 nrm2_tangent1 += pow(getTangent1AtGaussPtF3()(gg, dd), 2);
378 nrm2_tangent2 += pow(getTangent2AtGaussPtF3()(gg, dd), 2);
379 }
380 nrm2_normal = sqrt(nrm2_normal);
381 nrm2_tangent1 = sqrt(nrm2_tangent1);
382 nrm2_tangent2 = sqrt(nrm2_tangent2);
383 for (int dd = 0; dd < 3; dd++) {
384 commonData.R[gg](0, dd) =
385 getNormalsAtGaussPtsF3()(gg, dd) / nrm2_normal;
386 commonData.R[gg](1, dd) =
387 getTangent1AtGaussPtF3()(gg, dd) / nrm2_tangent1;
388 commonData.R[gg](2, dd) =
389 getTangent2AtGaussPtF3()(gg, dd) / nrm2_tangent2;
390 }
391 }
392 }
393 if (type == MBVERTEX) {
394 commonData.gapGlob.resize(nb_gauss_pts, 3);
395 commonData.gapGlob.clear();
396 }
397 for (int gg = 0; gg < nb_gauss_pts; gg++) {
398 for (int dd = 0; dd < 3; dd++) {
399 commonData.gapGlob(gg, dd) += cblas_ddot(
400 nb_dofs / 3, &data.getN(gg)[0], 1, &data.getFieldData()[dd], 3);
401 }
402 }
403 } catch (const std::exception &ex) {
404 std::ostringstream ss;
405 ss << "throw in method: " << ex.what() << std::endl;
406 SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, "%s",
407 ss.str().c_str());
408 }
410 }
std::string type
#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 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

Member Data Documentation

◆ commonData

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

Definition at line 354 of file CohesiveInterfaceElement.hpp.


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