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

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

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

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

Public Member Functions

 OpCalContactTractionOnMaster (const string field_name, boost::shared_ptr< CommonDataSimpleContact > common_data_contact)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 Integrates Lagrange multipliers virtual work on master surface and assembles to global RHS vector. More...
 

Private Attributes

boost::shared_ptr< CommonDataSimpleContactcommonDataSimpleContact
 
VectorDouble vecF
 

Detailed Description

RHS-operator for the simple contact element.

Integrates Lagrange multipliers virtual work on master surface and assemble components to RHS global vector.

Definition at line 962 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ OpCalContactTractionOnMaster()

SimpleContactProblem::OpCalContactTractionOnMaster::OpCalContactTractionOnMaster ( const string  field_name,
boost::shared_ptr< CommonDataSimpleContact common_data_contact 
)
inline

Definition at line 964 of file SimpleContact.hpp.

967 : ContactOp(field_name, UserDataOperator::OPROW, ContactOp::FACEMASTER),
968 commonDataSimpleContact(common_data_contact) {}
constexpr auto field_name
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
ContactPrismElementForcesAndSourcesCore::UserDataOperator ContactOp

Member Function Documentation

◆ doWork()

MoFEMErrorCode SimpleContactProblem::OpCalContactTractionOnMaster::doWork ( int  side,
EntityType  type,
EntData data 
)

Integrates Lagrange multipliers virtual work on master surface and assembles to global RHS vector.

Integrates Lagrange multipliers virtual work \( \delta W_{\text c}\) on master surface and assembles components to global RHS vector

\[ {\delta W^{(2)}_{\text c}(\lambda, \delta \mathbf{x}^{(2)}}) \,\, = - \int_{{\gamma}^{(1)}_{\text c}} \lambda \mathbf{n}(\mathbf{x}^{(1)}) \cdot \delta{\mathbf{x}^{(2)}} \,\,{ {\text d} {\gamma}} \]

where \({\gamma}^{(1)}_{\text c}\) is the surface integration domain of the slave surface, \( \lambda\) is the Lagrange multiplier, \(\mathbf{n}(\mathbf{x}^{(1)})\) is the outward normal vector at the slave triangle gauss points, \(\mathbf{x}^{(2)}\) are the coordinates of the overlapping gauss points at master triangles.

Definition at line 1535 of file SimpleContact.cpp.

1536 {
1538
1539 const int nb_dofs = data.getIndices().size();
1540 if (nb_dofs) {
1541
1542 const int nb_gauss_pts = data.getN().size1();
1543 int nb_base_fun_col = nb_dofs / 3;
1544
1545 vecF.resize(nb_dofs, false);
1546 vecF.clear();
1547
1548 const double area_m =
1549 commonDataSimpleContact->areaMaster; // same area in master and slave
1550
1551 auto get_tensor_vec = [](VectorDouble &n, const int r) {
1552 return FTensor::Tensor1<double *, 3>(&n(r + 0), &n(r + 1), &n(r + 2));
1553 };
1554
1556
1557 auto t_lagrange_slave =
1558 getFTensor0FromVec(*commonDataSimpleContact->lagMultAtGaussPtsPtr);
1559
1560 auto t_const_unit_n = get_tensor_vec(
1561 commonDataSimpleContact->normalVectorSlavePtr.get()[0], 0);
1562
1563 auto t_w = getFTensor0IntegrationWeightMaster();
1564
1565 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1566
1567 double val_m = t_w * area_m;
1568
1569 auto t_base_master = data.getFTensor0N(gg, 0);
1571 &vecF[0], &vecF[1], &vecF[2]};
1572
1573 for (int bbc = 0; bbc != nb_base_fun_col; ++bbc) {
1574 const double m = val_m * t_base_master * t_lagrange_slave;
1575 t_assemble_m(i) -= m * t_const_unit_n(i);
1576 ++t_base_master;
1577 ++t_assemble_m;
1578 }
1579
1580 ++t_lagrange_slave;
1581 ++t_w;
1582 } // for gauss points
1583
1584 CHKERR VecSetValues(getSNESf(), data, &*vecF.begin(), ADD_VALUES);
1585 }
1587}
#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
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
FTensor::Index< 'i', SPACE_DIM > i
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
int r
Definition: sdf.py:8
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.

Member Data Documentation

◆ commonDataSimpleContact

boost::shared_ptr<CommonDataSimpleContact> SimpleContactProblem::OpCalContactTractionOnMaster::commonDataSimpleContact
private

Definition at line 996 of file SimpleContact.hpp.

◆ vecF

VectorDouble SimpleContactProblem::OpCalContactTractionOnMaster::vecF
private

Definition at line 997 of file SimpleContact.hpp.


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