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

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

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

Inheritance diagram for SimpleContactProblem::OpCalMatForcesALEMaster:
[legend]
Collaboration diagram for SimpleContactProblem::OpCalMatForcesALEMaster:
[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)
 
 OpCalMatForcesALEMaster (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 master surface.

Definition at line 2514 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ OpCalMatForcesALEMaster()

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

Definition at line 2569 of file SimpleContact.hpp.

2572  : ContactOp(field_name, UserDataOperator::OPROW, ContactOp::FACEMASTER),
2573  commonDataSimpleContact(common_data_contact) {}

Member Function Documentation

◆ aSsemble()

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

Definition at line 3218 of file SimpleContact.cpp.

3218  {
3220 
3221  // get pointer to first global index on row
3222  const int *row_indices = &*row_data.getIndices().data().begin();
3223  auto &data = *commonDataSimpleContact;
3224  if (data.forcesOnlyOnEntitiesRow.empty())
3226 
3227  rowIndices.resize(nbRows, false);
3228  noalias(rowIndices) = row_data.getIndices();
3229  row_indices = &rowIndices[0];
3230  VectorDofs &dofs = row_data.getFieldDofs();
3231  VectorDofs::iterator dit = dofs.begin();
3232  for (int ii = 0; dit != dofs.end(); ++dit, ++ii) {
3233  if (data.forcesOnlyOnEntitiesRow.find((*dit)->getEnt()) ==
3234  data.forcesOnlyOnEntitiesRow.end()) {
3235  rowIndices[ii] = -1;
3236  }
3237  }
3238 
3239  CHKERR VecSetValues(getSNESf(), nbRows, row_indices, &*vecF.data().begin(),
3240  ADD_VALUES);
3242 }

◆ doWork()

MoFEMErrorCode SimpleContactProblem::OpCalMatForcesALEMaster::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}}^{(2)})\):

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

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

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

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 3142 of file SimpleContact.cpp.

3143  {
3144 
3146 
3147  // get number of dofs on row
3148  nbRows = row_data.getIndices().size();
3149  // if no dofs on row, exit that work, nothing to do here
3150  if (!nbRows)
3152 
3153  vecF.resize(nbRows, false);
3154  vecF.clear();
3155 
3156  // get number of integration points
3157  nbIntegrationPts = getGaussPtsMaster().size2();
3158 
3159  // integrate local matrix for entity block
3160  CHKERR iNtegrate(row_data);
3161 
3162  // assemble local matrix
3163  CHKERR aSsemble(row_data);
3164 
3166 }

◆ iNtegrate()

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

Definition at line 3169 of file SimpleContact.cpp.

3169  {
3171 
3172  if (data.getIndices().size() == 0)
3174  // in case the tet is not in database
3175  if (commonDataSimpleContact->FMat->size1() != 9)
3177 
3178  const int nb_base_fun_col = nbRows / 3;
3179 
3180  auto get_tensor_vec = [](VectorDouble &n, const int r) {
3181  return FTensor::Tensor1<double *, 3>(&n(r + 0), &n(r + 1), &n(r + 2));
3182  };
3183 
3186  auto lagrange_slave =
3187  getFTensor0FromVec(*commonDataSimpleContact->lagMultAtGaussPtsPtr);
3188 
3189  auto t_F = getFTensor2FromMat<3, 3>(*commonDataSimpleContact->FMat);
3190  auto normal_at_gp =
3191  get_tensor_vec(*(commonDataSimpleContact->normalVectorMasterPtr), 0);
3192 
3193  auto t_w = getFTensor0IntegrationWeightMaster();
3194  double &area_master = commonDataSimpleContact->areaMaster;
3195  for (int gg = 0; gg != nbIntegrationPts; ++gg) {
3196  const double val_m = area_master * t_w;
3197  FTensor::Tensor0<double *> t_base_master(&data.getN()(gg, 0));
3198 
3199  for (int bbc = 0; bbc != nb_base_fun_col; ++bbc) {
3200 
3201  const double s = val_m * t_base_master * lagrange_slave;
3202 
3203  auto t_assemble_s = get_tensor_vec(vecF, 3 * bbc);
3204 
3205  t_assemble_s(i) -= s * t_F(j, i) * normal_at_gp(j);
3206 
3207  ++t_base_master;
3208  }
3209  ++t_F;
3210  ++lagrange_slave;
3211  ++t_w;
3212  } // for gauss points
3213 
3215 }

Member Data Documentation

◆ commonDataSimpleContact

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

Definition at line 2521 of file SimpleContact.hpp.

◆ nbIntegrationPts

int SimpleContactProblem::OpCalMatForcesALEMaster::nbIntegrationPts

number of integration points

Definition at line 2519 of file SimpleContact.hpp.

◆ nbRows

int SimpleContactProblem::OpCalMatForcesALEMaster::nbRows

number of dofs on rows

Definition at line 2518 of file SimpleContact.hpp.

◆ rowIndices

VectorInt SimpleContactProblem::OpCalMatForcesALEMaster::rowIndices

Definition at line 2516 of file SimpleContact.hpp.

◆ vecF

VectorDouble SimpleContactProblem::OpCalMatForcesALEMaster::vecF

Definition at line 2522 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:460
SimpleContactProblem::OpCalMatForcesALEMaster::nbRows
int nbRows
number of dofs on rows
Definition: SimpleContact.hpp:2518
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
SimpleContactProblem::OpCalMatForcesALEMaster::iNtegrate
MoFEMErrorCode iNtegrate(EntData &row_data)
Definition: SimpleContact.cpp:3169
SimpleContactProblem::OpCalMatForcesALEMaster::rowIndices
VectorInt rowIndices
Definition: SimpleContact.hpp:2516
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
sdf.r
int r
Definition: sdf.py:8
SimpleContactProblem::OpCalMatForcesALEMaster::commonDataSimpleContact
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
Definition: SimpleContact.hpp:2521
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
SimpleContactProblem::OpCalMatForcesALEMaster::vecF
VectorDouble vecF
Definition: SimpleContact.hpp:2522
SimpleContactProblem::OpCalMatForcesALEMaster::aSsemble
MoFEMErrorCode aSsemble(EntData &row_data)
Definition: SimpleContact.cpp:3218
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:1214
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:1269
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
SimpleContactProblem::OpCalMatForcesALEMaster::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: SimpleContact.hpp:2519
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
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:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROW
@ OPROW
operator doWork function is executed on FE rows
Definition: ForcesAndSourcesCore.hpp:567