https://mooseframework.inl.gov
Loading...
Searching...
No Matches
contact
include
constraints
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
20
class
ComputeWeightedGapCartesianLMMechanicalContact
:
public
ADMortarConstraint
21
{
22
public
:
23
static
InputParameters
validParams
();
24
25
ComputeWeightedGapCartesianLMMechanicalContact
(
const
InputParameters
&
parameters
);
26
using
ADMortarConstraint::computeResidual
;
27
void
computeResidual
(
Moose::MortarType
mortar_type)
override
;
28
using
ADMortarConstraint::computeJacobian
;
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
64
const
ADVariableValue
&
_secondary_disp_x
;
66
const
ADVariableValue
&
_primary_disp_x
;
68
const
ADVariableValue
&
_secondary_disp_y
;
70
const
ADVariableValue
&
_primary_disp_y
;
71
73
const
bool
_has_disp_z
;
75
const
ADVariableValue
*
const
_secondary_disp_z
;
77
const
ADVariableValue
*
const
_primary_disp_z
;
78
82
const
Real
_c
;
83
85
ADReal
_qp_gap
;
86
88
Real
_qp_factor
;
89
91
bool
_normalize_c
;
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
107
ADRealVectorValue
_qp_gap_nodal
;
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
};
ADMortarConstraint.h
ADReal
DualNumber< Real, DNDerivativeType, true > ADReal
ADMortarConstraint
ADMortarConstraint::computeJacobian
virtual void computeJacobian() override
ADMortarConstraint::computeResidual
virtual void computeResidual() override
ComputeWeightedGapCartesianLMMechanicalContact
Computes the weighted gap that will later be used to enforce the zero-penetration mechanical contact ...
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:21
ComputeWeightedGapCartesianLMMechanicalContact::enforceConstraintOnDof
virtual void enforceConstraintOnDof(const DofObject *const dof)
Method called from post().
Definition
ComputeWeightedGapCartesianLMMechanicalContact.C:291
ComputeWeightedGapCartesianLMMechanicalContact::computeQpIProperties
virtual void computeQpIProperties()
Computes properties that are functions both of _qp and _i, for example the weighted gap.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.C:169
ComputeWeightedGapCartesianLMMechanicalContact::_secondary_disp_x
const ADVariableValue & _secondary_disp_x
x-displacement on the secondary face
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:64
ComputeWeightedGapCartesianLMMechanicalContact::_qp_factor
Real _qp_factor
The value of the LM at the current quadrature point.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:88
ComputeWeightedGapCartesianLMMechanicalContact::_disp_y_var
const MooseVariable *const _disp_y_var
The y displacement variable.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:102
ComputeWeightedGapCartesianLMMechanicalContact::_dof_to_normal_vector
std::unordered_map< const DofObject *, RealVectorValue > _dof_to_normal_vector
A map from node to normal vector (2D)
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:113
ComputeWeightedGapCartesianLMMechanicalContact::_lm_vars
std::vector< MooseVariable * > _lm_vars
Cartesian Lagrange multipliers for mechanical contact.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:97
ComputeWeightedGapCartesianLMMechanicalContact::_primary_disp_x
const ADVariableValue & _primary_disp_x
x-displacement on the primary face
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:66
ComputeWeightedGapCartesianLMMechanicalContact::_weighted_gap_ptr
const ADReal * _weighted_gap_ptr
A pointer members that can be used to help avoid copying ADReals.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:122
ComputeWeightedGapCartesianLMMechanicalContact::_dof_to_old_normal_vector
std::unordered_map< const DofObject *, RealVectorValue > _dof_to_old_normal_vector
A map from node to normal vector (2D) - old.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:116
ComputeWeightedGapCartesianLMMechanicalContact::_primary_disp_z
const ADVariableValue *const _primary_disp_z
z-displacement on the primary face
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:77
ComputeWeightedGapCartesianLMMechanicalContact::timestepSetup
void timestepSetup() override
Definition
ComputeWeightedGapCartesianLMMechanicalContact.C:186
ComputeWeightedGapCartesianLMMechanicalContact::_dof_to_weighted_gap
std::unordered_map< const DofObject *, std::pair< ADReal, Real > > _dof_to_weighted_gap
A map from node to weighted gap and normalization (if requested)
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:110
ComputeWeightedGapCartesianLMMechanicalContact::_primary_disp_y
const ADVariableValue & _primary_disp_y
y-displacement on the primary face
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:70
ComputeWeightedGapCartesianLMMechanicalContact::_qp_gap_nodal
ADRealVectorValue _qp_gap_nodal
Vector for computation of weighted gap with nodal normals.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:107
ComputeWeightedGapCartesianLMMechanicalContact::_normalize_c
bool _normalize_c
Whether to normalize weighted gap by weighting function norm.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:91
ComputeWeightedGapCartesianLMMechanicalContact::_qp_gap
ADReal _qp_gap
The value of the gap at the current quadrature point.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:85
ComputeWeightedGapCartesianLMMechanicalContact::computeJacobian
virtual void computeJacobian() override
ComputeWeightedGapCartesianLMMechanicalContact::residualSetup
void residualSetup() override
Definition
ComputeWeightedGapCartesianLMMechanicalContact.C:195
ComputeWeightedGapCartesianLMMechanicalContact::_disp_x_var
const MooseVariable *const _disp_x_var
The x displacement variable.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:100
ComputeWeightedGapCartesianLMMechanicalContact::incorrectEdgeDroppingPost
void incorrectEdgeDroppingPost(const std::unordered_set< const Node * > &inactive_lm_nodes) override
Copy of the post routine but that skips assembling inactive nodes.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.C:271
ComputeWeightedGapCartesianLMMechanicalContact::_c
const Real _c
This factor multiplies the weighted gap.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:82
ComputeWeightedGapCartesianLMMechanicalContact::post
void post() override
Definition
ComputeWeightedGapCartesianLMMechanicalContact.C:253
ComputeWeightedGapCartesianLMMechanicalContact::computeQpResidual
ADReal computeQpResidual(Moose::MortarType mortar_type) final
Definition
ComputeWeightedGapCartesianLMMechanicalContact.C:117
ComputeWeightedGapCartesianLMMechanicalContact::_dof_to_tangent_vectors
std::unordered_map< const DofObject *, std::array< RealVectorValue, 2 > > _dof_to_tangent_vectors
A map from node to tangent vector (2D for now)
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:119
ComputeWeightedGapCartesianLMMechanicalContact::computeQpProperties
virtual void computeQpProperties()
Computes properties that are functions only of the current quadrature point (_qp),...
Definition
ComputeWeightedGapCartesianLMMechanicalContact.C:123
ComputeWeightedGapCartesianLMMechanicalContact::_normalization_ptr
const Real * _normalization_ptr
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:123
ComputeWeightedGapCartesianLMMechanicalContact::jacobianSetup
void jacobianSetup() override final
Definition
ComputeWeightedGapCartesianLMMechanicalContact.C:203
ComputeWeightedGapCartesianLMMechanicalContact::_secondary_disp_y
const ADVariableValue & _secondary_disp_y
y-displacement on the secondary face
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:68
ComputeWeightedGapCartesianLMMechanicalContact::_nodal
const bool _nodal
Whether the dof objects are nodal; if they're not, then they're elemental.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:94
ComputeWeightedGapCartesianLMMechanicalContact::validParams
static InputParameters validParams()
Definition
ComputeWeightedGapCartesianLMMechanicalContact.C:47
ComputeWeightedGapCartesianLMMechanicalContact::_disp_z_var
const MooseVariable *const _disp_z_var
The z displacement variable.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:104
ComputeWeightedGapCartesianLMMechanicalContact::_has_disp_z
const bool _has_disp_z
For 2D mortar contact no displacement will be specified, so const pointers used.
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:73
ComputeWeightedGapCartesianLMMechanicalContact::computeResidual
virtual void computeResidual() override
ComputeWeightedGapCartesianLMMechanicalContact::_secondary_disp_z
const ADVariableValue *const _secondary_disp_z
z-displacement on the secondary face
Definition
ComputeWeightedGapCartesianLMMechanicalContact.h:75
ADMortarConstraint::parameters
const InputParameters & parameters() const
MooseVariableFE< Real >
libMesh::VectorValue< ADReal >
ADVariableValue
VariableValueTempl< true > ADVariableValue
Moose::MortarType
MortarType
InputParameters
Generated on Fri Sep 11 2026 20:36:00 for https://mooseframework.inl.gov by
1.9.8