v0.14.0
Public Member Functions | Public Attributes | List of all members
SimpleContactProblem::OpCalMatForcesALESlave Struct Reference

RHS - operator for the contact element (material configuration) Integrates virtual work of contact traction in the material configuration on slave surface. More...

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

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

Public Member Functions

MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 Integrates virtual work of contact traction in the material configuration. More...
 
MoFEMErrorCode iNtegrate (EntData &row_data)
 
MoFEMErrorCode aSsemble (EntData &row_data)
 
 OpCalMatForcesALESlave (const string field_name, boost::shared_ptr< CommonDataSimpleContact > common_data_contact)
 

Public Attributes

VectorInt rowIndices
 
int nbRows
 number of dofs on rows More...
 
int nbIntegrationPts
 number of integration points More...
 
boost::shared_ptr< CommonDataSimpleContactcommonDataSimpleContact
 
VectorDouble vecF
 

Detailed Description

RHS - operator for the contact element (material configuration) Integrates virtual work of contact traction in the material configuration on slave surface.

Definition at line 2581 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ OpCalMatForcesALESlave()

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

Definition at line 2636 of file SimpleContact.hpp.

2639  : ContactOp(field_name, UserDataOperator::OPROW, ContactOp::FACESLAVE),
2640  commonDataSimpleContact(common_data_contact) {}

Member Function Documentation

◆ aSsemble()

MoFEMErrorCode SimpleContactProblem::OpCalMatForcesALESlave::aSsemble ( EntData row_data)

Definition at line 3309 of file SimpleContact.cpp.

3309  {
3311 
3312  // get pointer to first global index on row
3313  const int *row_indices = &*row_data.getIndices().data().begin();
3314  auto &data = *commonDataSimpleContact;
3315  if (data.forcesOnlyOnEntitiesRow.empty())
3317 
3318  rowIndices.resize(nbRows, false);
3319  noalias(rowIndices) = row_data.getIndices();
3320  row_indices = &rowIndices[0];
3321  VectorDofs &dofs = row_data.getFieldDofs();
3322  VectorDofs::iterator dit = dofs.begin();
3323  for (int ii = 0; dit != dofs.end(); ++dit, ++ii) {
3324  if (data.forcesOnlyOnEntitiesRow.find((*dit)->getEnt()) ==
3325  data.forcesOnlyOnEntitiesRow.end()) {
3326  rowIndices[ii] = -1;
3327  }
3328  }
3329 
3330  CHKERR VecSetValues(getSNESf(), nbRows, row_indices, &*vecF.data().begin(),
3331  ADD_VALUES);
3332 
3334 }

◆ doWork()

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

Integrates virtual work of contact traction in the material configuration.

Virtual work of the contact traction corresponding to a test function of the material configuration \((\delta{\mathbf{X}}^{(1)})\):

\[ \delta W^\text{material}_p({\mathbf{x}}^{(1)}, {\mathbf{X}}^{(1)}, {\delta\mathbf{X}}^{(1)}, \lambda) = -\int\limits_{{\mathcal{T}}^{(1)}} \lambda \left\{{\left( \mathbf{F}^{(1)} \right)}^{\intercal}\cdot \mathbf{N}({\mathbf{X}}^{(1)}) \right\} \cdot \delta{\mathbf{X}}^{(1)}\, \textrm{d}{\mathcal{T}}^{(1)} = -\int\limits_{{\mathcal{T}}^{(1)}_{\xi}} \lambda \left\{{\left( \mathbf{F}^{(1)} \right)}^{\intercal}\cdot \left(\frac{\partial\mathbf{X}^{(1)}} {\partial\xi}\times\frac{\partial {\mathbf{X}}^{(1)}} {\partial\eta}\right) \right\} \cdot \delta{\mathbf{X}}^{(1)}\, \textrm{d}\xi\textrm{d}\eta \]

where \f(1)\f denotes that variables are evaluated on slave side \( \lambda \) is contact traction on slave surface, \({\mathbf{N}}({\mathbf{X}}^{(1)})\) is a normal to the face in the material configuration, \(\xi, \eta\) are coordinates in the parent space \(({\mathcal{T}}^{(1)}_\xi)\) and \(\mathbf{F}\) is the deformation gradient:

\[ {\mathbf{F}}^{(1)} = {\mathbf{h}}({\mathbf{x}}^{(1)})\,\mathbf{H}({\mathbf{X}}^{(1)})^{-1} = \frac{\partial{\mathbf{x}}^{(1)}}{\partial{\boldsymbol{\chi}}^{(1)}} \frac{\partial{\boldsymbol{\chi}}^{(1)}}{\partial{\mathbf{X}}^{(1)}} \]

where \(\mathbf{h}\) and \(\mathbf{H}\) are the gradients of the spatial and material maps, respectively, and \(\boldsymbol{\chi}\) are the reference coordinates.

Definition at line 3245 of file SimpleContact.cpp.

