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 : #pragma once 11 : 12 : #include "WeightedGapUserObject.h" 13 : 14 : template <typename> 15 : class MooseVariableFE; 16 : 17 : /** 18 : * User object for computing weighted gaps and contact pressure for Lagrange multipler based 19 : * mortar constraints 20 : */ 21 : class LMWeightedGapUserObject : virtual public WeightedGapUserObject 22 : { 23 : public: 24 : static InputParameters validParams(); 25 : /** 26 : * New parameters that this sub-class introduces 27 : */ 28 : static InputParameters newParams(); 29 : 30 : LMWeightedGapUserObject(const InputParameters & parameters); 31 : 32 : virtual const ADVariableValue & contactPressure() const override; 33 2289590 : virtual void reinit() override {} 34 : virtual Real getNormalContactPressure(const Node * const /*node*/) const override; 35 : 36 : protected: 37 : virtual const VariableTestValue & test() const override; 38 235365 : virtual bool constrainedByOwner() const override { return true; } 39 : 40 : /** 41 : * Check user input validity for provided variable 42 : */ 43 : void checkInput(const MooseVariable * const var, const std::string & var_name) const; 44 : 45 : /** 46 : * Verify that the provided variables have degrees of freedom at nodes 47 : */ 48 : void verifyLagrange(const MooseVariable & var, const std::string & var_name) const; 49 : 50 : /// The Lagrange multiplier variable representing the contact pressure 51 : const MooseVariableFE<Real> * const _lm_var; 52 : 53 : /// Whether to use Petrov-Galerkin approach 54 : const bool _use_petrov_galerkin; 55 : 56 : /// The auxiliary Lagrange multiplier variable (used together whith the Petrov-Galerkin approach) 57 : const MooseVariable * const _aux_lm_var; 58 : };