v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ContactOps::OpConstrainBoundaryLhs_dTraction Struct Reference

#include <users_modules/tutorials/adv-1/src/ContactOps.hpp>

Inheritance diagram for ContactOps::OpConstrainBoundaryLhs_dTraction:
[legend]
Collaboration diagram for ContactOps::OpConstrainBoundaryLhs_dTraction:
[legend]

Public Member Functions

 OpConstrainBoundaryLhs_dTraction (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 191 of file ContactOps.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryLhs_dTraction()

ContactOps::OpConstrainBoundaryLhs_dTraction::OpConstrainBoundaryLhs_dTraction ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr 
)
Examples
ContactOps.hpp.

Definition at line 444 of file ContactOps.hpp.

447 : AssemblyBoundaryEleOp(row_field_name, col_field_name,
449 commonDataPtr(common_data_ptr) {
450 sYmm = false;
451}
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
Definition: contact.cpp:53
boost::shared_ptr< CommonData > commonDataPtr
Definition: ContactOps.hpp:199
@ OPROWCOL
operator doWork is executed on FE rows &columns

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode ContactOps::OpConstrainBoundaryLhs_dTraction::iNtegrate ( EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data 
)
Examples
ContactOps.hpp.

Definition at line 453 of file ContactOps.hpp.

455 {
457
458 const size_t nb_gauss_pts = getGaussPts().size2();
459 auto &locMat = AssemblyBoundaryEleOp::locMat;
460
461 auto t_normal = getFTensor1Normal();
462 t_normal(i) /= sqrt(t_normal(j) * t_normal(j));
463
464 auto t_disp = getFTensor1FromMat<SPACE_DIM>(commonDataPtr->contactDisp);
465 auto t_traction =
466 getFTensor1FromMat<SPACE_DIM>(commonDataPtr->contactTraction);
467 auto t_coords = getFTensor1CoordsAtGaussPts();
468
469 auto t_w = getFTensor0IntegrationWeight();
470 auto t_row_base = row_data.getFTensor1N<3>();
471 size_t nb_face_functions = row_data.getN().size2() / 3;
472
473 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
474
475 const double alpha = t_w * getMeasure();
476
477 FTensor::Tensor1<double, 3> t_spatial_coords{0., 0., 0.};
478 t_spatial_coords(i) = t_coords(i) + t_disp(i);
479
480 auto sdf =
481 surface_distance_function(getTStime(), t_spatial_coords, t_traction);
482 auto t_grad_sdf = grad_surface_distance_function(
483 getTStime(), t_spatial_coords, t_traction);
484 auto tn = -t_traction(i) * t_grad_sdf(i);
485 auto c = constrain(sdf, tn);
486
488 t_cP(i, j) = (c * t_grad_sdf(i)) * t_grad_sdf(j);
490 t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
491
493 t_res_dt(i, j) = -cn * t_cQ(i, j);
494
495 size_t rr = 0;
496 for (; rr != AssemblyBoundaryEleOp::nbRows / SPACE_DIM; ++rr) {
497
498 auto t_mat = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
499 locMat, SPACE_DIM * rr);
500 const double row_base = t_row_base(i) * t_normal(i);
501
502 auto t_col_base = col_data.getFTensor1N<3>(gg, 0);
503 for (size_t cc = 0; cc != AssemblyBoundaryEleOp::nbCols / SPACE_DIM;
504 ++cc) {
505 const double col_base = t_col_base(i) * t_normal(i);
506 const double beta = alpha * row_base * col_base;
507
508 t_mat(i, j) -= beta * t_res_dt(i, j);
509
510 ++t_col_base;
511 ++t_mat;
512 }
513
514 ++t_row_base;
515 }
516 for (; rr < nb_face_functions; ++rr)
517 ++t_row_base;
518
519 ++t_disp;
520 ++t_traction;
521 ++t_coords;
522 ++t_w;
523 }
524
526}
constexpr int SPACE_DIM
double cn
Definition: contact.cpp:124
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
const double c
speed of light (cm/ns)
FTensor::Tensor1< double, 3 > grad_surface_distance_function(double t, FTensor::Tensor1< T1, 3 > &t_coords, FTensor::Tensor1< T2, SPACE_DIM > &t_traction)
Definition: ContactOps.hpp:221
FTensor::Index< 'j', SPACE_DIM > j
Definition: ContactOps.hpp:167
FTensor::Index< 'i', SPACE_DIM > i
[Common data]
Definition: ContactOps.hpp:166
double surface_distance_function(double t, FTensor::Tensor1< T1, 3 > &t_coords, FTensor::Tensor1< T2, SPACE_DIM > &t_traction)
Definition: ContactOps.hpp:204
double constrain(double sdf, double tn)
Definition: ContactOps.hpp:268
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
Definition: sdf.py:1

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> ContactOps::OpConstrainBoundaryLhs_dTraction::commonDataPtr
private
Examples
ContactOps.hpp.

Definition at line 199 of file ContactOps.hpp.


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