v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SimpleContactProblem::OpContactTractionSlaveSlave_dX Struct Reference

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

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

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

Public Member Functions

MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrates Lagrange multipliers virtual work, \( \delta W_{\text c}\) derivative with respect to material positions on slave side and assembles components to LHS global matrix. More...
 
 OpContactTractionSlaveSlave_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)
 
virtual MoFEMErrorCode iNtegrate (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, \( \delta W_{\text c}\) derivative with respect to material positions on slave side and assembles components of the RHS vector.

Definition at line 3023 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ OpContactTractionSlaveSlave_dX()

SimpleContactProblem::OpContactTractionSlaveSlave_dX::OpContactTractionSlaveSlave_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 3066 of file SimpleContact.hpp.

3070 : OpContactALELhs(field_name, mesh_nodes_field, common_data_contact,
3071 ContactOp::FACESLAVESLAVE, row_rank, col_rank) {
3072 sYmm = false; // This will make sure to loop over all intities (e.g.
3073 // for order=2 it will make doWork to loop 16 time)
3074 }
constexpr auto field_name
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)

Member Function Documentation

◆ iNtegrate()

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

Integrates Lagrange multipliers virtual work, \( \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}}^{(1)}, {\mathbf{X}}^{(1)}, \delta{\mathbf{x}}^{(1)}) [\Delta{\mathbf{X}}^{(1)}] = \int\limits_{\mathcal{T}^{(1)}_{\xi}} \lambda \, \left[ \frac{\partial{\mathbf{X}}^{(1)}} {\partial\xi} \cdot \left(\frac{\partial\Delta {\mathbf{X}}^{(1)}}{\partial\eta}\times\delta{\mathbf{x}}^{(1)}\right) -\frac{\partial{\mathbf{X}}^{(1)}} {\partial\eta} \cdot \left(\frac{\partial\Delta {\mathbf{X}}^{(1)}}{\partial\xi}\times \delta{\mathbf{x}}^{(1)}\right)\right] \textrm{d}\xi\textrm{d}\eta \]

Here superscript \((1)\) denotes slave side coordinates and surfaces, respectively. Moreover, \(\lambda\) is the lagrange multiplier.

Reimplemented from SimpleContactProblem::OpContactALELhs.

Definition at line 3450 of file SimpleContact.cpp.

3451 {
3453
3454 // Both sides are needed since both sides contribute their shape
3455 // function to the stiffness matrix
3456 const int nb_row = row_data.getIndices().size();
3457 if (!nb_row)
3459 const int nb_col = col_data.getIndices().size();
3460 if (!nb_col)
3462 const int nb_gauss_pts = row_data.getN().size1();
3463
3464 int nb_base_fun_row = row_data.getFieldData().size() / 3;
3465 int nb_base_fun_col = col_data.getFieldData().size() / 3;
3466
3467 auto get_tensor_from_mat = [](MatrixDouble &m, const int r, const int c) {
3469 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 1, c + 0),
3470 &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 2, c + 0), &m(r + 2, c + 1),
3471 &m(r + 2, c + 2));
3472 };
3473
3474 auto get_tensor_vec = [](VectorDouble &n) {
3475 return FTensor::Tensor1<double *, 3>(&n(0), &n(1), &n(2));
3476 };
3477
3478 auto get_tensor_vec_3 = [&](VectorDouble3 &n) {
3479 return FTensor::Tensor1<double *, 3>(&n(0), &n(1), &n(2));
3480 };
3481
3485
3486 auto make_vec_der = [&](auto t_N, auto t_1, auto t_2) {
3488 t_n(i, j) = 0;
3489 t_n(i, j) += FTensor::levi_civita(i, j, k) * t_2(k) * t_N(0);
3490 t_n(i, j) -= FTensor::levi_civita(i, j, k) * t_1(k) * t_N(1);
3491 return t_n;
3492 };
3493
3494 matLhs.resize(3 * nb_base_fun_row, 3 * nb_base_fun_col, false);
3495 matLhs.clear();
3496
3497 auto lagrange_slave =
3498 getFTensor0FromVec(*commonDataSimpleContact->lagMultAtGaussPtsPtr);
3499
3500 auto t_1 = get_tensor_vec(*commonDataSimpleContact->tangentOneVectorSlavePtr);
3501 auto t_2 = get_tensor_vec(*commonDataSimpleContact->tangentTwoVectorSlavePtr);
3502 auto t_w = getFTensor0IntegrationWeightSlave();
3503
3504 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
3505 auto t_N = col_data.getFTensor1DiffN<2>(gg, 0);
3506
3507 for (int bbc = 0; bbc != nb_base_fun_col; ++bbc) {
3508
3509 FTensor::Tensor0<double *> t_base_slave(&row_data.getN()(gg, 0));
3510
3511 for (int bbr = 0; bbr != nb_base_fun_row; ++bbr) {
3512 const double s = t_w * lagrange_slave * t_base_slave;
3513
3514 auto t_d_n = make_vec_der(t_N, t_1, t_2);
3515
3516 auto t_assemble_s = get_tensor_from_mat(matLhs, 3 * bbr, 3 * bbc);
3517
3518 t_assemble_s(i, j) += 0.5 * s * t_d_n(i, j);
3519
3520 ++t_base_slave; // update rows
3521 }
3522 ++t_N;
3523 }
3524 ++lagrange_slave;
3525 ++t_w;
3526 }
3528}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#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
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
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
VectorBoundedArray< double, 3 > VectorDouble3
Definition: Types.hpp:92
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
int r
Definition: sdf.py:8
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDouble & getFieldData() const
get dofs values
const VectorInt & getIndices() const
Get global indices of dofs on entity.
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact

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