https://mooseframework.inl.gov
ComputeWeightedGapCartesianLMMechanicalContact.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 
21 {
22 public:
24 
27  void computeResidual(Moose::MortarType mortar_type) override;
29  void computeJacobian(Moose::MortarType mortar_type) override;
30  void residualSetup() override;
31  void jacobianSetup() override final;
32  void post() override;
33 
37  void
38  incorrectEdgeDroppingPost(const std::unordered_set<const Node *> & inactive_lm_nodes) override;
39 
40 protected:
41  ADReal computeQpResidual(Moose::MortarType mortar_type) final;
42 
47  virtual void computeQpProperties();
48 
52  virtual void computeQpIProperties();
53 
54  void timestepSetup() override;
61  virtual void enforceConstraintOnDof(const DofObject * const dof);
62 
71 
73  const bool _has_disp_z;
78 
82  const Real _c;
83 
86 
89 
92 
94  const bool _nodal;
95 
97  std::vector<MooseVariable *> _lm_vars;
98 
100  const MooseVariable * const _disp_x_var;
102  const MooseVariable * const _disp_y_var;
104  const MooseVariable * const _disp_z_var;
105 
108 
110  std::unordered_map<const DofObject *, std::pair<ADReal, Real>> _dof_to_weighted_gap;
111 
113  std::unordered_map<const DofObject *, RealVectorValue> _dof_to_normal_vector;
114 
116  std::unordered_map<const DofObject *, RealVectorValue> _dof_to_old_normal_vector;
117 
119  std::unordered_map<const DofObject *, std::array<RealVectorValue, 2>> _dof_to_tangent_vectors;
120 
122  const ADReal * _weighted_gap_ptr = nullptr;
123  const Real * _normalization_ptr = nullptr;
124 };
virtual void computeQpProperties()
Computes properties that are functions only of the current quadrature point (_qp), e.g.
const MooseVariable *const _disp_z_var
The z displacement variable.
Real _qp_factor
The value of the LM at the current quadrature point.
const bool _has_disp_z
For 2D mortar contact no displacement will be specified, so const pointers used.
std::unordered_map< const DofObject *, std::pair< ADReal, Real > > _dof_to_weighted_gap
A map from node to weighted gap and normalization (if requested)
void incorrectEdgeDroppingPost(const std::unordered_set< const Node *> &inactive_lm_nodes) override
Copy of the post routine but that skips assembling inactive nodes.
const MooseVariable *const _disp_y_var
The y displacement variable.
ADReal _qp_gap
The value of the gap at the current quadrature point.
virtual void computeQpIProperties()
Computes properties that are functions both of _qp and _i, for example the weighted gap...
const bool _nodal
Whether the dof objects are nodal; if they&#39;re not, then they&#39;re elemental.
bool _normalize_c
Whether to normalize weighted gap by weighting function norm.
DualNumber< Real, DNDerivativeType, true > ADReal
virtual void computeResidual() override
std::unordered_map< const DofObject *, std::array< RealVectorValue, 2 > > _dof_to_tangent_vectors
A map from node to tangent vector (2D for now)
virtual void enforceConstraintOnDof(const DofObject *const dof)
Method called from post().
const ADVariableValue *const _secondary_disp_z
z-displacement on the secondary face
std::unordered_map< const DofObject *, RealVectorValue > _dof_to_normal_vector
A map from node to normal vector (2D)
Computes the weighted gap that will later be used to enforce the zero-penetration mechanical contact ...
const ADVariableValue *const _primary_disp_z
z-displacement on the primary face
std::vector< MooseVariable * > _lm_vars
Cartesian Lagrange multipliers for mechanical contact.
const ADVariableValue & _secondary_disp_y
y-displacement on the secondary face
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MooseVariable *const _disp_x_var
The x displacement variable.
ADRealVectorValue _qp_gap_nodal
Vector for computation of weighted gap with nodal normals.
virtual void computeJacobian() override
const InputParameters & parameters() const
const ADVariableValue & _secondary_disp_x
x-displacement on the secondary face
const ADVariableValue & _primary_disp_x
x-displacement on the primary face
std::unordered_map< const DofObject *, RealVectorValue > _dof_to_old_normal_vector
A map from node to normal vector (2D) - old.
const ADVariableValue & _primary_disp_y
y-displacement on the primary face
const ADReal * _weighted_gap_ptr
A pointer members that can be used to help avoid copying ADReals.