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 "CartesianMortarMechanicalContact.h" 11 : 12 : registerMooseObject("ContactApp", CartesianMortarMechanicalContact); 13 : 14 : InputParameters 15 408 : CartesianMortarMechanicalContact::validParams() 16 : { 17 408 : InputParameters params = ADMortarLagrangeConstraint::validParams(); 18 : 19 816 : MooseEnum component("x=0 y=1 z=2"); 20 816 : params.addRequiredParam<MooseEnum>( 21 : "component", component, "The force component constraint that this object is supplying"); 22 408 : params.addClassDescription( 23 : "This class is used to apply normal contact forces using lagrange multipliers"); 24 408 : params.set<bool>("compute_lm_residual") = false; 25 408 : return params; 26 408 : } 27 : 28 204 : CartesianMortarMechanicalContact::CartesianMortarMechanicalContact( 29 204 : const InputParameters & parameters) 30 408 : : ADMortarLagrangeConstraint(parameters), _component(getParam<MooseEnum>("component")) 31 : { 32 204 : } 33 : 34 : ADReal 35 13752304 : CartesianMortarMechanicalContact::computeQpResidual(Moose::MortarType type) 36 : { 37 13752304 : switch (type) 38 : { 39 6876152 : case Moose::MortarType::Secondary: 40 6876152 : return _test_secondary[_i][_qp] * _lambda[_qp]; 41 : 42 6876152 : case Moose::MortarType::Primary: 43 13752304 : return -_test_primary[_i][_qp] * _lambda[_qp]; 44 : 45 0 : default: 46 0 : return 0; 47 : } 48 : }