www.mooseframework.org
MechanicalContactConstraint.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // MOOSE includes
13 #include "NodeFaceConstraint.h"
14 #include "PenetrationLocator.h"
15 
16 // Forward Declarations
19 enum class ContactModel;
20 enum class ContactFormulation;
21 
27 {
28 public:
30 
32 
33  virtual void timestepSetup() override;
34  virtual void jacobianSetup() override;
35  virtual void residualEnd() override;
36 
38 
39  virtual void updateAugmentedLagrangianMultiplier(bool beginning_of_step);
40  virtual void updateContactStatefulData(bool beginning_of_step);
41 
42  virtual Real computeQpSecondaryValue() override;
43 
45 
49  virtual void computeJacobian() override;
50 
55  virtual void computeOffDiagJacobian(unsigned int jvar) override;
56 
58 
65  unsigned int jvar) override;
66 
72  virtual void getConnectedDofIndices(unsigned int var_num) override;
73 
81  bool getCoupledVarComponent(unsigned int var_num, unsigned int & component);
82 
83  virtual bool addCouplingEntriesToJacobian() override { return _primary_secondary_jacobian; }
84 
85  bool shouldApply() override;
86  void computeContactForce(const Node & node, PenetrationInfo * pinfo, bool update_contact_set);
87 
88 protected:
89  MooseSharedPointer<DisplacedProblem> _displaced_problem;
90  Real gapOffset(const Node & node);
91  Real nodalArea(const Node & node);
92  Real getPenalty(const Node & node);
93  Real getTangentialPenalty(const Node & node);
94 
95  const unsigned int _component;
98  const bool _normalize_penalty;
99 
100  const Real _penalty;
106  const unsigned int _stick_lock_iterations;
109 
111  // std::map<Point, PenetrationInfo *> _point_to_info;
112 
113  const unsigned int _mesh_dimension;
114 
115  std::vector<unsigned int> _vars;
116  std::vector<MooseVariable *> _var_objects;
117 
123 
127 
134 
141 
143  std::set<dof_id_type> _current_contact_state;
144  std::set<dof_id_type> _old_contact_state;
145 
147  static Threads::spin_mutex _contact_set_mutex;
148 
150  const static unsigned int _no_iterations;
151  const unsigned int & _lagrangian_iteration_number;
152 
155 };
ContactLineSearchBase * _contact_linesearch
NumericVector< Number > & _residual_copy
virtual void updateContactStatefulData(bool beginning_of_step)
ConstraintType
const bool _primary_secondary_jacobian
Whether to include coupling between the primary and secondary nodes in the Jacobian.
std::set< dof_id_type > _current_contact_state
A MechanicalContactConstraint forces the value of a variable to be the same on both sides of an inter...
AugmentedLagrangianContactProblemInterface *const _augmented_lagrange_problem
static const std::string component
Definition: NS.h:138
bool getCoupledVarComponent(unsigned int var_num, unsigned int &component)
Determine whether the coupled variable is one of the displacement variables, and find its component...
const ContactFormulation _formulation
virtual void getConnectedDofIndices(unsigned int var_num) override
Get the dof indices of the nodes connected to the secondary node for a specific variable.
virtual void updateAugmentedLagrangianMultiplier(bool beginning_of_step)
virtual Real computeQpOffDiagJacobian(Moose::ConstraintJacobianType type, unsigned int jvar) override
Compute off-diagonal Jacobian entries.
Real _al_penetration_tolerance
The tolerance of the penetration for augmented Lagrangian method.
virtual Real computeQpResidual(Moose::ConstraintType type) override
const unsigned int & _lagrangian_iteration_number
const MooseVariable *const _mapped_primary_gap_offset_var
static Threads::spin_mutex _contact_set_mutex
std::set< dof_id_type > _old_contact_state
This class implements a custom line search for use with mechanical contact.
virtual bool addCouplingEntriesToJacobian() override
static InputParameters validParams()
std::vector< MooseVariable * > _var_objects
void computeContactForce(const Node &node, PenetrationInfo *pinfo, bool update_contact_set)
virtual Real computeQpJacobian(Moose::ConstraintJacobianType type) override
virtual void computeOffDiagJacobian(unsigned int jvar) override
Compute off-diagonal Jacobian entries.
const bool _non_displacement_vars_jacobian
Whether to include coupling terms with non-displacement variables in the Jacobian.
const NumericVector< Number > *const _aux_solution
const std::string & type() const
MooseSharedPointer< DisplacedProblem > _displaced_problem
ContactFormulation
Definition: ContactAction.h:23
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const unsigned int _no_iterations
std::vector< unsigned int > _vars
virtual void computeJacobian() override
Computes the jacobian for the current element.
Real _al_incremental_slip_tolerance
The tolerance of the incremental slip for augmented Lagrangian method.
MechanicalContactConstraint(const InputParameters &parameters)
ConstraintJacobianType
const bool _connected_secondary_nodes_jacobian
Whether to include coupling terms with the nodes connected to the secondary nodes in the Jacobian...
const InputParameters & parameters() const
Real _al_frictional_force_tolerance
The tolerance of the frictional force for augmented Lagrangian method.
const bool _has_secondary_gap_offset
gap offset from either secondary, primary or both
ContactModel
Definition: ContactAction.h:16
virtual Real computeQpSecondaryValue() override
const MooseVariable *const _secondary_gap_offset_var