v0.14.0
Public Member Functions | List of all members
SimpleContactProblem::OpContactTractionMasterSlave_dX Struct Reference

LHS-operator for the simple contact element. More...

#include <users_modules/mortar_contact/src/SimpleContact.hpp>

Inheritance diagram for SimpleContactProblem::OpContactTractionMasterSlave_dX:
[legend]
Collaboration diagram for SimpleContactProblem::OpContactTractionMasterSlave_dX:
[legend]

Public Member Functions

MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrates Lagrange multipliers virtual work on master side, \( \delta W_{\text c}\) derivative with respect to material positions on slave side and assembles components to LHS global matrix. More...
 
 OpContactTractionMasterSlave_dX (const string field_name, const string mesh_nodes_field, boost::shared_ptr< CommonDataSimpleContact > common_data_contact, const int row_rank, const int col_rank)
 
- Public Member Functions inherited from SimpleContactProblem::OpContactALELhs
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data)
 
 OpContactALELhs (const string field_name_1, const string field_name_2, boost::shared_ptr< CommonDataSimpleContact > common_data_contact, const ContactOp::FaceType face_type, const int rank_row, const int rank_col)
 

Additional Inherited Members

- Public Attributes inherited from SimpleContactProblem::OpContactALELhs
boost::shared_ptr< CommonDataSimpleContactcommonDataSimpleContact
 
MatrixDouble matLhs
 
VectorInt rowIndices
 
VectorInt colIndices
 
int row_nb_dofs
 
int col_nb_dofs
 
int nb_gauss_pts
 
int nb_base_fun_row
 
int nb_base_fun_col
 
int rankRow
 
int rankCol
 

Detailed Description

LHS-operator for the simple contact element.

Integrates Lagrange multipliers virtual work on master side, \( \delta W_{\text c}\) derivative with respect to material positions on slave side and assembles components of the RHS vector.

Definition at line 3086 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ OpContactTractionMasterSlave_dX()

SimpleContactProblem::OpContactTractionMasterSlave_dX::OpContactTractionMasterSlave_dX ( const string  field_name,
const string  mesh_nodes_field,
boost::shared_ptr< CommonDataSimpleContact common_data_contact,
const int  row_rank,
const int  col_rank 
)
inline
Parameters
field_nameString of field name for spatial positions for rows
mesh_nodes_fieldString of field name for material positions for columns
common_data_contactPointer to the common data for simple contact element
row_rankParameter setting the dimension of the associated field for rows (in this case is 3)
col_rankParameter setting the dimension of the associated field for cols (in this case is 3)

Definition at line 3148 of file SimpleContact.hpp.

3152  : OpContactALELhs(field_name, mesh_nodes_field, common_data_contact,
3153  ContactOp::FACEMASTERSLAVE, row_rank, col_rank) {
3154  sYmm = false; // This will make sure to loop over all intities (e.g.
3155  // for order=2 it will make doWork to loop 16 time)
3156  }

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode SimpleContactProblem::OpContactTractionMasterSlave_dX::iNtegrate ( EntData row_data,
EntData col_data 
)
virtual

Integrates Lagrange multipliers virtual work on master side, \( \delta W_{\text c}\) derivative with respect to material positions on slave side and assembles components to LHS global matrix.

\[ \textrm{D} \delta W_{\rm{c}}({\mathbf{x}}^{(2)}, {\mathbf{X}}^{(2)}, \lambda, \delta{\mathbf{x}}^{(2)}) [\Delta{\mathbf{X}}^{(1)}] = -\int\limits_{\mathcal{T}^{(2)}_{\xi}} \lambda \, \left[ \textrm{D}\mathbf{N}^{(1)}(\mathbf{X}^{(1)})[\Delta\mathbf{X}^{(1)}] \frac{1}{||{{\mathbf N}^{(1)}(\xi, \eta)}||} - \frac{{\mathbf N}^{(1)}(\xi, \eta)}{{\left(||{{\mathbf N}^{(1)}(\xi, \eta)}|| \right)}^{3}} \textrm{D}\mathbf{N}^{(1)}(\mathbf{X}^{(1)})[\Delta\mathbf{X}^{(1)}] \cdot {{\mathbf N}^{(1)}(\xi, \eta)} \right] \cdot \delta{\mathbf{x}}^{(1)} {||{{\mathbf N}^{(2)}(\xi, \eta)}||} \textrm{d}\xi\textrm{d}\eta \]

Where

\[ \textrm{D}\mathbf{N}^{(1)}(\mathbf{X}^{(1)})[\Delta\mathbf{X}^{(1)}] = \frac{\partial{\Delta\mathbf{X}}^{(1)}} {\partial\xi} \times \frac{\partial {\mathbf{X}}^{(1)}}{\partial\eta} + \frac{\partial{\mathbf{X}}^{(1)}} {\partial\xi} \times \frac{\partial {\Delta\mathbf{X}}^{(1)}}{\partial\eta} \]

Here superscripts \((1)\) and \((2)\) denote slave and master side coordinates and surfaces, respectively. Moreover, \(\lambda\) is the lagrange multiplier.

Reimplemented from SimpleContactProblem::OpContactALELhs.

Definition at line 3530 of file SimpleContact.cpp.

