www.mooseframework.org
Problem.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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;
19 class Problem : public MooseObject, public PerfGraphInterface
20 {
21 public:
23 
25  virtual ~Problem();
26 
27  virtual void init() = 0;
28 
32  void _setCLIOption() { _cli_option_found = true; }
33 
37  virtual void terminateSolve() { _termination_requested = true; };
38 
43  virtual bool isSolveTerminationRequested() const { return _termination_requested; };
44 
48  const ConsoleStream & console() const { return _console; }
49 
50 protected:
53 
56 
59 };
virtual void init()=0
A helper class for re-directing output streams to Console output objects form MooseObjects.
Definition: ConsoleStream.h:30
Problem(const InputParameters &parameters)
Definition: Problem.C:23
bool _cli_option_found
True if the CLI option is found.
Definition: Problem.h:52
virtual ~Problem()
Definition: Problem.C:32
static InputParameters validParams()
Definition: Problem.C:15
Class that hold the whole problem being solved.
Definition: Problem.h:19
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual bool isSolveTerminationRequested() const
Check of termination has been requested.
Definition: Problem.h:43
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:33
virtual void terminateSolve()
Allow objects to request clean termination of the solve.
Definition: Problem.h:37
Interface for objects interacting with the PerfGraph.
const ConsoleStream & console() const
Return console handle.
Definition: Problem.h:48
const InputParameters & parameters() const
Get the parameters of the object.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
bool _termination_requested
True if termination of the solve has been requested.
Definition: Problem.h:58
void _setCLIOption()
For Internal Use.
Definition: Problem.h:32
bool _color_output
True if we're going to attempt to write color output.
Definition: Problem.h:55