3246  {
3247 
3249 
3250  // get number of dofs on row
3251  nbRows = row_data.getIndices().size();
3252  // if no dofs on row, exit that work, nothing to do here
3253  if (!nbRows)
3255 
3256  vecF.resize(nbRows, false);
3257  vecF.clear();
3258 
3259  // get number of integration points
3260  nbIntegrationPts = getGaussPtsSlave().size2();
3261 
3262  // integrate local matrix for entity block
3263  CHKERR iNtegrate(row_data);
3264 
3265  // assemble local matrix
3266  CHKERR aSsemble(row_data);
3267 
3269 }

◆ iNtegrate()

MoFEMErrorCode SimpleContactProblem::OpCalMatForcesALESlave::iNtegrate ( EntData row_data)

Definition at line 3272 of file SimpleContact.cpp.

3272  {
3274 
3275  int nb_base_fun_col = nbRows / 3;
3276 
3277  auto get_tensor_vec = [](VectorDouble &n, const int r) {
3278  return FTensor::Tensor1<double *, 3>(&n(r + 0), &n(r + 1), &n(r + 2));
3279  };
3280 
3283  auto lagrange_slave =
3284  getFTensor0FromVec(*commonDataSimpleContact->lagMultAtGaussPtsPtr);
3285 
3286  auto t_F = getFTensor2FromMat<3, 3>(*commonDataSimpleContact->FMat);
3287  auto normal_at_gp =
3288  get_tensor_vec(*(commonDataSimpleContact->normalVectorSlavePtr), 0);
3289  auto t_w = getFTensor0IntegrationWeightSlave();
3290  double &area_slave = commonDataSimpleContact->areaSlave;
3291  for (int gg = 0; gg != nbIntegrationPts; ++gg) {
3292  double val_s = t_w * area_slave;
3293  FTensor::Tensor0<double *> t_base_master(&data.getN()(gg, 0));
3294  for (int bbc = 0; bbc != nb_base_fun_col; ++bbc) {
3295  const double s = val_s * t_base_master * lagrange_slave;
3296  auto t_assemble_s = get_tensor_vec(vecF, 3 * bbc);
3297  t_assemble_s(i) -= s * t_F(j, i) * normal_at_gp(j);
3298  ++t_base_master;
3299  }
3300  ++t_F;
3301  ++lagrange_slave;
3302  ++t_w;
3303  }
3304 
3306 }

Member Data Documentation

◆ commonDataSimpleContact

boost::shared_ptr<CommonDataSimpleContact> SimpleContactProblem::OpCalMatForcesALESlave::commonDataSimpleContact

Definition at line 2588 of file SimpleContact.hpp.

◆ nbIntegrationPts

int SimpleContactProblem::OpCalMatForcesALESlave::nbIntegrationPts

number of integration points

Definition at line 2586 of file SimpleContact.hpp.

◆ nbRows

int SimpleContactProblem::OpCalMatForcesALESlave::nbRows

number of dofs on rows

Definition at line 2585 of file SimpleContact.hpp.

◆ rowIndices

VectorInt SimpleContactProblem::OpCalMatForcesALESlave::rowIndices

Definition at line 2583 of file SimpleContact.hpp.

◆ vecF

VectorDouble SimpleContactProblem::OpCalMatForcesALESlave::vecF

Definition at line 2589 of file SimpleContact.hpp.


The documentation for this struct was generated from the following files:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
SimpleContactProblem::OpCalMatForcesALESlave::nbRows
int nbRows
number of dofs on rows
Definition: SimpleContact.hpp:2585
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
SimpleContactProblem::OpCalMatForcesALESlave::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: SimpleContact.hpp:2586
SimpleContactProblem::OpCalMatForcesALESlave::vecF
VectorDouble vecF
Definition: SimpleContact.hpp:2589
SimpleContactProblem::OpCalMatForcesALESlave::rowIndices
VectorInt rowIndices
Definition: SimpleContact.hpp:2583
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
SimpleContactProblem::OpCalMatForcesALESlave::iNtegrate
MoFEMErrorCode iNtegrate(EntData &row_data)
Definition: SimpleContact.cpp:3272
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
SimpleContactProblem::OpCalMatForcesALESlave::aSsemble
MoFEMErrorCode aSsemble(EntData &row_data)
Definition: SimpleContact.cpp:3309
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1201
MoFEM::VectorDofs
ublas::vector< FEDofEntity *, DofsAllocator > VectorDofs
Definition: EntitiesFieldData.hpp:23
MoFEM::EntitiesFieldData::EntData::getFieldDofs
const VectorDofs & getFieldDofs() const
get dofs data stature FEDofEntity
Definition: EntitiesFieldData.hpp:1256
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
FTensor::Tensor0
Definition: Tensor0.hpp:16
SimpleContactProblem::OpCalMatForcesALESlave::commonDataSimpleContact
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
Definition: SimpleContact.hpp:2588
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
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