v0.13.2
Loading...
Searching...
No Matches
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) {}
constexpr auto field_name
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
ContactPrismElementForcesAndSourcesCore::UserDataOperator ContactOp

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}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#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
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
ublas::vector< FEDofEntity *, DofsAllocator > VectorDofs
const VectorDofs & getFieldDofs() const
get dofs data stature FEDofEntity
const VectorInt & getIndices() const
Get global indices of dofs on entity.

◆ 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}
int nbIntegrationPts
number of integration points
MoFEMErrorCode iNtegrate(EntData &row_data)
MoFEMErrorCode aSsemble(EntData &row_data)

◆ 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}
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
int r
Definition: sdf.py:5

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: