https://mooseframework.inl.gov
ExodusOptimizationSteady.C
Go to the documentation of this file.
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 
11 
13 
16 {
17  // Get the base class parameters
19  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
20 
21  // Return the InputParameters
22  return params;
23 }
24 
26  : Exodus(parameters), _steady_exec(dynamic_cast<Steady *>(_app.getExecutioner()))
27 {
28  if (!_steady_exec)
29  mooseError(
30  "ExodusOptimizationSteady output can only be used with the SteadyAndAdjoint or Steady"
31  "executioners to output a per-optimization iteration solution.");
32 }
33 
34 void
36 {
38  _file_num++;
39 
41 
42  if (_exodus_num == 1)
43  _exodus_io_ptr->append(false);
44  else
45  _exodus_io_ptr->append(true);
46 }
47 
48 Real
50 {
52 }
registerMooseObject("OptimizationApp", ExodusOptimizationSteady)
std::unique_ptr< libMesh::ExodusII_IO > _exodus_io_ptr
T & set(const std::string &name, bool quiet_mode=false)
ExodusOptimizationSteady(const InputParameters &parameters)
Class constructor.
const ExecFlagType EXEC_TIMESTEP_END
static InputParameters validParams()
const Steady *const _steady_exec
For steady (and steady and adjoint) executioner.
static InputParameters validParams()
bool & _exodus_mesh_changed
virtual Real getOutputTime() override
Get time for output (i.e.
unsigned int & _exodus_num
bool _sequence
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void customizeFileOutput() override
Customize file output with steady and adjoint iteration number.
void mooseError(Args &&... args) const
unsigned int & _file_num
virtual unsigned int getIterationNumberOutput() const
Class for output data to the ExodusII format.