v0.14.0
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) {}

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 }

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:
SimpleContactProblem::OpCalContactTractionOnSlave::vecF
VectorDouble vecF
Definition: SimpleContact.hpp:1041
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1576
sdf.r
int r
Definition: sdf.py:8
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1489
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
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
SimpleContactProblem::ContactOp
ContactPrismElementForcesAndSourcesCore::UserDataOperator ContactOp
Definition: SimpleContact.hpp:30
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::OpCalContactTractionOnSlave::commonDataSimpleContact
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
Definition: SimpleContact.hpp:1040
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
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
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROW
@ OPROW
operator doWork function is executed on FE rows
Definition: ForcesAndSourcesCore.hpp:567