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

LHS-operator for the simple contact element. More...

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

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

Public Member Functions

 OpCalDerIntCompFunOverLambdaSlaveSlave (const string lagrange_field_name, boost::shared_ptr< CommonDataSimpleContact > common_data_contact, boost::shared_ptr< double > cn)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Integrates the complementarity function at slave face gauss points and assembles components to LHS global matrix. More...
 

Private Attributes

boost::shared_ptr< CommonDataSimpleContactcommonDataSimpleContact
 
boost::shared_ptr< doublecNPtr
 
MatrixDouble NN
 

Detailed Description

LHS-operator for the simple contact element.

Integrates variation of the complementarity function with respect to Lagrange multipliers to fulfils KKT conditions in the integral sense on slave side and assembles components to LHS global matrix.

Definition at line 1386 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ OpCalDerIntCompFunOverLambdaSlaveSlave()

SimpleContactProblem::OpCalDerIntCompFunOverLambdaSlaveSlave::OpCalDerIntCompFunOverLambdaSlaveSlave ( const string  lagrange_field_name,
boost::shared_ptr< CommonDataSimpleContact common_data_contact,
boost::shared_ptr< double cn 
)
inline

Definition at line 1388 of file SimpleContact.hpp.

1392 : ContactOp(lagrange_field_name, UserDataOperator::OPROWCOL,
1393 ContactOp::FACESLAVESLAVE),
1394 commonDataSimpleContact(common_data_contact), cNPtr(cn) {
1395 sYmm = false; // This will make sure to loop over all entities (e.g.
1396 // for order=2 it will make doWork to loop 16 time)
1397 }
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
ContactPrismElementForcesAndSourcesCore::UserDataOperator ContactOp

Member Function Documentation

◆ doWork()

MoFEMErrorCode SimpleContactProblem::OpCalDerIntCompFunOverLambdaSlaveSlave::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)

Integrates the complementarity function at slave face gauss points and assembles components to LHS global matrix.

Integrates variation of the complementarity function with respect to Lagrange multipliers to fulfils KKT conditions in the integral sense nd assembles components to LHS global matrix.

\[ {\text D}{\overline C(\lambda, \mathbf{x}^{(i)}, \delta \lambda)}[\Delta \lambda] = \int_{{\gamma}^{(1)}_{\text c}} \Delta \lambda \left( 1 - {\text {sign}}\left( \lambda - c_{\text n} g_{\textrm{n}} \right) {\left| \lambda - c_{\text n} g_{\textrm{n}}\right|}^{r-1}\right) \delta{{\lambda}} \,\,{ {\text d} {\gamma}} \]

where \({\gamma}^{(1)}_{\text c}\) is the surface integration domain of the slave surface, \( \lambda\) is the Lagrange multiplier, \(\mathbf{x}^{(i)}\) are the coordinates of the overlapping gauss points at slave and master triangles for \(i = 1\) and \(i = 2\), respectively. Furthermore, \( c_{\text n}\) works as an augmentation parameter and affects convergence, \(r\) is regularisation parameter that can be chosen in \([1, 1.1]\) ( \(r = 1\)) is the default value and \( g_{\textrm{n}}\) is the gap function evaluated at the slave triangle gauss points as:

\[ g_{\textrm{n}} = - \mathbf{n}(\mathbf{x}^{(1)}) \cdot \left( \mathbf{x}^{(1)} - \mathbf{x}^{(2)} \right) \]

Definition at line 1992 of file SimpleContact.cpp.

1994 {
1996
1997 const int nb_row = row_data.getIndices().size();
1998 const int nb_col = col_data.getIndices().size();
1999
2000 if (nb_row && nb_col) {
2001 const int nb_gauss_pts = row_data.getN().size1();
2002 const double area_slave =
2003 commonDataSimpleContact->areaSlave; // same area in master and slave
2004
2005 NN.resize(nb_row, nb_col, false);
2006 NN.clear();
2007
2008 auto t_lagrange_slave =
2009 getFTensor0FromVec(*commonDataSimpleContact->lagMultAtGaussPtsPtr);
2010 auto t_gap_gp = getFTensor0FromVec(*commonDataSimpleContact->gapPtr);
2011 auto t_w = getFTensor0IntegrationWeightSlave();
2012 const double cn_value = *cNPtr.get();
2013
2014 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
2015 const double val_s = SimpleContactProblem::ConstrainFunction_dl(
2016 cn_value, t_gap_gp, t_lagrange_slave) *
2017 t_w * area_slave;
2018
2020 &*NN.data().begin());
2021
2022 auto t_base_lambda_row = row_data.getFTensor0N(gg, 0);
2023 for (int bbr = 0; bbr != nb_row; ++bbr) {
2024 auto t_base_lambda_col = col_data.getFTensor0N(gg, 0);
2025 const double s = val_s * t_base_lambda_row;
2026 for (int bbc = 0; bbc != nb_col; ++bbc) {
2027
2028 t_mat += s * t_base_lambda_col;
2029
2030 ++t_mat;
2031 ++t_base_lambda_col; // update cols
2032 }
2033 ++t_base_lambda_row; // update rows
2034 }
2035
2036 ++t_lagrange_slave;
2037 ++t_gap_gp;
2038 ++t_w;
2039 }
2040
2041 CHKERR MatSetValues(getSNESB(), row_data, col_data, &*NN.data().begin(),
2042 ADD_VALUES);
2043 }
2044
2046}
#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 MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
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 double ConstrainFunction_dl(const double cn, const double g, const double l)

Member Data Documentation

◆ cNPtr

boost::shared_ptr<double> SimpleContactProblem::OpCalDerIntCompFunOverLambdaSlaveSlave::cNPtr
private

Definition at line 1435 of file SimpleContact.hpp.

◆ commonDataSimpleContact

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

Definition at line 1434 of file SimpleContact.hpp.

◆ NN

MatrixDouble SimpleContactProblem::OpCalDerIntCompFunOverLambdaSlaveSlave::NN
private

Definition at line 1436 of file SimpleContact.hpp.


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