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

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 }

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:
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
SimpleContactProblem::OpCalContactTractionOnMaster::vecF
VectorDouble vecF
Definition: SimpleContact.hpp:997
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
SimpleContactProblem::OpCalContactTractionOnMaster::commonDataSimpleContact
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
Definition: SimpleContact.hpp:996
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
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