www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NormalNodalMechanicalContact Class Reference

#include <NormalNodalMechanicalContact.h>

Inheritance diagram for NormalNodalMechanicalContact:
[legend]

Public Member Functions

 NormalNodalMechanicalContact (const InputParameters &parameters)
 
void computeJacobian () override
 
void computeOffDiagJacobian (unsigned int jvar) override
 

Protected Member Functions

virtual Real computeQpSlaveValue () override
 
virtual Real computeQpResidual (Moose::ConstraintType type) override
 
virtual Real computeQpJacobian (Moose::ConstraintJacobianType type) override
 
virtual Real computeQpOffDiagJacobian (Moose::ConstraintJacobianType type, unsigned jvar) override
 

Protected Attributes

const Real & _lambda
 
const unsigned _lambda_id
 
const Real _epsilon
 
const MooseEnum _component
 

Detailed Description

Definition at line 21 of file NormalNodalMechanicalContact.h.

Constructor & Destructor Documentation

◆ NormalNodalMechanicalContact()

NormalNodalMechanicalContact::NormalNodalMechanicalContact ( const InputParameters &  parameters)

Definition at line 32 of file NormalNodalMechanicalContact.C.

33  : NodeFaceConstraint(parameters),
34  _lambda(getVar("lambda", 0)->nodalValue()),
35  _lambda_id(coupled("lambda")),
36  _epsilon(std::numeric_limits<Real>::epsilon()),
37  _component(getParam<MooseEnum>("component"))
38 {
39  _overwrite_slave_residual = false;
40 }

Member Function Documentation

◆ computeJacobian()

void NormalNodalMechanicalContact::computeJacobian ( )
override

Definition at line 49 of file NormalNodalMechanicalContact.C.

50 {
51 }

◆ computeOffDiagJacobian()

void NormalNodalMechanicalContact::computeOffDiagJacobian ( unsigned int  jvar)
override

Definition at line 54 of file NormalNodalMechanicalContact.C.

55 {
56  // Our residual only strongly depends on the lagrange multiplier (the normal vector does indeed
57  // depend on displacements but it's complicated and shouldn't be too strong of a dependence)
58  if (jvar != _lambda_id)
59  return;
60 
61  MooseVariableFEBase & var = _sys.getVariable(0, jvar);
62  _connected_dof_indices.clear();
63  _connected_dof_indices.push_back(var.nodalDofIndex());
64 
65  _qp = 0;
66 
67  _Kee.resize(1, 1);
68  _Kee(0, 0) = computeQpOffDiagJacobian(Moose::SlaveSlave, jvar);
69 
70  _Kne.resize(_test_master.size(), 1);
71 
72  for (_i = 0; _i < _test_master.size(); ++_i)
73  _Kne(_i, 0) = computeQpOffDiagJacobian(Moose::MasterSlave, jvar);
74 }

◆ computeQpJacobian()

Real NormalNodalMechanicalContact::computeQpJacobian ( Moose::ConstraintJacobianType  type)
overrideprotectedvirtual

Definition at line 104 of file NormalNodalMechanicalContact.C.

105 {
106  return 0;
107 }

◆ computeQpOffDiagJacobian()

Real NormalNodalMechanicalContact::computeQpOffDiagJacobian ( Moose::ConstraintJacobianType  type,
unsigned  jvar 
)
overrideprotectedvirtual

Definition at line 110 of file NormalNodalMechanicalContact.C.

112 {
113  std::map<dof_id_type, PenetrationInfo *>::iterator found =
114  _penetration_locator._penetration_info.find(_current_node->id());
115  if (found != _penetration_locator._penetration_info.end())
116  {
117  PenetrationInfo * pinfo = found->second;
118 
119  // Latter check here is actually redundant because we don't call into this function unless jvar
120  // == _lambda_id
121  if (pinfo && jvar == _lambda_id)
122  {
123  switch (type)
124  {
125  case Moose::SlaveSlave:
126  return -pinfo->_normal(_component);
127  case Moose::MasterSlave:
128  return _test_master[_i][_qp] * pinfo->_normal(_component);
129  default:
130  return 0;
131  }
132  }
133  }
134 
135  return 0;
136 }

Referenced by computeOffDiagJacobian().

◆ computeQpResidual()

Real NormalNodalMechanicalContact::computeQpResidual ( Moose::ConstraintType  type)
overrideprotectedvirtual

Definition at line 77 of file NormalNodalMechanicalContact.C.

78 {
79  std::map<dof_id_type, PenetrationInfo *>::iterator found =
80  _penetration_locator._penetration_info.find(_current_node->id());
81  if (found != _penetration_locator._penetration_info.end())
82  {
83  PenetrationInfo * pinfo = found->second;
84  if (pinfo)
85  {
86  switch (type)
87  {
88  case Moose::ConstraintType::Slave:
89  // This normal appears to point in the opposite direction of the slave surface so we need
90  // a negative sign
91  return _lambda * -pinfo->_normal(_component);
92 
93  case Moose::ConstraintType::Master:
94  return _test_master[_i][_qp] * _lambda * pinfo->_normal(_component);
95 
96  default:
97  return 0;
98  }
99  }
100  }
101  return 0;
102 }

◆ computeQpSlaveValue()

Real NormalNodalMechanicalContact::computeQpSlaveValue ( )
overrideprotectedvirtual

Definition at line 43 of file NormalNodalMechanicalContact.C.

44 {
45  return _u_slave[_qp];
46 }

Member Data Documentation

◆ _component

const MooseEnum NormalNodalMechanicalContact::_component
protected

Definition at line 39 of file NormalNodalMechanicalContact.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _epsilon

const Real NormalNodalMechanicalContact::_epsilon
protected

Definition at line 38 of file NormalNodalMechanicalContact.h.

◆ _lambda

const Real& NormalNodalMechanicalContact::_lambda
protected

Definition at line 36 of file NormalNodalMechanicalContact.h.

Referenced by computeQpResidual().

◆ _lambda_id

const unsigned NormalNodalMechanicalContact::_lambda_id
protected

The documentation for this class was generated from the following files:
NormalNodalMechanicalContact::_lambda_id
const unsigned _lambda_id
Definition: NormalNodalMechanicalContact.h:37
NormalNodalMechanicalContact::_epsilon
const Real _epsilon
Definition: NormalNodalMechanicalContact.h:38
NormalNodalMechanicalContact::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(Moose::ConstraintJacobianType type, unsigned jvar) override
Definition: NormalNodalMechanicalContact.C:110
NormalNodalMechanicalContact::_component
const MooseEnum _component
Definition: NormalNodalMechanicalContact.h:39
NormalNodalMechanicalContact::_lambda
const Real & _lambda
Definition: NormalNodalMechanicalContact.h:36