3531  {
3533 
3534  // Both sides are needed since both sides contribute their shape
3535  // function to the stiffness matrix
3536  const int nb_row = row_data.getIndices().size();
3537  if (!nb_row)
3539  const int nb_col = col_data.getIndices().size();
3540  if (!nb_col)
3542  const int nb_gauss_pts = row_data.getN().size1();
3543 
3544  int nb_base_fun_row = row_data.getFieldData().size() / 3;
3545  int nb_base_fun_col = col_data.getFieldData().size() / 3;
3546 
3547  auto get_tensor_from_mat = [](MatrixDouble &m, const int r, const int c) {
3549  &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 1, c + 0),
3550  &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 2, c + 0), &m(r + 2, c + 1),
3551  &m(r + 2, c + 2));
3552  };
3553 
3554  auto get_tensor_vec = [](VectorDouble &n) {
3555  return FTensor::Tensor1<double *, 3>(&n(0), &n(1), &n(2));
3556  };
3557 
3558  auto get_tensor_vec_3 = [&](VectorDouble3 &n) {
3559  return FTensor::Tensor1<double *, 3>(&n(0), &n(1), &n(2));
3560  };
3561 
3565 
3566  auto make_vec_der = [&](auto t_N, auto t_1, auto t_2) {
3568  t_n(i, j) = 0;
3569  t_n(i, j) += FTensor::levi_civita(i, j, k) * t_2(k) * t_N(0);
3570  t_n(i, j) -= FTensor::levi_civita(i, j, k) * t_1(k) * t_N(1);
3571  return t_n;
3572  };
3573 
3574  auto lagrange_slave =
3575  getFTensor0FromVec(*commonDataSimpleContact->lagMultAtGaussPtsPtr);
3576 
3577  const double area_s = commonDataSimpleContact->areaSlave;
3578 
3579  const double area_m = commonDataSimpleContact->areaMaster;
3580 
3581  auto t_1 = get_tensor_vec(*commonDataSimpleContact->tangentOneVectorSlavePtr);
3582  auto t_2 = get_tensor_vec(*commonDataSimpleContact->tangentTwoVectorSlavePtr);
3583 
3584  auto t_const_unit_slave =
3585  get_tensor_vec(*(commonDataSimpleContact->normalVectorSlavePtr));
3586 
3587  auto t_w = getFTensor0IntegrationWeightMaster();
3588  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
3589 
3590  auto t_N = col_data.getFTensor1DiffN<2>(gg, 0);
3591 
3592  const double mult_s = 0.5 * t_w * lagrange_slave * area_m / area_s;
3593 
3594  for (int bbc = 0; bbc != nb_base_fun_col; ++bbc) {
3595 
3596  FTensor::Tensor0<double *> t_base_master(&row_data.getN()(gg, 0));
3597 
3598  for (int bbr = 0; bbr != nb_base_fun_row; ++bbr) {
3599  const double s = mult_s * t_base_master;
3600 
3601  auto t_d_n = make_vec_der(t_N, t_1, t_2);
3602 
3603  auto t_assemble_s = get_tensor_from_mat(matLhs, 3 * bbr, 3 * bbc);
3604 
3605  t_assemble_s(i, j) -=
3606  s * (-t_const_unit_slave(i) * t_d_n(k, j) * t_const_unit_slave(k) +
3607  t_d_n(i, j));
3608 
3609  ++t_base_master; // update rows
3610  }
3611  ++t_N;
3612  }
3613  ++lagrange_slave;
3614  ++t_w;
3615  }
3616 
3618 }

The documentation for this struct was generated from the following files:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MoFEM::Types::VectorDouble3
VectorBoundedArray< double, 3 > VectorDouble3
Definition: Types.hpp:92
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
SimpleContactProblem::OpContactALELhs::nb_base_fun_col
int nb_base_fun_col
Definition: SimpleContact.hpp:560
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MoFEM::EntitiesFieldData::EntData::getFieldData
const VectorDouble & getFieldData() const
get dofs values
Definition: EntitiesFieldData.hpp:1241
FTensor::levi_civita
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
Definition: Levi_Civita.hpp:617
SimpleContactProblem::OpContactALELhs::matLhs
MatrixDouble matLhs
Definition: SimpleContact.hpp:551
sdf.r
int r
Definition: sdf.py:8
FTensor::Tensor2< double *, 3, 3 >
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
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1201
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', 3 >
convert.n
n
Definition: convert.py:82
MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
Definition: EntitiesFieldData.cpp:526
FTensor::Tensor0
Definition: Tensor0.hpp:16
MoFEM::EntitiesFieldData::EntData::getN
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
Definition: EntitiesFieldData.hpp:1305
SimpleContactProblem::OpContactALELhs::commonDataSimpleContact
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
Definition: SimpleContact.hpp:549
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
SimpleContactProblem::OpContactALELhs::nb_gauss_pts
int nb_gauss_pts
Definition: SimpleContact.hpp:557
SimpleContactProblem::OpContactALELhs::nb_base_fun_row
int nb_base_fun_row
Definition: SimpleContact.hpp:559
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
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
SimpleContactProblem::OpContactALELhs::OpContactALELhs
OpContactALELhs(const string field_name_1, const string field_name_2, boost::shared_ptr< CommonDataSimpleContact > common_data_contact, const ContactOp::FaceType face_type, const int rank_row, const int rank_col)
Definition: SimpleContact.hpp:576