v0.13.2
Loading...
Searching...
No Matches
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) {}
double cn
Definition: contact.cpp:124
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
ContactPrismElementForcesAndSourcesCore::UserDataOperator ContactOp

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}
#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 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::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: