www.mooseframework.org
NormalMortarMechanicalContact.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
11 
13 
16  ADMortarConstraint,
17 
18  MooseEnum component("x=0 y=1 z=2");
19  params.addRequiredParam<MooseEnum>(
20  "component", component, "The force component constraint that this object is supplying");
21  params.addClassDescription(
22  "This class is used to apply normal contact forces using lagrange multipliers");
23  params.set<bool>("compute_lm_residual") = false;);
24 
25 template <ComputeStage compute_stage>
27  const InputParameters & parameters)
28  : ADMortarConstraint<compute_stage>(parameters), _component(getParam<MooseEnum>("component"))
29 {
30 }
31 
32 template <ComputeStage compute_stage>
33 ADReal
35 {
36  switch (type)
37  {
38  case Moose::MortarType::Slave:
39  // If normals is positive, then this residual is positive, indicating that we have an outflow
40  // of momentum, which in turn indicates that the momentum will tend to decrease at this
41  // location with time, which is what we want because the force vector is in the negative
42  // direction (always opposite of the normals). Conversely, if the normals is negative, then
43  // this residual is negative, indicating that we have an inflow of momentum, which in turn
44  // indicates the momentum will tend to increase at this location with time, which is what we
45  // want because the force vector is in the positive direction (always opposite of the
46  // normals).
47  return _test_slave[_i][_qp] * _lambda[_qp] * _normals[_qp](_component);
48 
49  case Moose::MortarType::Master:
50  // The normal vector is signed according to the slave face, so we need to introduce a negative
51  // sign here
52  return -_test_master[_i][_qp] * _lambda[_qp] * _normals[_qp](_component);
53 
54  default:
55  return 0;
56  }
57 }
defineADValidParams
defineADValidParams(NormalMortarMechanicalContact, ADMortarConstraint, MooseEnum component("x=0 y=1 z=2");params.addRequiredParam< MooseEnum >("component", component, "The force component constraint that this object is supplying");params.addClassDescription("This class is used to apply normal contact forces using lagrange multipliers");params.set< bool >("compute_lm_residual")=false;)
NormalMortarMechanicalContact::NormalMortarMechanicalContact
NormalMortarMechanicalContact(const InputParameters &parameters)
Definition: NormalMortarMechanicalContact.C:26
NormalMortarMechanicalContact
Definition: NormalMortarMechanicalContact.h:15
registerADMooseObject
registerADMooseObject("MooseApp", NormalMortarMechanicalContact)
MaterialTensorCalculatorTools::component
Real component(const SymmTensor &symm_tensor, unsigned int index)
Definition: MaterialTensorCalculatorTools.C:16
NormalMortarMechanicalContact.h
NormalMortarMechanicalContact::computeQpResidual
ADReal computeQpResidual(Moose::MortarType type) final
Definition: NormalMortarMechanicalContact.C:34