v0.14.0
Public Types | Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS > Struct Template Reference

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

Inheritance diagram for EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >:
[legend]
Collaboration diagram for EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >:
[legend]

Public Types

using OP = typename FormsIntegrators< FaceUserDataOperator >::Assembly< A >::OpBrokenBase
 

Public Member Functions

 OpConstrainBoundaryL2Lhs_dP (std::string row_field_name, boost::shared_ptr< std::vector< BrokenBaseSideData >> broken_base_side_data, 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

template<AssemblyType A>
struct EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >

Definition at line 175 of file EshelbianContact.hpp.

Member Typedef Documentation

◆ OP

template<AssemblyType A>
using EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly< A>::OpBrokenBase

Definition at line 179 of file EshelbianContact.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryL2Lhs_dP()

template<AssemblyType A>
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::OpConstrainBoundaryL2Lhs_dP ( std::string  row_field_name,
boost::shared_ptr< std::vector< BrokenBaseSideData >>  broken_base_side_data,
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 686 of file EshelbianContact.cpp.

693  : OP(row_field_name, broken_base_side_data, false, false),
694  commonDataPtr(common_data_ptr), contactTreePtr(contact_tree_ptr),
695  sdfMapRangePtr(sdf_map_range_ptr) {
696  OP::sYmm = false;
697 }

Member Function Documentation

◆ iNtegrate()

template<AssemblyType A>
MoFEMErrorCode EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::iNtegrate ( EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)

Definition at line 701 of file EshelbianContact.cpp.

703  {
705 
706  using namespace ContactOps;
707 
711 
712  auto nb_rows = row_data.getIndices().size();
713  auto nb_cols = col_data.getIndices().size();
714 
715  auto &locMat = AssemblyBoundaryEleOp::locMat;
716  locMat.resize(nb_rows, nb_cols, false);
717  locMat.clear();
718 
719  if (nb_cols && nb_rows) {
720 
721  const size_t nb_gauss_pts = OP::getGaussPts().size2();
722 
723  auto t_w = OP::getFTensor0IntegrationWeight();
724  auto t_disp = getFTensor1FromMat<3>(commonDataPtr->contactDisp);
725  auto t_traction = getFTensor1FromMat<3>(commonDataPtr->contactTraction);
726  auto t_coords = OP::getFTensor1CoordsAtGaussPts();
727  auto t_material_normal = OP::getFTensor1NormalsAtGaussPts();
728 
729  // placeholder to pass boundary block id to python
730  auto [block_id, m_normals_at_pts, v_sdf, m_grad_sdf, m_hess_sdf] =
731  getSdf(this, commonDataPtr->contactDisp,
732  checkSdf(OP::getFEEntityHandle(), *sdfMapRangePtr), false);
733 
734  auto t_sdf_v = getFTensor0FromVec(v_sdf);
735  auto t_grad_sdf_v = getFTensor1FromMat<3>(m_grad_sdf);
736 
737  auto next = [&]() {
738  ++t_w;
739  ++t_disp;
740  ++t_traction;
741  ++t_coords;
742  ++t_material_normal;
743  ++t_sdf_v;
744  ++t_grad_sdf_v;
745  };
746 
747  auto face_data_vec_ptr =
748  contactTreePtr->findFaceDataVecPtr(OP::getFEEntityHandle());
749  auto face_gauss_pts_it = face_data_vec_ptr->begin();
750 
751  auto t_row_base = row_data.getFTensor0N();
752  auto nb_face_functions = row_data.getN().size2();
753 
754  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
755 
756  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
757 
758  auto face_data_ptr = contactTreePtr->getFaceDataPtr(face_gauss_pts_it, gg,
759  face_data_vec_ptr);
760 
761  auto check_face_contact = [&]() {
762  if (face_data_ptr) {
763  return true;
764  }
765  return false;
766  };
767 
769 
770 #ifdef PYTHON_SDF
771  auto tn = t_traction(i) * t_grad_sdf_v(i);
772  auto c = ContactOps::constrain(t_sdf_v, tn);
773 #else
774  constexpr double c = 0;
775 #endif
776 
777  if (!c && check_face_contact()) {
778  FTensor::Tensor1<double, 3> t_spatial_coords;
779  t_spatial_coords(i) = t_coords(i) + t_disp(i);
780  constexpr double eps = std::numeric_limits<float>::epsilon();
781  for (auto ii = 0; ii != 3; ++ii) {
782  FTensor::Tensor1<std::complex<double>, 3> t_traction_cx{
783  t_traction(0), t_traction(1), t_traction(2)};
784  t_traction_cx(ii) += eps * 1i;
785  auto t_rhs_tmp =
786  multiPointRhs(face_data_ptr, t_coords, t_spatial_coords,
787  t_traction_cx, MultiPointRhsType::U);
788  for (int jj = 0; jj != 3; ++jj) {
789  auto v = t_rhs_tmp(jj).imag();
790  t_res_dP(jj, ii) = v / eps;
791  }
792  }
793  } else {
794 
795 #ifdef PYTHON_SDF
797  t_cP(i, j) = (c * t_grad_sdf_v(i)) * t_grad_sdf_v(j);
798  t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
799  t_res_dP(i, j) = t_cQ(i, j);
800 #else
801  t_res_dP(i, j) = t_kd(i, j);
802 #endif
803  }
804 
805  const double alpha = t_w / 2.;
806  size_t rr = 0;
807  for (; rr != nb_rows / 3; ++rr) {
808 
809  auto t_mat = getFTensor2FromArray<3, 3, 3>(locMat, 3 * rr);
810  auto t_col_base = col_data.getFTensor1N<3>(gg, 0);
811 
812  for (size_t cc = 0; cc != nb_cols / 3; ++cc) {
813  auto col_base = t_col_base(i) * t_material_normal(i);
814  const double beta = alpha * t_row_base * col_base;
815  t_mat(i, j) += beta * t_res_dP(i, j);
816  ++t_col_base;
817  ++t_mat;
818  }
819 
820  ++t_row_base;
821  }
822  for (; rr < nb_face_functions; ++rr)
823  ++t_row_base;
824 
825  next();
826  }
827  }
828 
830 }

Member Data Documentation

◆ commonDataPtr

template<AssemblyType A>
boost::shared_ptr<ContactOps::CommonData> EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::commonDataPtr
private

Definition at line 192 of file EshelbianContact.hpp.

◆ contactTreePtr

template<AssemblyType A>
boost::shared_ptr<ContactTree> EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::contactTreePtr
private

Definition at line 193 of file EshelbianContact.hpp.

◆ sdfMapRangePtr

template<AssemblyType A>
boost::shared_ptr<std::map<int, Range> > EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::sdfMapRangePtr
private

Definition at line 194 of file EshelbianContact.hpp.


The documentation for this struct was generated from the following files:
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::OP
typename FormsIntegrators< FaceUserDataOperator >::Assembly< A >::OpBrokenBase OP
Definition: EshelbianContact.hpp:179
MoFEM::OpBaseImpl::locMat
MatrixDouble locMat
local entity block matrix
Definition: FormsIntegrators.hpp:249
FTensor::Tensor1< double, 3 >
ContactOps
Definition: contact.cpp:99
ContactOps::constrain
double constrain(double sdf, double tn)
constrain function
Definition: ContactOps.hpp:603
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:17
FTensor::Tensor2< double, 3, 3 >
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:193
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::sdfMapRangePtr
boost::shared_ptr< std::map< int, Range > > sdfMapRangePtr
Definition: EshelbianContact.hpp:194
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:192
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
FTensor::Index< 'i', 3 >
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
FTensor::kronecker_delta
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
Definition: Kronecker_Delta.hpp:81
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:202
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:429
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
EshelbianPlasticity::getSdf
auto getSdf(OP_PTR op_ptr, MatrixDouble &contact_disp, int block_id, bool eval_hessian)
Definition: EshelbianContact.cpp:26