Line data Source code
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 : #include "OldEqualValueConstraint.h" 11 : #include "SubProblem.h" 12 : #include "FEProblem.h" 13 : 14 : registerMooseObject("MooseApp", OldEqualValueConstraint); 15 : 16 : InputParameters 17 14265 : OldEqualValueConstraint::validParams() 18 : { 19 14265 : InputParameters params = MortarConstraint::validParams(); 20 14265 : params.addClassDescription( 21 : "OldEqualValueConstraint enforces solution continuity between secondary and " 22 : "primary sides of a mortar interface using lagrange multipliers"); 23 14265 : return params; 24 0 : } 25 : 26 0 : OldEqualValueConstraint::OldEqualValueConstraint(const InputParameters & parameters) 27 0 : : MortarConstraint(parameters) 28 : { 29 0 : } 30 : 31 : Real 32 0 : OldEqualValueConstraint::computeQpResidual(Moose::MortarType mortar_type) 33 : { 34 0 : switch (mortar_type) 35 : { 36 0 : case Moose::MortarType::Secondary: 37 0 : return -_lambda[_qp] * _test_secondary[_i][_qp]; 38 0 : case Moose::MortarType::Primary: 39 0 : return _lambda[_qp] * _test_primary[_i][_qp]; 40 0 : case Moose::MortarType::Lower: 41 0 : return (_u_primary[_qp] - _u_secondary[_qp]) * _test[_i][_qp]; 42 0 : default: 43 0 : return 0; 44 : } 45 : } 46 : 47 : Real 48 0 : OldEqualValueConstraint::computeQpJacobian(Moose::ConstraintJacobianType jacobian_type, 49 : unsigned int jvar) 50 : { 51 : typedef Moose::ConstraintJacobianType JType; 52 : 53 0 : switch (jacobian_type) 54 : { 55 0 : case JType::SecondaryLower: 56 0 : if (jvar == _var->number()) 57 0 : return -(*_phi)[_j][_qp] * _test_secondary[_i][_qp]; 58 0 : break; 59 : 60 0 : case JType::PrimaryLower: 61 0 : if (jvar == _var->number()) 62 0 : return (*_phi)[_j][_qp] * _test_primary[_i][_qp]; 63 0 : break; 64 : 65 0 : case JType::LowerSecondary: 66 0 : if (jvar == _secondary_var.number()) 67 0 : return -(*_phi)[_j][_qp] * _test[_i][_qp]; 68 0 : break; 69 : 70 0 : case JType::LowerPrimary: 71 0 : if (jvar == _primary_var.number()) 72 0 : return (*_phi)[_j][_qp] * _test[_i][_qp]; 73 0 : break; 74 : 75 0 : default: 76 0 : return 0; 77 : } 78 : 79 0 : return 0; 80 : }