https://mooseframework.inl.gov
OldEqualValueConstraint.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 
11 #include "SubProblem.h"
12 #include "FEProblem.h"
13 
15 
18 {
20  params.addClassDescription(
21  "OldEqualValueConstraint enforces solution continuity between secondary and "
22  "primary sides of a mortar interface using lagrange multipliers");
23  return params;
24 }
25 
27  : MortarConstraint(parameters)
28 {
29 }
30 
31 Real
33 {
34  switch (mortar_type)
35  {
37  return -_lambda[_qp] * _test_secondary[_i][_qp];
39  return _lambda[_qp] * _test_primary[_i][_qp];
41  return (_u_primary[_qp] - _u_secondary[_qp]) * _test[_i][_qp];
42  default:
43  return 0;
44  }
45 }
46 
47 Real
49  unsigned int jvar)
50 {
51  typedef Moose::ConstraintJacobianType JType;
52 
53  switch (jacobian_type)
54  {
56  if (jvar == _var->number())
57  return -(*_phi)[_j][_qp] * _test_secondary[_i][_qp];
58  break;
59 
61  if (jvar == _var->number())
62  return (*_phi)[_j][_qp] * _test_primary[_i][_qp];
63  break;
64 
66  if (jvar == _secondary_var.number())
67  return -(*_phi)[_j][_qp] * _test[_i][_qp];
68  break;
69 
71  if (jvar == _primary_var.number())
72  return (*_phi)[_j][_qp] * _test[_i][_qp];
73  break;
74 
75  default:
76  return 0;
77  }
78 
79  return 0;
80 }
MooseVariableField< Real > & _secondary_var
Reference to the secondary variable.
static InputParameters validParams()
const VariableTestValue & _test_secondary
The shape functions corresponding to the secondary interior primal variable.
const VariablePhiValue * _phi
The current shape functions.
OldEqualValueConstraint(const InputParameters &parameters)
unsigned int number() const
Get variable number coming from libMesh.
MortarType
Definition: MooseTypes.h:770
const VariableValue & _lambda
The LM solution.
registerMooseObject("MooseApp", OldEqualValueConstraint)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Constrain the value of a variable to be the same on both sides of an interface.
unsigned int _i
Definition: Constraint.h:35
Real computeQpResidual(Moose::MortarType mortar_type) final
compute the residual at the quadrature points
const VariableValue & _u_secondary
The primal solution on the secondary side.
const VariableTestValue & _test
The shape functions corresponding to the lagrange multiplier variable.
unsigned int _j
Definition: Constraint.h:35
Real computeQpJacobian(Moose::ConstraintJacobianType jacobian_type, unsigned int jvar) final
compute the jacobian at the quadrature points
MooseVariable *const _var
Pointer to the lagrange multipler variable. nullptr if none.
const VariableValue & _u_primary
The primal solution on the primary side.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
ConstraintJacobianType
Definition: MooseTypes.h:796
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
const VariableTestValue & _test_primary
The shape functions corresponding to the primary interior primal variable.
unsigned int _qp
Definition: Constraint.h:36
MooseVariableField< Real > & _primary_var
Reference to the primary variable.