www.mooseframework.org
CheckIntegrityAction.C
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 #include "CheckIntegrityAction.h"
11 #include "ActionWarehouse.h"
12 #include "FEProblem.h"
13 
14 registerMooseAction("MooseApp", CheckIntegrityAction, "check_integrity");
15 registerMooseAction("MooseApp", CheckIntegrityAction, "check_integrity_early");
16 
17 template <>
20 {
22  return params;
23 }
24 
26 
27 void
29 {
30  if (_current_task == "check_integrity_early")
31  {
32  if (!_app.getExecutioner())
33  mooseError("\"Executioner\" does not exist, make sure your input file contains an "
34  "[Executioner] block or your simulation adds an Executioner through an Action.");
35 
36  // This situation shouldn't be possible due to "determine_system_type" and/or autobuild.
37  if (!_problem)
38  mooseError("Your simulation does not contain a \"Problem\", which ironically means that YOU "
39  "have a problem...");
40  }
41  else
42  {
44 
45  mooseAssert(_problem, "Problem doesn't exist");
46  _problem->checkProblemIntegrity();
47  }
48 }
void checkUnsatisfiedActions() const
This method checks the actions stored in the warehouse against the list of required registered action...
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition: MooseApp.h:255
ActionWarehouse & _awh
Reference to ActionWarehouse where we store object build by actions.
Definition: Action.h:207
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for actions.
Definition: Action.h:35
registerMooseAction("MooseApp", CheckIntegrityAction, "check_integrity")
const std::string & _current_task
The current action (even though we have seperate instances for each action)
Definition: Action.h:210
CheckIntegrityAction(InputParameters params)
InputParameters validParams< CheckIntegrityAction >()
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition: Action.h:216
MooseApp & _app
The MOOSE application this is associated with.
Definition: Action.h:183
InputParameters validParams< Action >()
Definition: Action.C:22