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 328 : AugmentedLagrangianContactProblemTempl<T>::validParams() 38 : { 39 328 : InputParameters params = T::validParams(); 40 328 : params += AugmentedLagrangianContactProblemInterface::validParams(); 41 328 : params.addClassDescription("Manages nested solution for augmented Lagrange contact"); 42 328 : return params; 43 0 : } 44 : 45 : template <class T> 46 164 : AugmentedLagrangianContactProblemTempl<T>::AugmentedLagrangianContactProblemTempl( 47 : const InputParameters & params) 48 164 : : T(params), AugmentedLagrangianContactProblemInterface(params) 49 : { 50 164 : } 51 : 52 : template <class T> 53 : void 54 165 : AugmentedLagrangianContactProblemTempl<T>::timestepSetup() 55 : { 56 165 : _lagrangian_iteration_number = 0; 57 165 : T::timestepSetup(); 58 165 : } 59 : 60 : template <> 61 : void 62 151 : AugmentedLagrangianContactProblemTempl<ReferenceResidualProblem>::addDefaultNonlinearConvergence( 63 : const InputParameters & params_to_apply) 64 : { 65 151 : std::string class_name = "AugmentedLagrangianContactReferenceConvergence"; 66 151 : InputParameters params = this->_factory.getValidParams(class_name); 67 151 : params.applyParameters(params_to_apply); 68 151 : params.applyParameters(parameters()); 69 151 : params.set<bool>("added_as_default") = true; 70 : // TODO: Add multi-nonlinear system support 71 151 : if (this->numNonlinearSystems() > 1) 72 0 : mooseError("Multi-system not currently implemented"); 73 151 : this->addConvergence(class_name, this->getNonlinearConvergenceNames()[0], params); 74 302 : } 75 : 76 : template <> 77 : void 78 13 : AugmentedLagrangianContactProblemTempl<FEProblem>::addDefaultNonlinearConvergence( 79 : const InputParameters & params_to_apply) 80 : { 81 13 : std::string class_name = "AugmentedLagrangianContactFEProblemConvergence"; 82 13 : InputParameters params = _factory.getValidParams(class_name); 83 13 : params.applyParameters(params_to_apply); 84 13 : params.applyParameters(parameters()); 85 13 : params.set<bool>("added_as_default") = true; 86 : // TODO: Add multi-nonlinear system support 87 13 : if (this->numNonlinearSystems() > 1) 88 0 : mooseError("Multi-system not currently implemented"); 89 13 : this->addConvergence(class_name, this->getNonlinearConvergenceNames()[0], params); 90 26 : } 91 : 92 : template class AugmentedLagrangianContactProblemTempl<ReferenceResidualProblem>; 93 : template class AugmentedLagrangianContactProblemTempl<FEProblem>;