Interface class for producing errors, warnings, or just quiet NaNs. More...
#include <NaNInterface.h>
Public Member Functions | |
NaNInterface (const MooseObject *moose_object) | |
Static Public Member Functions | |
static InputParameters | validParams () |
Protected Types | |
enum | NaNMessage { NAN_MESSAGE_NONE = 0, NAN_MESSAGE_WARNING = 1, NAN_MESSAGE_EXCEPTION = 2, NAN_MESSAGE_ERROR = 3 } |
Protected Member Functions | |
Real | getNaN () const |
Throws an error or returns a NaN with or without a warning, with a default message. More... | |
std::vector< Real > | getNaNVector (const unsigned int &n) const |
Throws an error or returns NaNs with or without a warning, with a default message. More... | |
template<typename... Args> | |
Real | getNaN (Args &&... args) const |
Throws an error or returns a NaN with or without a warning. More... | |
template<typename... Args> | |
std::vector< Real > | getNaNVector (const unsigned int &n, Args &&... args) const |
Throws an error or returns NaNs with or without a warning. More... | |
Protected Attributes | |
const MooseObject *const | _moose_object |
enum NaNMessage | _emit_on_nan |
Raise mooseWarning or mooseError? More... | |
Interface class for producing errors, warnings, or just quiet NaNs.
For some objects it is desirable to continue running despite generation of NaN(s). This class provides an interface for choosing whether to throw an error, a warning, or nothing at all, just using a quiet NaN.
Definition at line 22 of file NaNInterface.h.
|
protected |
Enumerator | |
---|---|
NAN_MESSAGE_NONE | |
NAN_MESSAGE_WARNING | |
NAN_MESSAGE_EXCEPTION | |
NAN_MESSAGE_ERROR |
Definition at line 30 of file NaNInterface.h.
NaNInterface::NaNInterface | ( | const MooseObject * | moose_object | ) |
Definition at line 35 of file NaNInterface.C.
|
inlineprotected |
Throws an error or returns a NaN with or without a warning, with a default message.
Definition at line 46 of file NaNInterface.h.
Referenced by StiffenedGasFluidProperties::c_from_v_e(), CaloricallyImperfectGas::c_from_v_e(), ADNumericalFlux3EqnHLLC::calcFlux(), getNaN(), NaNInterfaceTestFluidProperties::p_from_v_e(), CaloricallyImperfectGas::p_from_v_e(), IdealGasFluidProperties::p_from_v_e(), StiffenedGasFluidProperties::rho_from_p_s(), StiffenedGasFluidProperties::s_from_h_p(), IdealGasFluidProperties::s_from_h_p(), IdealGasFluidProperties::s_from_p_T(), IdealGasFluidProperties::s_from_v_e(), CaloricallyImperfectGas::T_from_v_e(), and IdealRealGasMixtureFluidProperties::xs_prim_from_p_T().
|
inlineprotected |
Throws an error or returns a NaN with or without a warning.
Definition at line 62 of file NaNInterface.h.
Throws an error or returns NaNs with or without a warning, with a default message.
[in] | n | Vector size |
Definition at line 53 of file NaNInterface.h.
Referenced by NaNInterfaceTestFluidProperties::returnNaNVector().
|
inlineprotected |
Throws an error or returns NaNs with or without a warning.
[in] | n | Vector size |
Definition at line 88 of file NaNInterface.h.
|
static |
Definition at line 15 of file NaNInterface.C.
Referenced by define_mass_specific_prop_from_p_T(), define_mass_specific_prop_from_T_v(), NaNInterfaceTestFluidProperties::validParams(), StiffenedGasFluidProperties::validParams(), IdealGasFluidProperties::validParams(), CaloricallyImperfectGas::validParams(), ADNumericalFlux3EqnHLLC::validParams(), and StiffenedGasTwoPhaseFluidProperties::validParams().
|
protected |
Raise mooseWarning or mooseError?
Definition at line 41 of file NaNInterface.h.
Referenced by getNaN(), and getNaNVector().
|
protected |
Definition at line 38 of file NaNInterface.h.
Referenced by getNaN(), and getNaNVector().