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 "LMWeightedVelocitiesUserObject.h" 11 : #include "MooseVariableFE.h" 12 : #include "SystemBase.h" 13 : 14 : registerMooseObject("ContactApp", LMWeightedVelocitiesUserObject); 15 : 16 : InputParameters 17 478 : LMWeightedVelocitiesUserObject::validParams() 18 : { 19 478 : InputParameters params = WeightedVelocitiesUserObject::validParams(); 20 478 : params += LMWeightedGapUserObject::newParams(); 21 478 : params.addClassDescription("Provides the mortar contact Lagrange multipliers (normal and " 22 : "tangential) for constraint enforcement."); 23 956 : params.renameCoupledVar("lm_variable", "lm_variable_normal", ""); 24 956 : params.addRequiredCoupledVar( 25 : "lm_variable_tangential_one", 26 : "The Lagrange multiplier variable representing the tangential contact pressure along the " 27 : "first tangential direction (the only one in two dimensions)."); 28 956 : params.addCoupledVar("lm_variable_tangential_two", 29 : "The Lagrange multiplier variable representing the tangential contact " 30 : "pressure along the second tangential direction."); 31 478 : return params; 32 0 : } 33 : 34 239 : LMWeightedVelocitiesUserObject::LMWeightedVelocitiesUserObject(const InputParameters & parameters) 35 : : WeightedGapUserObject(parameters), 36 : WeightedVelocitiesUserObject(parameters), 37 : LMWeightedGapUserObject(parameters), 38 239 : _lm_variable_tangential_one(getVar("lm_variable_tangential_one", 0)), 39 239 : _lm_variable_tangential_two(isParamValid("lm_variable_tangential_two") 40 312 : ? getVar("lm_variable_tangential_two", 0) 41 239 : : nullptr) 42 : { 43 : // Check that user inputted a variable 44 239 : checkInput(_lm_variable_tangential_one, "lm_variable_tangential_one"); 45 239 : if (_lm_variable_tangential_two) 46 146 : checkInput(_lm_variable_tangential_two, "lm_variable_tangential_two"); 47 : 48 : // Check that user inputted the right type of variable 49 239 : verifyLagrange(*_lm_variable_tangential_one, "lm_variable_tangential_one"); 50 239 : if (_lm_variable_tangential_two) 51 146 : verifyLagrange(*_lm_variable_tangential_two, "lm_variable_tangential_two"); 52 239 : } 53 : 54 : const ADVariableValue & 55 66318160 : LMWeightedVelocitiesUserObject::contactTangentialPressureDirOne() const 56 : { 57 66318160 : return _lm_variable_tangential_one->adSlnLower(); 58 : } 59 : 60 : const ADVariableValue & 61 62492256 : LMWeightedVelocitiesUserObject::contactTangentialPressureDirTwo() const 62 : { 63 62492256 : return _lm_variable_tangential_two->adSlnLower(); 64 : }