v0.14.0
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),
84  contactStateVec() {}

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  }

◆ 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::MortarConvectSlaveContactElement, MortarContactProblem::MortarConvectMasterContactElement, SimpleContactProblem::ConvectSlaveContactElement, SimpleContactProblem::ConvectMasterContactElement, and MortarContactProblem::MortarContactElement.

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 {
49  CHKERR ContactEle::setDefaultGaussPts(2 * order);
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:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::CoreInterface::get_comm_rank
virtual int get_comm_rank() const =0
order
constexpr int order
Definition: dg_projection.cpp:18
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
triangle_ncc_rule
void triangle_ncc_rule(int rule, int order_num, double xy[], double w[])
Definition: triangle_ncc_rule.c:633
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
triangle_ncc_order_num
int triangle_ncc_order_num(int rule)
Definition: triangle_ncc_rule.c:577
SimpleContactProblem::SimpleContactElement::contactStateVec
SmartPetscObj< Vec > contactStateVec
Definition: SimpleContact.hpp:80
SimpleContactProblem::SimpleContactElement::mField
MoFEM::Interface & mField
Definition: SimpleContact.hpp:78
SimpleContactProblem::ContactEle
ContactPrismElementForcesAndSourcesCore ContactEle
Definition: SimpleContact.hpp:29
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::SimpleContactElement::newtonCotes
bool newtonCotes
Definition: SimpleContact.hpp:79