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

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

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

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 3523 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ OpGetGaussPtsState()

SimpleContactProblem::OpGetGaussPtsState::OpGetGaussPtsState ( const string  lagrange_field_name,
boost::shared_ptr< CommonDataSimpleContact common_data_contact,
const double  cn,
const bool  alm_flag = false 
)
inline

Definition at line 3525 of file SimpleContact.hpp.

3529  : ContactOp(lagrange_field_name, UserDataOperator::OPCOL,
3530  ContactOp::FACESLAVE),
3531  commonDataSimpleContact(common_data_contact), cN(cn),
3532  almFlag(alm_flag) {}

Member Function Documentation

◆ doWork()

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

Definition at line 3869 of file SimpleContact.cpp.

3871  {
3873 
3874  if (data.getIndices().size() == 0)
3876 
3877  const int nb_gauss_pts = data.getN().size1();
3878 
3880  vecR.clear();
3881 
3882  commonDataSimpleContact->gaussPtsStatePtr->resize(nb_gauss_pts, false);
3883  commonDataSimpleContact->gaussPtsStatePtr->clear();
3884 
3885  auto t_state_gp =
3886  getFTensor0FromVec(*commonDataSimpleContact->gaussPtsStatePtr);
3887 
3888  auto t_lagrange_slave =
3889  getFTensor0FromVec(*commonDataSimpleContact->lagMultAtGaussPtsPtr);
3890  auto t_gap_gp = getFTensor0FromVec(*commonDataSimpleContact->gapPtr);
3891 
3892  for (int gg = 0; gg != nb_gauss_pts; gg++) {
3894 
3895  if (!almFlag &&
3896  SimpleContactProblem::State(cN, t_gap_gp, t_lagrange_slave)) {
3898  t_state_gp = 1;
3899  }
3900 
3901  if (almFlag &&
3902  SimpleContactProblem::StateALM(cN, t_gap_gp, t_lagrange_slave)) {
3904  t_state_gp = 1;
3905  }
3906 
3907  ++t_lagrange_slave;
3908  ++t_gap_gp;
3909  ++t_state_gp;
3910  } // for gauss points
3911 
3912  constexpr std::array<int, 2> indices = {CommonDataSimpleContact::ACTIVE,
3914  CHKERR VecSetValues(commonDataSimpleContact->gaussPtsStateVec, 2,
3915  indices.data(), &vecR[0], ADD_VALUES);
3916 
3918 }

Member Data Documentation

◆ almFlag

const bool SimpleContactProblem::OpGetGaussPtsState::almFlag
private

Definition at line 3539 of file SimpleContact.hpp.

◆ cN

const double SimpleContactProblem::OpGetGaussPtsState::cN
private

Definition at line 3538 of file SimpleContact.hpp.

◆ commonDataSimpleContact

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

Definition at line 3537 of file SimpleContact.hpp.

◆ vecR

VectorDouble SimpleContactProblem::OpGetGaussPtsState::vecR
private

Definition at line 3540 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::OpGetGaussPtsState::commonDataSimpleContact
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
Definition: SimpleContact.hpp:3537
SimpleContactProblem::OpGetGaussPtsState::vecR
VectorDouble vecR
Definition: SimpleContact.hpp:3540
SimpleContactProblem::StateALM
static bool StateALM(const double cn, const double g, const double l)
Definition: SimpleContact.hpp:3582
SimpleContactProblem::OpGetGaussPtsState::cN
const double cN
Definition: SimpleContact.hpp:3538
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
SimpleContactProblem::OpGetGaussPtsState::almFlag
const bool almFlag
Definition: SimpleContact.hpp:3539
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
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::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::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