Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
SolutionInvalidInterface.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 
10 // MOOSE includes
12 #include "MooseObject.h"
13 #include "MooseApp.h"
14 #include "FEProblemBase.h"
16 
18  : _si_moose_object(*moose_object),
19  _si_problem(
20  *_si_moose_object.parameters().getCheckedPointerParam<FEProblemBase *>("_fe_problem_base"))
21 {
22 }
23 
25 template <bool warning>
26 void
28  const InvalidSolutionID invalid_solution_id) const
29 {
30  mooseAssert(
31  warning == moose::internal::getSolutionInvalidityRegistry().item(invalid_solution_id).warning,
32  "Inconsistent warning flag");
33  auto & solution_invalidity = _si_moose_object.getMooseApp().solutionInvalidity();
34  if constexpr (!warning)
36  solution_invalidity.printDebug(invalid_solution_id);
37  return solution_invalidity.flagInvalidSolutionInternal(invalid_solution_id);
38 }
39 
42  const bool warning) const
43 {
45  _si_moose_object.type(), message, warning);
46 }
47 
48 template void SolutionInvalidInterface::flagInvalidSolutionInternal<true>(
49  const InvalidSolutionID invalid_solution_id) const;
50 template void SolutionInvalidInterface::flagInvalidSolutionInternal<false>(
51  const InvalidSolutionID invalid_solution_id) const;
unsigned int InvalidSolutionID
Definition: MooseTypes.h:213
FEProblemBase & _si_problem
A reference to FEProblem base.
void printDebug(InvalidSolutionID _invalid_solution_id) const
Immediately print the section and message for debug purpose.
InvalidSolutionID registerInvalidity(const std::string &object_type, const std::string &message, const bool warning)
Call to register an invalid calculation.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:45
InvalidSolutionID registerInvalidSolutionInternal(const std::string &message, const bool warning) const
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
SolutionInvalidity & solutionInvalidity()
Get the SolutionInvalidity for this app.
Definition: MooseApp.h:167
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
SolutionInvalidityRegistry & getSolutionInvalidityRegistry()
Get the global SolutionInvalidityRegistry singleton.
void flagInvalidSolutionInternal(const InvalidSolutionID invalid_solution_id) const
Set solution invalid mark for the given solution ID.
MooseObject & _si_moose_object
The MooseObject that owns this interface.
SolutionInvalidInterface(MooseObject *const moose_object)
bool immediatelyPrintInvalidSolution() const
Whether or not the solution invalid warnings are printed out immediately.