v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
SimpleContactProblem::SimpleContactElement Struct Reference

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

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

Public Member Functions

 SimpleContactElement (MoFEM::Interface &m_field, bool newton_cotes=false)
 
MoFEMErrorCode preProcess ()
 
MoFEMErrorCode postProcess ()
 
int getRule (int order)
 
virtual MoFEMErrorCode setGaussPts (int order)
 

Public Attributes

MoFEM::InterfacemField
 
bool newtonCotes
 
SmartPetscObj< Vec > contactStateVec
 
friend ConvectSlaveIntegrationPts
 

Detailed Description

Definition at line 76 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ SimpleContactElement()

SimpleContactProblem::SimpleContactElement::SimpleContactElement ( MoFEM::Interface m_field,
bool  newton_cotes = false 
)
inline

Definition at line 82 of file SimpleContact.hpp.

83 : ContactEle(m_field), mField(m_field), newtonCotes(newton_cotes),
ContactPrismElementForcesAndSourcesCore ContactEle

Member Function Documentation

◆ getRule()

int SimpleContactProblem::SimpleContactElement::getRule ( int  order)
inline

Definition at line 119 of file SimpleContact.hpp.

119 {
120 if (newtonCotes)
121 return -1;
122 else
123 return 2 * order;
124 }

◆ postProcess()

MoFEMErrorCode SimpleContactProblem::SimpleContactElement::postProcess ( )
inline

Definition at line 97 of file SimpleContact.hpp.

97 {
99
100 if (snes_ctx != CTX_SNESSETFUNCTION || !contactStateVec)
102
103 CHKERR VecAssemblyBegin(contactStateVec);
104 CHKERR VecAssemblyEnd(contactStateVec);
105
106 const double *array;
107 CHKERR VecGetArrayRead(contactStateVec, &array);
108 if (mField.get_comm_rank() == 0)
109
110 MOFEM_LOG_C("WORLD", Sev::verbose,
111 " Active Gauss pts: %d out of %d", (int)array[0],
112 (int)array[1]);
113
114 CHKERR VecRestoreArrayRead(contactStateVec, &array);
115
117 }
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
#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
virtual int get_comm_rank() const =0

◆ preProcess()

MoFEMErrorCode SimpleContactProblem::SimpleContactElement::preProcess ( )
inline

Definition at line 86 of file SimpleContact.hpp.

86 {
88 if (snes_ctx == CTX_SNESSETFUNCTION && contactStateVec) {
89 CHKERR VecAssemblyBegin(contactStateVec);
90 CHKERR VecAssemblyEnd(contactStateVec);
91
92 CHKERR VecZeroEntries(contactStateVec);
93 }
95 }

◆ setGaussPts()

MoFEMErrorCode SimpleContactProblem::SimpleContactElement::setGaussPts ( int  order)
virtual

Reimplemented in MortarContactProblem::MortarContactElement, MortarContactProblem::MortarConvectMasterContactElement, MortarContactProblem::MortarConvectSlaveContactElement, SimpleContactProblem::ConvectMasterContactElement, and SimpleContactProblem::ConvectSlaveContactElement.

Definition at line 29 of file SimpleContact.cpp.

29 {
31 if (newtonCotes) {
32 int rule = order + 2;
33 int nb_gauss_pts = IntRules::NCC::triangle_ncc_order_num(rule);
34 gaussPtsMaster.resize(3, nb_gauss_pts, false);
35 gaussPtsSlave.resize(3, nb_gauss_pts, false);
36 double xy_coords[2 * nb_gauss_pts];
37 double w_array[nb_gauss_pts];
38 IntRules::NCC::triangle_ncc_rule(rule, nb_gauss_pts, xy_coords, w_array);
39
40 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
41 gaussPtsMaster(0, gg) = xy_coords[gg * 2];
42 gaussPtsMaster(1, gg) = xy_coords[gg * 2 + 1];
43 gaussPtsMaster(2, gg) = w_array[gg];
44 gaussPtsSlave(0, gg) = xy_coords[gg * 2];
45 gaussPtsSlave(1, gg) = xy_coords[gg * 2 + 1];
46 gaussPtsSlave(2, gg) = w_array[gg];
47 }
48 } else {
50 }
52}

Member Data Documentation

◆ contactStateVec

SmartPetscObj<Vec> SimpleContactProblem::SimpleContactElement::contactStateVec

Definition at line 80 of file SimpleContact.hpp.

◆ ConvectSlaveIntegrationPts

friend SimpleContactProblem::SimpleContactElement::ConvectSlaveIntegrationPts

Definition at line 128 of file SimpleContact.hpp.

◆ mField

MoFEM::Interface& SimpleContactProblem::SimpleContactElement::mField

Definition at line 78 of file SimpleContact.hpp.

◆ newtonCotes

bool SimpleContactProblem::SimpleContactElement::newtonCotes

Definition at line 79 of file SimpleContact.hpp.


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