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

CommonDatacommonData
 

Detailed Description

Operator calculate gap, normal vector and rotation matrix.

Definition at line 349 of file CohesiveInterfaceElement.hpp.

Constructor & Destructor Documentation

◆ OpCalculateGapGlobal()

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

Definition at line 353 of file CohesiveInterfaceElement.hpp.

354 : FlatPrismElementForcesAndSourcesCore::UserDataOperator(
355 field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
356 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 358 of file CohesiveInterfaceElement.hpp.

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


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