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 "NumFixedPointIterations.h" 12 : #include "MooseApp.h" 13 : #include "Executioner.h" 14 : 15 : registerMooseObject("MooseApp", NumFixedPointIterations); 16 : registerMooseObjectRenamed("MooseApp", 17 : NumPicardIterations, 18 : "06/30/2021 24:00", 19 : NumFixedPointIterations); 20 : 21 : InputParameters 22 30628 : NumFixedPointIterations::validParams() 23 : { 24 30628 : InputParameters params = GeneralPostprocessor::validParams(); 25 30628 : params.addClassDescription( 26 : "Returns the number of fixed point iterations taken by the executioner."); 27 91884 : params.addParam<bool>("get_index_instead_of_count", 28 61256 : false, 29 : "If true, get the current fixed point iteration index instead of the " 30 : "number of fixed point iterations taken, shifting by -1"); 31 30628 : return params; 32 0 : } 33 : 34 1047 : NumFixedPointIterations::NumFixedPointIterations(const InputParameters & parameters) 35 : : GeneralPostprocessor(parameters), 36 1047 : _count_shift(getParam<bool>("get_index_instead_of_count") ? -1 : 0) 37 : { 38 1047 : } 39 : 40 : Real 41 49054 : NumFixedPointIterations::getValue() const 42 : { 43 49054 : return _app.getExecutioner()->fixedPointSolve().numFixedPointIts() + _count_shift; 44 : }