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

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

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

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

Public Member Functions

 OpCalContactTractionOnSlave (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 slave surface and assembles components to the RHS global 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 slave surface and assembles components to the RHS global vector.

Definition at line 1007 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ OpCalContactTractionOnSlave()

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

Definition at line 1009 of file SimpleContact.hpp.

1012 : ContactOp(field_name, UserDataOperator::OPROW, ContactOp::FACESLAVE),
1013 commonDataSimpleContact(common_data_contact) {}
constexpr auto field_name
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
ContactPrismElementForcesAndSourcesCore::UserDataOperator ContactOp

Member Function Documentation

◆ doWork()

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

Integrates Lagrange multipliers virtual work on slave surface and assembles components to the RHS global vector.

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

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

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

Definition at line 1589 of file SimpleContact.cpp.

1590 {
1592
1593 const int nb_dofs = data.getIndices().size();
1594 if (nb_dofs) {
1595
1596 const int nb_gauss_pts = data.getN().size1();
1597 int nb_base_fun_col = nb_dofs / 3;
1598
1599 vecF.resize(nb_dofs, false);
1600 vecF.clear();
1601
1602 const double area_m = commonDataSimpleContact->areaSlave;
1603
1604 auto get_tensor_vec = [](VectorDouble &n, const int r) {
1605 return FTensor::Tensor1<double *, 3>(&n(r + 0), &n(r + 1), &n(r + 2));
1606 };
1607
1609
1610 auto t_lagrange_slave =
1611 getFTensor0FromVec(*commonDataSimpleContact->lagMultAtGaussPtsPtr);
1612
1613 auto t_const_unit_n = get_tensor_vec(
1614 commonDataSimpleContact->normalVectorSlavePtr.get()[0], 0);
1615
1616 auto t_w = getFTensor0IntegrationWeightSlave();
1617
1618 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1619
1620 double val_m = t_w * area_m;
1621
1622 auto t_base_slave = data.getFTensor0N(gg, 0);
1624 &vecF[0], &vecF[1], &vecF[2]};
1625
1626 for (int bbc = 0; bbc != nb_base_fun_col; ++bbc) {
1627 const double m = val_m * t_base_slave * t_lagrange_slave;
1628 t_assemble_m(i) += m * t_const_unit_n(i);
1629 ++t_base_slave;
1630 ++t_assemble_m;
1631 }
1632
1633 ++t_lagrange_slave;
1634 ++t_w;
1635 } // for gauss points
1636
1637 CHKERR VecSetValues(getSNESf(), data, &*vecF.begin(), ADD_VALUES);
1638 }
1640}
#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::OpCalContactTractionOnSlave::commonDataSimpleContact
private

Definition at line 1040 of file SimpleContact.hpp.

◆ vecF

VectorDouble SimpleContactProblem::OpCalContactTractionOnSlave::vecF
private

Definition at line 1041 of file SimpleContact.hpp.


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