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 : // MOOSE includes 11 : #include "AddBoundsVectorsAction.h" 12 : #include "FEProblem.h" 13 : #include "NonlinearSystemBase.h" 14 : 15 : registerMooseAction("MooseApp", AddBoundsVectorsAction, "add_bounds_vectors"); 16 : 17 : InputParameters 18 402 : AddBoundsVectorsAction::validParams() 19 : { 20 402 : InputParameters params = Action::validParams(); 21 402 : params.addClassDescription( 22 : "Action to add vectors to nonlinear system when using the Bounds syntax."); 23 402 : return params; 24 0 : } 25 : 26 198 : AddBoundsVectorsAction::AddBoundsVectorsAction(const InputParameters & params) : Action(params) {} 27 : 28 : void 29 198 : AddBoundsVectorsAction::act() 30 : { 31 198 : if (!_problem->numNonlinearSystems() && _problem->numLinearSystems()) 32 0 : mooseError("Vector bounds cannot be used with only LinearSystems!"); 33 : 34 198 : _problem->getNonlinearSystemBase(/*nl_sys=*/0).addVector("lower_bound", false, libMesh::GHOSTED); 35 198 : _problem->getNonlinearSystemBase(/*nl_sys=*/0).addVector("upper_bound", false, libMesh::GHOSTED); 36 198 : }