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 770 : LMWeightedVelocitiesUserObject::validParams() 18 : { 19 770 : InputParameters params = WeightedVelocitiesUserObject::validParams(); 20 770 : params += LMWeightedGapUserObject::newParams(); 21 770 : params.addClassDescription("Provides the mortar contact Lagrange multipliers (normal and " 22 : "tangential) for constraint enforcement."); 23 1540 : params.renameCoupledVar("lm_variable", "lm_variable_normal", ""); 24 1540 : 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 1540 : params.addCoupledVar("lm_variable_tangential_two", 29 : "The Lagrange multiplier variable representing the tangential contact " 30 : "pressure along the second tangential direction."); 31 770 : return params; 32 0 : } 33 : 34 385 : LMWeightedVelocitiesUserObject::LMWeightedVelocitiesUserObject(const InputParameters & parameters) 35 : : WeightedGapUserObject(parameters), 36 : WeightedVelocitiesUserObject(parameters), 37 : LMWeightedGapUserObject(parameters), 38 385 : _lm_variable_tangential_one(getVar("lm_variable_tangential_one", 0)), 39 385 : _lm_variable_tangential_two(isParamValid("lm_variable_tangential_two") 40 480 : ? getVar("lm_variable_tangential_two", 0) 41 385 : : nullptr) 42 : { 43 : // Check that user inputted a variable 44 385 : checkInput(_lm_variable_tangential_one, "lm_variable_tangential_one"); 45 385 : if (_lm_variable_tangential_two) 46 190 : checkInput(_lm_variable_tangential_two, "lm_variable_tangential_two"); 47 : 48 : // Check that user inputted the right type of variable 49 385 : verifyLagrange(*_lm_variable_tangential_one, "lm_variable_tangential_one"); 50 385 : if (_lm_variable_tangential_two) 51 190 : verifyLagrange(*_lm_variable_tangential_two, "lm_variable_tangential_two"); 52 385 : } 53 : 54 : const ADVariableValue & 55 79121584 : LMWeightedVelocitiesUserObject::contactTangentialPressureDirOne() const 56 : { 57 79121584 : return _lm_variable_tangential_one->adSlnLower(); 58 : } 59 : 60 : const ADVariableValue & 61 73771008 : LMWeightedVelocitiesUserObject::contactTangentialPressureDirTwo() const 62 : { 63 73771008 : return _lm_variable_tangential_two->adSlnLower(); 64 : }