https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NormalMortarMechanicalContact.C
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
12
14
17{
19
20 MooseEnum component("x=0 y=1 z=2");
22 "component", component, "The force component constraint that this object is supplying");
24 "This class is used to apply normal contact forces using lagrange multipliers");
25 params.set<bool>("compute_lm_residual") = false;
26 params.set<bool>("interpolate_normals") = false;
27 params.addRequiredParam<UserObjectName>("weighted_gap_uo", "The weighted gap user object.");
28 return params;
29}
30
32 : ADMortarLagrangeConstraint(parameters),
33 _component(getParam<MooseEnum>("component")),
34 _weighted_gap_uo(const_cast<WeightedGapUserObject &>(
35 getUserObject<WeightedGapUserObject>("weighted_gap_uo")))
36{
37}
38
41{
42 switch (type)
43 {
44 case Moose::MortarType::Secondary:
45 // If normals is positive, then this residual is positive, indicating that we have an outflow
46 // of momentum, which in turn indicates that the momentum will tend to decrease at this
47 // location with time, which is what we want because the force vector is in the negative
48 // direction (always opposite of the normals). Conversely, if the normals is negative, then
49 // this residual is negative, indicating that we have an inflow of momentum, which in turn
50 // indicates the momentum will tend to increase at this location with time, which is what we
51 // want because the force vector is in the positive direction (always opposite of the
52 // normals).
53 // Get the _dof_to_weighted_gap map
54 {
55 const auto normal_index = libmesh_map_find(_secondary_ip_lowerd_map, _i);
57 _normals[normal_index](_component);
58 }
59
60 case Moose::MortarType::Primary:
61 // The normal vector is signed according to the secondary face, so we need to introduce a
62 // negative sign here
63 {
64 const auto normal_index = libmesh_map_find(_primary_ip_lowerd_map, _i);
66 _normals[normal_index](_component);
67 }
68 default:
69 return 0;
70 }
71}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("ContactApp", NormalMortarMechanicalContact)
This class enforces mortar constraints on lower dimensional domains, skipping interior nodes.
std::map< unsigned int, unsigned int > _primary_ip_lowerd_map
Nodal map from primary interior parent to lower dimensional domain.
std::map< unsigned int, unsigned int > _secondary_ip_lowerd_map
Nodal map from secondary interior parent to lower dimensional domain.
static InputParameters validParams()
unsigned int _qp
unsigned int _i
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
const std::string & type() const
const VariableTestValue & _test_secondary
const VariableTestValue & _test_primary
std::vector< Point > _normals
ADReal computeQpResidual(Moose::MortarType type) final
NormalMortarMechanicalContact(const InputParameters &parameters)
WeightedGapUserObject & _weighted_gap_uo
The weighted gap user object which supplies the contact force.
const MooseEnum _component
The displacement component that this object applies to.
Creates dof object to weighted gap map.
virtual const ADVariableValue & contactPressure() const =0