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 : #pragma once 11 : 12 : #include "MooseObject.h" 13 : #include "PerfGraphInterface.h" 14 : 15 : class TimePeriodOld; 16 : /** 17 : * Class that hold the whole problem being solved. 18 : */ 19 : class Problem : public MooseObject, public PerfGraphInterface 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : 24 : Problem(const InputParameters & parameters); 25 : virtual ~Problem(); 26 : 27 : virtual void init() = 0; 28 : 29 : /** 30 : * For Internal Use 31 : */ 32 : void _setCLIOption() { _cli_option_found = true; } 33 : 34 : /** 35 : * Allow objects to request clean termination of the solve 36 : */ 37 31 : virtual void terminateSolve() { _termination_requested = true; }; 38 : 39 : /** 40 : * Check of termination has been requested. This should be called by 41 : * transient Executioners in the keepGoing() member. 42 : */ 43 182265 : virtual bool isSolveTerminationRequested() const { return _termination_requested; }; 44 : 45 : /** 46 : * Return console handle 47 : */ 48 4560369 : const ConsoleStream & console() const { return _console; } 49 : 50 : protected: 51 : /// True if the CLI option is found 52 : bool _cli_option_found; 53 : 54 : /// True if we're going to attempt to write color output 55 : bool _color_output; 56 : 57 : /// True if termination of the solve has been requested 58 : bool _termination_requested; 59 : };