https://mooseframework.inl.gov
MechanicalContactConstraint.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 class DisplacedProblem;
22 
28 {
29 public:
31 
33 
34  virtual void timestepSetup() override;
35  virtual void jacobianSetup() override;
36  virtual void residualEnd() override;
37 
39 
40  virtual void updateAugmentedLagrangianMultiplier(bool beginning_of_step);
41  virtual void updateContactStatefulData(bool beginning_of_step);
42 
43  virtual Real computeQpSecondaryValue() override;
44 
46 
50  virtual void computeJacobian() override;
51 
56  virtual void computeOffDiagJacobian(unsigned int jvar) override;
57 
59 
66  unsigned int jvar) override;
67 
73  virtual void getConnectedDofIndices(unsigned int var_num) override;
74 
82  bool getCoupledVarComponent(unsigned int var_num, unsigned int & component);
83 
84  virtual bool addCouplingEntriesToJacobian() override { return _primary_secondary_jacobian; }
85 
86  bool shouldApply() override;
87  void computeContactForce(const Node & node, PenetrationInfo * pinfo, bool update_contact_set);
88 
89 protected:
90  MooseSharedPointer<DisplacedProblem> _displaced_problem;
91  Real gapOffset(const Node & node);
92  Real nodalArea(const Node & node);
93  Real getPenalty(const Node & node);
94  Real getTangentialPenalty(const Node & node);
95 
96  const unsigned int _component;
99  const bool _normalize_penalty;
100 
101  const Real _penalty;
107  const unsigned int _stick_lock_iterations;
110 
112  // std::map<Point, PenetrationInfo *> _point_to_info;
113 
114  const unsigned int _mesh_dimension;
115 
116  std::vector<unsigned int> _vars;
117  std::vector<MooseVariable *> _var_objects;
118 
124 
128 
135 
142 
144  std::set<dof_id_type> _current_contact_state;
145  std::set<dof_id_type> _old_contact_state;
146 
148  static Threads::spin_mutex _contact_set_mutex;
149 
151  const static unsigned int _no_iterations;
152  const unsigned int & _lagrangian_iteration_number;
153 
156 };
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:153
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)
Class to provide an interface for parameters and routines required to check convergence for the augme...
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