v0.14.0
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU Struct Reference

#include <users_modules/eshelbian_plasticit/src/EshelbianContact.hpp>

Inheritance diagram for EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU:
[legend]
Collaboration diagram for EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU:
[legend]

Public Member Functions

 OpConstrainBoundaryL2Lhs_dU (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< ContactOps::CommonData > common_data_ptr, boost::shared_ptr< ContactTree > contact_tree_ptr, boost::shared_ptr< std::map< int, Range >> sdf_map_range_ptr=nullptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Private Attributes

boost::shared_ptr< ContactOps::CommonDatacommonDataPtr
 
boost::shared_ptr< ContactTreecontactTreePtr
 
boost::shared_ptr< std::map< int, Range > > sdfMapRangePtr
 

Detailed Description

Examples
EshelbianPlasticity.cpp.

Definition at line 143 of file EshelbianContact.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryL2Lhs_dU()

EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::OpConstrainBoundaryL2Lhs_dU ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< ContactOps::CommonData common_data_ptr,
boost::shared_ptr< ContactTree contact_tree_ptr,
boost::shared_ptr< std::map< int, Range >>  sdf_map_range_ptr = nullptr 
)

Definition at line 497 of file EshelbianContact.cpp.

502  : ContactOps::AssemblyBoundaryEleOp(row_field_name, col_field_name,
504  commonDataPtr(common_data_ptr), contactTreePtr(contact_tree_ptr),
505  sdfMapRangePtr(sdf_map_range_ptr) {
506 
507  sYmm = false;
508 }

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::iNtegrate ( EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)

Definition at line 511 of file EshelbianContact.cpp.

512  {
514 
515  using namespace ContactOps;
516 
520 
521  auto nb_rows = row_data.getIndices().size();
522  auto nb_cols = col_data.getIndices().size();
523 
524  auto &locMat = AssemblyBoundaryEleOp::locMat;
525  locMat.resize(nb_rows, nb_cols, false);
526  locMat.clear();
527 
528  if (nb_cols && nb_rows) {
529 
530  auto nb_gauss_pts = getGaussPts().size2();
531  auto t_w = getFTensor0IntegrationWeight();
532  auto t_coords = getFTensor1CoordsAtGaussPts();
533  auto t_disp = getFTensor1FromMat<3>(commonDataPtr->contactDisp);
534  auto t_traction = getFTensor1FromMat<3>(commonDataPtr->contactTraction);
535 
536  // placeholder to pass boundary block id to python
537  auto [block_id, m_normals_at_pts, v_sdf, m_grad_sdf, m_hess_sdf] =
538  getSdf(this, commonDataPtr->contactDisp,
539  checkSdf(getFEEntityHandle(), *sdfMapRangePtr), true);
540 
541  auto t_sdf_v = getFTensor0FromVec(v_sdf);
542  auto t_grad_sdf_v = getFTensor1FromMat<3>(m_grad_sdf);
543  auto t_hess_sdf_v = getFTensor2SymmetricFromMat<3>(m_hess_sdf);
544  auto t_normalized_normal = getFTensor1FromMat<3>(m_normals_at_pts);
545 
546  auto next = [&]() {
547  ++t_w;
548  ++t_coords;
549  ++t_disp;
550  ++t_traction;
551  ++t_sdf_v;
552  ++t_grad_sdf_v;
553  ++t_hess_sdf_v;
554  ++t_normalized_normal;
555  };
556 
557  auto face_data_vec_ptr =
558  contactTreePtr->findFaceDataVecPtr(getFEEntityHandle());
559  auto face_gauss_pts_it = face_data_vec_ptr->begin();
560 
561  auto t_row_base = row_data.getFTensor0N();
562  auto nb_face_functions = row_data.getN().size2() / 3;
563  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
564 
565  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
566 
567  auto face_data_ptr = contactTreePtr->getFaceDataPtr(face_gauss_pts_it, gg,
568  face_data_vec_ptr);
569 
570  auto check_face_contact = [&]() {
571  if (face_data_ptr) {
572  return true;
573  }
574  return false;
575  };
576 
578 
579  auto tn = t_traction(i) * t_grad_sdf_v(i);
580  auto c = constrain(t_sdf_v, tn);
581  if (!c && check_face_contact()) {
582  FTensor::Tensor1<double, 3> t_spatial_coords;
583  t_spatial_coords(i) = t_coords(i) + t_disp(i);
584  constexpr double eps = std::numeric_limits<float>::epsilon();
585  for (auto ii = 0; ii < 3; ++ii) {
586  FTensor::Tensor1<std::complex<double>, 3> t_spatial_coords_cx{
587  t_spatial_coords(0), t_spatial_coords(1), t_spatial_coords(2)};
588  t_spatial_coords_cx(ii) += eps * 1i;
589  auto t_rhs_tmp =
590  multiPointRhs(face_data_ptr, t_coords, t_spatial_coords_cx,
591  t_traction, MultiPointRhsType::U);
592  for (int jj = 0; jj != 3; ++jj) {
593  auto v = t_rhs_tmp(jj).imag();
594  t_res_dU(jj, ii) = v / eps;
595  }
596  }
597 
598  } else {
599 
600  auto inv_cn = ContactOps::alpha_contact_const;
601 
602  t_res_dU(i, j) =
603 
604  (-c) * (t_hess_sdf_v(i, j) * t_grad_sdf_v(k) * t_traction(k) +
605  t_grad_sdf_v(i) * t_hess_sdf_v(k, j) * t_traction(k))
606 
607  + (c * inv_cn) * (t_sdf_v * t_hess_sdf_v(i, j) +
608  t_grad_sdf_v(j) * t_grad_sdf_v(i));
609  }
610 
611  auto alpha = t_w * getMeasure();
612 
613  size_t rr = 0;
614  for (; rr != nb_rows / 3; ++rr) {
615 
616  auto t_mat = getFTensor2FromArray<3, 3, 3>(locMat, 3 * rr);
617  auto t_col_base = col_data.getFTensor0N(gg, 0);
618 
619  for (size_t cc = 0; cc != nb_cols / 3; ++cc) {
620  auto beta = alpha * t_row_base * t_col_base;
621  t_mat(i, j) += beta * t_res_dU(i, j);
622  ++t_col_base;
623  ++t_mat;
624  }
625 
626  ++t_row_base;
627  }
628  for (; rr < nb_face_functions; ++rr)
629  ++t_row_base;
630 
631  next();
632  }
633  }
634 
636 }

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<ContactOps::CommonData> EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::commonDataPtr
private

