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 "Executioner.h" 13 : 14 : // System includes 15 : #include <string> 16 : 17 : // Forward declarations 18 : class InputParameters; 19 : class FEProblemBase; 20 : 21 : /** 22 : * A base class that can be used for executioners solving for steady state problems. 23 : */ 24 : class SteadyBase : public Executioner 25 : { 26 : public: 27 : static InputParameters validParams(); 28 : 29 : /** 30 : * Constructor 31 : * 32 : * @param parameters The parameters object holding data for the class to use. 33 : * @return Whether or not the solve was successful. 34 : */ 35 : SteadyBase(const InputParameters & parameters); 36 : 37 : virtual void execute() override; 38 53090 : virtual bool lastSolveConverged() const override { return _last_solve_converged; } 39 : 40 : /** 41 : * Get a general iteration number for the purpose of outputting, useful in the presence of a 42 : * nested solve This output iteration number may be set by the parent app for a sub-app. This 43 : * behavior is decided by the Executioner/Executor/SolveObject in charge of the solve. 44 : */ 45 0 : virtual unsigned int getIterationNumberOutput() const { return _output_iteration_number; } 46 : 47 : /** 48 : * Set a general iteration number for the purpose of outputting, useful in the presence of a 49 : * nested solve This output iteration number may be set by the parent app for a sub-app, e.g. 50 : * OptimizeSolve. 51 : */ 52 0 : virtual void setIterationNumberOutput(unsigned int iteration_number) 53 : { 54 0 : _output_iteration_number = iteration_number; 55 0 : } 56 : 57 : protected: 58 : /// Just an alias for now 59 : FEProblemBase & _problem; 60 : 61 : /// The system time 62 : Real _system_time; 63 : 64 : /// The time step index 65 : int & _time_step; 66 : 67 : /// The current time 68 : Real & _time; 69 : 70 : /// Iteration number obtained from the main application 71 : unsigned int _output_iteration_number; 72 : 73 : private: 74 : /// Flag showing if the last solve converged 75 : bool _last_solve_converged; 76 : };