www.mooseframework.org
SolutionHistory.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 // MOOSE includes
16 #include "SolutionHistory.h"
17 #include "NonlinearSystemBase.h"
18 #include "FEProblem.h"
19 
20 #include <fstream>
21 
22 template <>
25 {
26  // Get the parameters from the parent object
28 
29  // Return the parameters
30  return params;
31 }
32 
33 SolutionHistory::SolutionHistory(const InputParameters & parameters) : FileOutput(parameters) {}
34 
35 std::string
37 {
38  return _file_base + ".slh";
39 }
40 
41 void
43 {
44  // Reference to the Non-linear System
46 
47  std::ofstream slh_file;
48  slh_file.open(filename().c_str(), std::ios::app);
49  slh_file << nl_sys._current_nl_its;
50 
51  for (const auto & linear_its : nl_sys._current_l_its)
52  slh_file << " " << linear_its;
53 
54  slh_file << std::endl;
55 }
InputParameters validParams< SolutionHistory >()
NonlinearSystemBase & getNonlinearSystemBase()
SolutionHistory(const InputParameters &parameters)
Class constructor.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::string _file_base
The base filename from the input paramaters.
Definition: FileOutput.h:87
Nonlinear system to be solved.
std::vector< unsigned int > _current_l_its
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
Definition: Output.h:171
virtual void output(const ExecFlagType &type) override
Output the data to *.slh file.
virtual std::string filename() override
The filename for the output file.
InputParameters validParams< FileOutput >()
Definition: FileOutput.C:28
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
An outputter with filename support.
Definition: FileOutput.h:32