Definition at line 155 of file EshelbianContact.hpp.

◆ contactTreePtr

boost::shared_ptr<ContactTree> EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::contactTreePtr
private

Definition at line 156 of file EshelbianContact.hpp.

◆ sdfMapRangePtr

boost::shared_ptr<std::map<int, Range> > EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::sdfMapRangePtr
private

Definition at line 157 of file EshelbianContact.hpp.


The documentation for this struct was generated from the following files:
MoFEM::OpBaseImpl::locMat
MatrixDouble locMat
local entity block matrix
Definition: FormsIntegrators.hpp:239
FTensor::Tensor1< double, 3 >
ContactOps
Definition: EshelbianContact.hpp:10
ContactOps::constrain
double constrain(double sdf, double tn)
constrain function
Definition: ContactOps.hpp:572
FTensor::Kronecker_Delta
Kronecker Delta class.
Definition: Kronecker_Delta.hpp:15
EshelbianPlasticity::checkSdf
auto checkSdf(EntityHandle fe_ent, std::map< int, Range > &sdf_map_range)
Definition: EshelbianContact.cpp:27
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROWCOL
@ OPROWCOL
operator doWork is executed on FE rows &columns
Definition: ForcesAndSourcesCore.hpp:569
FTensor::Tensor2< double, 3, 3 >
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::sdfMapRangePtr
boost::shared_ptr< std::map< int, Range > > sdfMapRangePtr
Definition: EshelbianContact.hpp:157
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:155
ContactOps::AssemblyBoundaryEleOp
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
Definition: EshelbianContact.hpp:17
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
ContactOps::alpha_contact_const
double alpha_contact_const
Definition: EshelbianContact.hpp:20
FTensor::Index< 'i', 3 >
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:156
EshelbianPlasticity::multiPointRhs
auto multiPointRhs(ContactTree::FaceData *face_data_ptr, FTensor::Tensor1< T1, 3 > &t_coords, FTensor::Tensor1< T2, 3 > &t_spatial_coords, FTensor::Tensor1< T3, 3 > &t_master_traction, MultiPointRhsType type, bool debug=false)
Definition: EshelbianContact.cpp:196
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
eps
static const double eps
Definition: check_base_functions_derivatives_on_tet.cpp:11
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:193
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
EshelbianPlasticity::getSdf
auto getSdf(OP_PTR op_ptr, MatrixDouble &contact_disp, int block_id, bool eval_hessian)
Definition: EshelbianContact.cpp:36