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 "GetPostprocessorChainControl.h" 11 : 12 : registerMooseObject("MooseApp", GetPostprocessorChainControl); 13 : 14 : InputParameters 15 14337 : GetPostprocessorChainControl::validParams() 16 : { 17 14337 : InputParameters params = ChainControl::validParams(); 18 14337 : params.addRequiredParam<PostprocessorName>("postprocessor", "Post-processor name"); 19 43011 : params.addParam<bool>( 20 : "name_data_same_as_postprocessor", 21 28674 : false, 22 : "If true, name the new control data to be the same as the post-processor name; otherwise " 23 : "name as '<control>:value', where '<control>' is the name of this control object."); 24 14337 : params.addClassDescription("Copies a post-processor value into a ChainControlData."); 25 14337 : return params; 26 0 : } 27 : 28 36 : GetPostprocessorChainControl::GetPostprocessorChainControl(const InputParameters & parameters) 29 : : ChainControl(parameters), 30 72 : _value(getParam<bool>("name_data_same_as_postprocessor") 31 48 : ? declareChainControlData<Real>(getParam<PostprocessorName>("postprocessor"), false) 32 36 : : declareChainControlData<Real>("value")), 33 72 : _pp_value(getPostprocessorValue("postprocessor")) 34 : { 35 36 : } 36 : 37 : void 38 652 : GetPostprocessorChainControl::execute() 39 : { 40 652 : _value = _pp_value; 41 652 : }