https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
21 "OldEqualValueConstraint enforces solution continuity between secondary and "
22 "primary sides of a mortar interface using lagrange multipliers");
23 return params;
24}
25
30
31Real
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
47Real
49 unsigned int jvar)
50{
52
53 switch (jacobian_type)
54 {
55 case JType::SecondaryLower:
56 if (jvar == _var->number())
57 return -(*_phi)[_j][_qp] * _test_secondary[_i][_qp];
58 break;
59
60 case JType::PrimaryLower:
61 if (jvar == _var->number())
62 return (*_phi)[_j][_qp] * _test_primary[_i][_qp];
63 break;
64
65 case JType::LowerSecondary:
66 if (jvar == _secondary_var.number())
67 return -(*_phi)[_j][_qp] * _test[_i][_qp];
68 break;
69
70 case JType::LowerPrimary:
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}
registerMooseObject("MooseApp", OldEqualValueConstraint)
unsigned int _qp
Definition Constraint.h:36
unsigned int _j
Definition Constraint.h:35
unsigned int _i
Definition Constraint.h:35
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
unsigned int number() const
Get variable number coming from libMesh.
MooseVariableField< Real > & _primary_var
Reference to the primary variable.
MooseVariable *const _var
Pointer to the lagrange multipler variable. nullptr if none.
const VariableTestValue & _test_secondary
The shape functions corresponding to the secondary interior primal variable.
MooseVariableField< Real > & _secondary_var
Reference to the secondary variable.
const VariableTestValue & _test
The shape functions corresponding to the lagrange multiplier variable.
const VariableTestValue & _test_primary
The shape functions corresponding to the primary interior primal variable.
const VariablePhiValue * _phi
The current shape functions.
static InputParameters validParams()
const VariableValue & _u_secondary
The primal solution on the secondary side.
const VariableValue & _lambda
The LM solution.
const VariableValue & _u_primary
The primal solution on the primary side.
Constrain the value of a variable to be the same on both sides of an interface.
Real computeQpJacobian(Moose::ConstraintJacobianType jacobian_type, unsigned int jvar) final
compute the jacobian at the quadrature points
Real computeQpResidual(Moose::MortarType mortar_type) final
compute the residual at the quadrature points
OldEqualValueConstraint(const InputParameters &parameters)
static InputParameters validParams()
ConstraintJacobianType
Definition MooseTypes.h:851