#include <NormalNodalLMMechanicalContact.h>
◆ NormalNodalLMMechanicalContact()
NormalNodalLMMechanicalContact::NormalNodalLMMechanicalContact |
( |
const InputParameters & |
parameters | ) |
|
Definition at line 44 of file NormalNodalLMMechanicalContact.C.
45 : NodeFaceConstraint(parameters),
48 _c(getParam<Real>(
"c")),
49 _epsilon(std::numeric_limits<Real>::epsilon()),
50 _ncp_type(getParam<MooseEnum>(
"ncp_function_type"))
53 _overwrite_slave_residual =
false;
◆ computeJacobian()
void NormalNodalLMMechanicalContact::computeJacobian |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ computeOffDiagJacobian()
void NormalNodalLMMechanicalContact::computeOffDiagJacobian |
( |
unsigned |
jvar | ) |
|
|
overrideprotectedvirtual |
Definition at line 85 of file NormalNodalLMMechanicalContact.C.
87 if (jvar == _var.number())
93 MooseVariableFEBase & var = _sys.getVariable(0, jvar);
94 _connected_dof_indices.clear();
95 _connected_dof_indices.push_back(var.nodalDofIndex());
102 DenseMatrix<Number> & Ken =
103 _assembly.jacobianBlockNeighbor(Moose::ElementNeighbor, _var.number(), jvar);
105 for (_j = 0; _j < _phi_master.size(); ++_j)
◆ computeQpJacobian()
Real NormalNodalLMMechanicalContact::computeQpJacobian |
( |
Moose::ConstraintJacobianType |
type | ) |
|
|
overrideprotectedvirtual |
Definition at line 137 of file NormalNodalLMMechanicalContact.C.
139 std::map<dof_id_type, PenetrationInfo *>::iterator found =
140 _penetration_locator._penetration_info.find(_current_node->id());
141 if (found != _penetration_locator._penetration_info.end())
143 PenetrationInfo * pinfo = found->second;
146 DualNumber<Real, Real> dual_u_slave(_u_slave[_qp]);
147 dual_u_slave.derivatives() = 1.;
149 auto a = -pinfo->_distance *
_c;
150 auto b = dual_u_slave;
153 return (a + b - std::sqrt(a * a + b * b +
_epsilon)).derivatives();
155 return std::min(a, b).derivatives();
Referenced by computeJacobian().
◆ computeQpOffDiagJacobian()
Real NormalNodalLMMechanicalContact::computeQpOffDiagJacobian |
( |
Moose::ConstraintJacobianType |
type, |
|
|
unsigned |
jvar |
|
) |
| |
|
overrideprotectedvirtual |
Definition at line 162 of file NormalNodalLMMechanicalContact.C.
165 std::map<dof_id_type, PenetrationInfo *>::iterator found =
166 _penetration_locator._penetration_info.find(_current_node->id());
167 if (found != _penetration_locator._penetration_info.end())
169 PenetrationInfo * pinfo = found->second;
172 DualNumber<Real, Real> gap(-pinfo->_distance);
175 if (jvar == _master_var_num)
184 gap.derivatives() = pinfo->_normal(comp);
188 case Moose::SlaveSlave:
189 gap.derivatives() *= 1;
191 case Moose::SlaveMaster:
192 gap.derivatives() *= -_phi_master[_j][_qp];
195 mooseError(
"LMs do not have a master contribution.");
199 auto b = _u_slave[_qp];
202 return (a + b - std::sqrt(a * a + b * b +
_epsilon)).derivatives();
204 return std::min(a, b).derivatives();
Referenced by computeOffDiagJacobian().
◆ computeQpResidual()
Real NormalNodalLMMechanicalContact::computeQpResidual |
( |
Moose::ConstraintType |
type | ) |
|
|
overrideprotectedvirtual |
Definition at line 109 of file NormalNodalLMMechanicalContact.C.
111 std::map<dof_id_type, PenetrationInfo *>::iterator found =
112 _penetration_locator._penetration_info.find(_current_node->id());
113 if (found != _penetration_locator._penetration_info.end())
115 PenetrationInfo * pinfo = found->second;
118 Real a = -pinfo->_distance *
_c;
120 _qp < _u_slave.size(),
121 "qp is greater than the size of u_slave in NormalNodalLMMechanicalContact. Check and "
122 "make sure that your Lagrange multiplier variable has the same order as the mesh");
123 Real b = _u_slave[_qp];
126 return a + b - std::sqrt(a * a + b * b +
_epsilon);
128 return std::min(a, b);
Referenced by computeResidual().
◆ computeQpSlaveValue()
Real NormalNodalLMMechanicalContact::computeQpSlaveValue |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ computeResidual()
void NormalNodalLMMechanicalContact::computeResidual |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ _c
const Real NormalNodalLMMechanicalContact::_c |
|
protected |
◆ _disp_y_id
const unsigned NormalNodalLMMechanicalContact::_disp_y_id |
|
protected |
◆ _disp_z_id
const unsigned NormalNodalLMMechanicalContact::_disp_z_id |
|
protected |
◆ _epsilon
const Real NormalNodalLMMechanicalContact::_epsilon |
|
protected |
◆ _ncp_type
const MooseEnum NormalNodalLMMechanicalContact::_ncp_type |
|
protected |
The documentation for this class was generated from the following files: