v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
SimpleContactProblem::OpGetContactArea Struct Reference

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

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

Public Member Functions

 OpGetContactArea (const string lagrange_field_name, boost::shared_ptr< CommonDataSimpleContact > common_data_contact, const double cn, const bool alm_flag=false, Range post_proc_surface=Range(), double post_proc_gap_tol=0.)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< CommonDataSimpleContactcommonDataSimpleContact
 
const double cN
 
const bool almFlag
 
VectorDouble vecR
 
Range postProcSurface
 
double postProcGapTol
 

Detailed Description

Definition at line 3543 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ OpGetContactArea()

SimpleContactProblem::OpGetContactArea::OpGetContactArea ( const string  lagrange_field_name,
boost::shared_ptr< CommonDataSimpleContact common_data_contact,
const double  cn,
const bool  alm_flag = false,
Range  post_proc_surface = Range(),
double  post_proc_gap_tol = 0. 
)
inline

Definition at line 3545 of file SimpleContact.hpp.

3550 : ContactOp(lagrange_field_name, UserDataOperator::OPCOL,
3551 ContactOp::FACESLAVE),
3552 commonDataSimpleContact(common_data_contact), cN(cn),
3553 almFlag(alm_flag), postProcSurface(post_proc_surface),
3554 postProcGapTol(post_proc_gap_tol) {}
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
ContactPrismElementForcesAndSourcesCore::UserDataOperator ContactOp

Member Function Documentation

◆ doWork()

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

Definition at line 4672 of file SimpleContact.cpp.

4674 {
4676
4677 if (data.getIndices().size() == 0)
4679
4680 if (!postProcSurface.empty()) {
4681 const EntityHandle prism_ent = getFEEntityHandle();
4682 Range tri_ents;
4683 auto &m_field = this->getPtrFE()->mField;
4684 CHKERR m_field.get_moab().get_adjacencies(&prism_ent, 1, 2, false, tri_ents,
4685 moab::Interface::UNION);
4686 tri_ents = tri_ents.subset_by_type(MBTRI);
4687 if (intersect(postProcSurface, tri_ents).empty())
4689 }
4690
4691 const int nb_gauss_pts = data.getN().size1();
4692
4693 int nb_base_fun_col = data.getFieldData().size();
4694 const double area_s =
4695 commonDataSimpleContact->areaSlave; // same area in master and slave
4696
4698 vecR.clear();
4699
4700 auto t_lagrange_slave =
4701 getFTensor0FromVec(*commonDataSimpleContact->lagMultAtGaussPtsPtr);
4702 auto t_gap_gp = getFTensor0FromVec(*commonDataSimpleContact->gapPtr);
4703 auto t_w = getFTensor0IntegrationWeightSlave();
4704
4705 for (int gg = 0; gg != nb_gauss_pts; gg++) {
4706 const double val_s = t_w * area_s;
4708 bool gap_below_tolerance =
4709 postProcGapTol > std::numeric_limits<double>::epsilon() &&
4710 t_gap_gp < postProcGapTol;
4711 if (gap_below_tolerance) {
4713 } else {
4714 if (!almFlag &&
4715 SimpleContactProblem::State(cN, t_gap_gp, t_lagrange_slave)) {
4717 }
4718 if (almFlag &&
4719 SimpleContactProblem::StateALM(cN, t_gap_gp, t_lagrange_slave)) {
4721 }
4722 }
4723
4724 ++t_lagrange_slave;
4725 ++t_gap_gp;
4726 ++t_w;
4727 } // for gauss points
4728
4729 constexpr std::array<int, 2> indices = {
4732 };
4733 CHKERR VecSetValues(commonDataSimpleContact->contactAreaVec, 2,
4734 indices.data(), &vecR[0], ADD_VALUES);
4735
4737}
#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
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDouble & getFieldData() const
get dofs values
const VectorInt & getIndices() const
Get global indices of dofs on entity.
static bool StateALM(const double cn, const double g, const double l)
static bool State(const double cn, const double g, const double l)

Member Data Documentation

◆ almFlag

const bool SimpleContactProblem::OpGetContactArea::almFlag
private

Definition at line 3561 of file SimpleContact.hpp.

◆ cN

const double SimpleContactProblem::OpGetContactArea::cN
private

Definition at line 3560 of file SimpleContact.hpp.

◆ commonDataSimpleContact

boost::shared_ptr<CommonDataSimpleContact> SimpleContactProblem::OpGetContactArea::commonDataSimpleContact
private

Definition at line 3559 of file SimpleContact.hpp.

◆ postProcGapTol

double SimpleContactProblem::OpGetContactArea::postProcGapTol
private

Definition at line 3564 of file SimpleContact.hpp.

◆ postProcSurface

Range SimpleContactProblem::OpGetContactArea::postProcSurface
private

Definition at line 3563 of file SimpleContact.hpp.

◆ vecR

VectorDouble SimpleContactProblem::OpGetContactArea::vecR
private

Definition at line 3562 of file SimpleContact.hpp.


The documentation for this struct was generated from the following files: