https://mooseframework.inl.gov
ComputeDynamicWeightedGapLMMechanicalContact.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 #include "ADMortarConstraint.h"
13 
14 #include <unordered_map>
15 
20 {
21 public:
23 
25 
26 protected:
31  virtual void computeQpProperties();
32 
33  virtual void computeQpIProperties();
34 
35  ADReal computeQpResidual(Moose::MortarType mortar_type) final;
36 
38  void computeResidual(Moose::MortarType mortar_type) override;
40  void computeJacobian(Moose::MortarType mortar_type) override;
41  void residualSetup() override;
42  void jacobianSetup() override final;
43 
44  void timestepSetup() override;
45 
46  virtual void post() override;
47 
48  virtual void
49  incorrectEdgeDroppingPost(const std::unordered_set<const Node *> & inactive_lm_nodes) override;
50 
51  void communicateWear();
52 
59  virtual void enforceConstraintOnDof(const DofObject * const dof);
60 
69 
71  const bool _has_disp_z;
76 
80  const Real _c;
81 
84 
87 
90 
92  const bool _nodal;
93 
95  const MooseVariable * const _disp_x_var;
97  const MooseVariable * const _disp_y_var;
99  const MooseVariable * const _disp_z_var;
100 
103 
105  std::unordered_map<const DofObject *, std::pair<ADReal, Real>> _dof_to_weighted_gap;
106 
108  const ADReal * _weighted_gap_ptr = nullptr;
109  const Real * _normalization_ptr = nullptr;
110 
113 
118 
121 
123  const bool _has_wear;
124 
127 
129  std::unordered_map<const DofObject *, ADReal> _dof_to_old_weighted_gap;
130 
133 
136 
138  std::unordered_map<const DofObject *, ADReal> _dof_to_weighted_gap_dynamics;
139 
141  std::unordered_map<const DofObject *, ADReal> _dof_to_velocity;
143  std::unordered_map<const DofObject *, ADReal> _dof_to_old_velocity;
144 
145  // Newmark-beta beta parameter
147 
148  // Newmark-beta gamma parameter
150 
152  std::unordered_map<const DofObject *, ADReal> _dof_to_nodal_wear_depth;
153 
155  std::unordered_map<const DofObject *, ADReal> _dof_to_nodal_old_wear_depth;
156 
159 };
virtual void computeQpProperties()
Computes properties that are functions only of the current quadrature point (_qp), e.g.
const VariableValue & _wear_depth
Wear depth to include contact.
ADRealVectorValue _qp_velocity
Vector for computation of weighted gap velocity to fulfill "persistency" condition.
const ADVariableValue & _secondary_disp_x
x-displacement on the secondary face
const ADVariableValue & _primary_disp_y
y-displacement on the primary face
virtual void enforceConstraintOnDof(const DofObject *const dof)
Method called from post().
const ADVariableValue & _primary_disp_x
x-displacement on the primary face
std::unordered_map< const DofObject *, std::pair< ADReal, Real > > _dof_to_weighted_gap
A map from node to weighted gap and normalization (if requested)
std::unordered_map< const DofObject *, ADReal > _dof_to_old_weighted_gap
A map from dof-object to the old weighted gap.
const ADVariableValue *const _secondary_disp_z
z-displacement on the secondary face
const bool _has_disp_z
For 2D mortar contact no displacement will be specified, so const pointers used.
Computes the normal contact mortar constraints for dynamic simulations.
DualNumber< Real, DNDerivativeType, true > ADReal
virtual void computeResidual() override
std::unordered_map< const DofObject *, ADReal > _dof_to_old_velocity
A map from node to weighted gap velocity times _dt.
std::unordered_map< const DofObject *, ADReal > _dof_to_nodal_wear_depth
A map from node to wear in this step.
std::unordered_map< const DofObject *, ADReal > _dof_to_weighted_gap_dynamics
A map from node to weighted gap velocity times _dt.
ADReal _qp_gap
The value of the gap at the current quadrature point.
virtual void incorrectEdgeDroppingPost(const std::unordered_set< const Node *> &inactive_lm_nodes) override
const MooseVariable *const _disp_z_var
The z displacement variable.
const bool _nodal
Whether the dof objects are nodal; if they&#39;re not, then they&#39;re elemental.
const ADVariableValue & _secondary_disp_y
y-displacement on the secondary face
const ADReal * _weighted_gap_ptr
A pointer members that can be used to help avoid copying ADReals.
const MooseVariable *const _disp_x_var
The x displacement variable.
OutputTools< Real >::VariableValue VariableValue
ADRealVectorValue _qp_gap_nodal_dynamics
Vector for computation of weighted gap velocity to fulfill "persistency" condition.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool _normalize_c
Whether to normalize weighted gap by weighting function norm.
const Real _capture_tolerance
A small threshold gap value to consider that a node needs a "persistency" constraint.
std::unordered_map< const DofObject *, ADReal > _dof_to_nodal_old_wear_depth
A map from node to wear in old step.
virtual void computeJacobian() override
const InputParameters & parameters() const
std::unordered_map< const DofObject *, ADReal > _dof_to_velocity
A map from node to weighted gap velocity times _dt.
const bool _has_wear
Flag to determine whether wear needs to be included in the contact constraints.
const ADVariableValue *const _primary_disp_z
z-displacement on the primary face
Real _qp_factor
The value of the LM at the current quadrature point.
ADRealVectorValue _qp_gap_nodal
Vector for computation of weighted gap with nodal normals.
const Real _c
This factor multiplies the weighted gap.
const MooseVariable *const _disp_y_var
The y displacement variable.