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 "AugmentedLagrangianContactProblem.h" 11 : 12 : // MOOSE includes 13 : #include "AuxiliarySystem.h" 14 : #include "DisplacedProblem.h" 15 : #include "MooseApp.h" 16 : #include "MooseMesh.h" 17 : #include "MooseVariable.h" 18 : #include "NearestNodeLocator.h" 19 : #include "NonlinearSystem.h" 20 : #include "PenetrationLocator.h" 21 : 22 : #include "SystemBase.h" 23 : #include "Assembly.h" 24 : #include "Executioner.h" 25 : #include "AddVariableAction.h" 26 : #include "ConstraintWarehouse.h" 27 : #include "MortarUserObject.h" 28 : #include "AugmentedLagrangeInterface.h" 29 : #include "AugmentedLagrangianContactConvergence.h" 30 : #include "Convergence.h" 31 : 32 : registerMooseObject("ContactApp", AugmentedLagrangianContactProblem); 33 : registerMooseObject("ContactApp", AugmentedLagrangianContactFEProblem); 34 : 35 : template <class T> 36 : InputParameters 37 500 : AugmentedLagrangianContactProblemTempl<T>::validParams() 38 : { 39 500 : InputParameters params = T::validParams(); 40 500 : params += AugmentedLagrangianContactProblemInterface::validParams(); 41 500 : params.addClassDescription("Manages nested solution for augmented Lagrange contact"); 42 500 : return params; 43 0 : } 44 : 45 : template <class T> 46 250 : AugmentedLagrangianContactProblemTempl<T>::AugmentedLagrangianContactProblemTempl( 47 : const InputParameters & params) 48 250 : : T(params), AugmentedLagrangianContactProblemInterface(params) 49 : { 50 250 : } 51 : 52 : template <class T> 53 : void 54 179 : AugmentedLagrangianContactProblemTempl<T>::timestepSetup() 55 : { 56 179 : _lagrangian_iteration_number = 0; 57 179 : T::timestepSetup(); 58 179 : } 59 : 60 : template <> 61 : void 62 214 : AugmentedLagrangianContactProblemTempl<ReferenceResidualProblem>::addDefaultNonlinearConvergence( 63 : const InputParameters & params_to_apply) 64 : { 65 214 : std::string class_name = "AugmentedLagrangianContactReferenceConvergence"; 66 214 : InputParameters params = this->_factory.getValidParams(class_name); 67 214 : params.applyParameters(params_to_apply); 68 214 : params.applyParameters(parameters()); 69 214 : params.set<bool>("added_as_default") = true; 70 : // TODO: Add multi-nonlinear system support 71 214 : if (this->numNonlinearSystems() > 1) 72 0 : mooseError("Multi-system not currently implemented"); 73 214 : this->addConvergence(class_name, this->getNonlinearConvergenceNames()[0], params); 74 428 : } 75 : 76 : template <> 77 : void 78 36 : AugmentedLagrangianContactProblemTempl<FEProblem>::addDefaultNonlinearConvergence( 79 : const InputParameters & params_to_apply) 80 : { 81 36 : std::string class_name = "AugmentedLagrangianContactFEProblemConvergence"; 82 36 : InputParameters params = _factory.getValidParams(class_name); 83 36 : params.applyParameters(params_to_apply); 84 36 : params.applyParameters(parameters()); 85 36 : params.set<bool>("added_as_default") = true; 86 : // TODO: Add multi-nonlinear system support 87 36 : if (this->numNonlinearSystems() > 1) 88 0 : mooseError("Multi-system not currently implemented"); 89 36 : this->addConvergence(class_name, this->getNonlinearConvergenceNames()[0], params); 90 72 : } 91 : 92 : template class AugmentedLagrangianContactProblemTempl<ReferenceResidualProblem>; 93 : template class AugmentedLagrangianContactProblemTempl<FEProblem>;