https://mooseframework.inl.gov
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SolutionInvalidInterface Class Reference

An interface that allows the marking of invalid solutions during a solve. More...

#include <SolutionInvalidInterface.h>

Inheritance diagram for SolutionInvalidInterface:
[legend]

Public Member Functions

 SolutionInvalidInterface (MooseObject *const moose_object)
 

Protected Member Functions

template<bool warning>
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 Set solution invalid mark for the given solution ID. More...
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 

Private Attributes

MooseObject_si_moose_object
 The MooseObject that owns this interface. More...
 
FEProblemBase_si_problem
 A reference to FEProblem base. More...
 

Detailed Description

An interface that allows the marking of invalid solutions during a solve.

Definition at line 37 of file SolutionInvalidInterface.h.

Constructor & Destructor Documentation

◆ SolutionInvalidInterface()

SolutionInvalidInterface::SolutionInvalidInterface ( MooseObject *const  moose_object)

Definition at line 17 of file SolutionInvalidInterface.C.

18  : _si_moose_object(*moose_object),
21 {
22 }
FEProblemBase & _si_problem
A reference to FEProblem base.
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.
MooseObject & _si_moose_object
The MooseObject that owns this interface.

Member Function Documentation

◆ flagInvalidSolutionInternal()

template<bool warning>
template void SolutionInvalidInterface::flagInvalidSolutionInternal< false > ( const InvalidSolutionID  invalid_solution_id) const
protected

Set solution invalid mark for the given solution ID.

Definition at line 27 of file SolutionInvalidInterface.C.

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 }
FEProblemBase & _si_problem
A reference to FEProblem base.
void printDebug(InvalidSolutionID _invalid_solution_id) const
Immediately print the section and message for debug purpose.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:45
SolutionInvalidity & solutionInvalidity()
Get the SolutionInvalidity for this app.
Definition: MooseApp.h:167
SolutionInvalidityRegistry & getSolutionInvalidityRegistry()
Get the global SolutionInvalidityRegistry singleton.
MooseObject & _si_moose_object
The MooseObject that owns this interface.
bool immediatelyPrintInvalidSolution() const
Whether or not the solution invalid warnings are printed out immediately.

◆ registerInvalidSolutionInternal()

InvalidSolutionID SolutionInvalidInterface::registerInvalidSolutionInternal ( const std::string &  message,
const bool  warning 
) const
protected

Definition at line 41 of file SolutionInvalidInterface.C.

43 {
45  _si_moose_object.type(), message, warning);
46 }
InvalidSolutionID registerInvalidity(const std::string &object_type, const std::string &message, const bool warning)
Call to register an invalid calculation.
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
SolutionInvalidityRegistry & getSolutionInvalidityRegistry()
Get the global SolutionInvalidityRegistry singleton.
MooseObject & _si_moose_object
The MooseObject that owns this interface.

Member Data Documentation

◆ _si_moose_object

MooseObject& SolutionInvalidInterface::_si_moose_object
private

The MooseObject that owns this interface.

Definition at line 52 of file SolutionInvalidInterface.h.

Referenced by flagInvalidSolutionInternal(), and registerInvalidSolutionInternal().

◆ _si_problem

FEProblemBase& SolutionInvalidInterface::_si_problem
private

A reference to FEProblem base.

Definition at line 55 of file SolutionInvalidInterface.h.

Referenced by flagInvalidSolutionInternal().


The documentation for this class was generated from the following files: