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

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 }

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:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
EntityHandle
SimpleContactProblem::StateALM
static bool StateALM(const double cn, const double g, const double l)
Definition: SimpleContact.hpp:3582
SimpleContactProblem::OpGetContactArea::almFlag
const bool almFlag
Definition: SimpleContact.hpp:3561
MoFEM::EntitiesFieldData::EntData::getFieldData
const VectorDouble & getFieldData() const
get dofs values
Definition: EntitiesFieldData.hpp:1254
SimpleContactProblem::OpGetContactArea::postProcGapTol
double postProcGapTol
Definition: SimpleContact.hpp:3564
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
SimpleContactProblem::OpGetContactArea::postProcSurface
Range postProcSurface
Definition: SimpleContact.hpp:3563
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPCOL
@ OPCOL
operator doWork function is executed on FE columns
Definition: ForcesAndSourcesCore.hpp:568
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
SimpleContactProblem::OpGetContactArea::cN
const double cN
Definition: SimpleContact.hpp:3560
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1214
SimpleContactProblem::CommonDataSimpleContact::ACTIVE
@ ACTIVE
Definition: SimpleContact.hpp:438
SimpleContactProblem::OpGetContactArea::commonDataSimpleContact
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
Definition: SimpleContact.hpp:3559
Range
SimpleContactProblem::ContactOp
ContactPrismElementForcesAndSourcesCore::UserDataOperator ContactOp
Definition: SimpleContact.hpp:30
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:1318
SimpleContactProblem::CommonDataSimpleContact::TOTAL
@ TOTAL
Definition: SimpleContact.hpp:438
SimpleContactProblem::OpGetContactArea::vecR
VectorDouble vecR
Definition: SimpleContact.hpp:3562
SimpleContactProblem::State
static bool State(const double cn, const double g, const double l)
Definition: SimpleContact.hpp:3577
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
SimpleContactProblem::CommonDataSimpleContact::LAST_ELEMENT
@ LAST_ELEMENT
Definition: SimpleContact.hpp:438