https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
22public:
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
40protected:
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
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};
DualNumber< Real, DNDerivativeType, true > ADReal
virtual void computeJacobian() override
virtual void computeResidual() override
Computes the weighted gap that will later be used to enforce the zero-penetration mechanical contact ...
virtual void enforceConstraintOnDof(const DofObject *const dof)
Method called from post().
virtual void computeQpIProperties()
Computes properties that are functions both of _qp and _i, for example the weighted gap.
const ADVariableValue & _secondary_disp_x
x-displacement on the secondary face
Real _qp_factor
The value of the LM at the current quadrature point.
const MooseVariable *const _disp_y_var
The y displacement variable.
std::unordered_map< const DofObject *, RealVectorValue > _dof_to_normal_vector
A map from node to normal vector (2D)
std::vector< MooseVariable * > _lm_vars
Cartesian Lagrange multipliers for mechanical contact.
const ADVariableValue & _primary_disp_x
x-displacement on the primary face
const ADReal * _weighted_gap_ptr
A pointer members that can be used to help avoid copying ADReals.
std::unordered_map< const DofObject *, RealVectorValue > _dof_to_old_normal_vector
A map from node to normal vector (2D) - old.
const ADVariableValue *const _primary_disp_z
z-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)
const ADVariableValue & _primary_disp_y
y-displacement on the primary face
ADRealVectorValue _qp_gap_nodal
Vector for computation of weighted gap with nodal normals.
bool _normalize_c
Whether to normalize weighted gap by weighting function norm.
ADReal _qp_gap
The value of the gap at the current quadrature point.
const MooseVariable *const _disp_x_var
The x displacement variable.
void incorrectEdgeDroppingPost(const std::unordered_set< const Node * > &inactive_lm_nodes) override
Copy of the post routine but that skips assembling inactive nodes.
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 computeQpProperties()
Computes properties that are functions only of the current quadrature point (_qp),...
const ADVariableValue & _secondary_disp_y
y-displacement on the secondary face
const bool _nodal
Whether the dof objects are nodal; if they're not, then they're elemental.
const MooseVariable *const _disp_z_var
The z displacement variable.
const bool _has_disp_z
For 2D mortar contact no displacement will be specified, so const pointers used.
const ADVariableValue *const _secondary_disp_z
z-displacement on the secondary face
const InputParameters & parameters() const
VariableValueTempl< true > ADVariableValue