NOX Development
Loading...
Searching...
No Matches
LOCA::ErrorCheck Class Reference

An Error checking algorithm for NOX/LOCA routines. More...

#include <LOCA_ErrorCheck.H>

Public Types

enum  ActionType { ThrowError , PrintWarning }
 Type for the action to be taken if the ReturnType is not Ok. More...

Public Member Functions

 ErrorCheck (const Teuchos::RCP< LOCA::GlobalData > &global_data)
 Constructor.
 ~ErrorCheck ()
 Destructor.
void throwError (const std::string &callingFunction="<Unknown Method>", const std::string &message="", const std::string &throwLabel="LOCA Error")
 Generic call to throw that prints info to the screen.
void printWarning (const std::string &callingFunction="<Unknown Method>", const std::string &message="")
 Generic printing algorithm for sending warnings to the screen.
void checkReturnType (const NOX::Abstract::Group::ReturnType &status, const std::string &callingFunction=std::string("<Unknown Method>"))
 Checks the supplied return type and performs an appropriate action.
void checkReturnType (const NOX::Abstract::Group::ReturnType &status, const ActionType &action, const std::string &callingFunction=std::string("<Unknown Method>"), const std::string &message=std::string(""))
 Checks the return type for the NOX::AbstractGroup and may throw an error or print a warning to the screen based on the ActionType requested.
NOX::Abstract::Group::ReturnType combineReturnTypes (const NOX::Abstract::Group::ReturnType &status1, const NOX::Abstract::Group::ReturnType &status2)
 Combines two return types.
NOX::Abstract::Group::ReturnType combineAndCheckReturnTypes (const NOX::Abstract::Group::ReturnType &status1, const NOX::Abstract::Group::ReturnType &status2, const std::string &callingFunction=std::string("<Unknown Method>"))
 Combines two return types and checks the first.

Protected Member Functions

std::string getReturnTypeString (NOX::Abstract::Group::ReturnType status)
 Converts the NOX::Abstract::Group::ReturnType to a std::string.

Protected Attributes

Teuchos::RCP< LOCA::GlobalDataglobalData
 Global data.

Detailed Description

An Error checking algorithm for NOX/LOCA routines.

This object will check the return types on objects and print a warning or throw an error if appropriate

Member Enumeration Documentation

◆ ActionType

Type for the action to be taken if the ReturnType is not Ok.

Enumerator
ThrowError 

Throw an error.

PrintWarning 

Print a warning.

Constructor & Destructor Documentation

◆ ErrorCheck()

LOCA::ErrorCheck::ErrorCheck ( const Teuchos::RCP< LOCA::GlobalData > & global_data)

Constructor.

References globalData.

Member Function Documentation

◆ checkReturnType() [1/2]

void LOCA::ErrorCheck::checkReturnType ( const NOX::Abstract::Group::ReturnType & status,
const ActionType & action,
const std::string & callingFunction = std::string("<Unknown Method>"),
const std::string & message = std::string("") )

Checks the return type for the NOX::AbstractGroup and may throw an error or print a warning to the screen based on the ActionType requested.

References getReturnTypeString(), NOX::Abstract::Group::Ok, PrintWarning, printWarning(), ThrowError, and throwError().

◆ checkReturnType() [2/2]

void LOCA::ErrorCheck::checkReturnType ( const NOX::Abstract::Group::ReturnType & status,
const std::string & callingFunction = std::string("<Unknown Method>") )

◆ combineAndCheckReturnTypes()

NOX::Abstract::Group::ReturnType LOCA::ErrorCheck::combineAndCheckReturnTypes ( const NOX::Abstract::Group::ReturnType & status1,
const NOX::Abstract::Group::ReturnType & status2,
const std::string & callingFunction = std::string("<Unknown Method>") )

◆ combineReturnTypes()

NOX::Abstract::Group::ReturnType LOCA::ErrorCheck::combineReturnTypes ( const NOX::Abstract::Group::ReturnType & status1,
const NOX::Abstract::Group::ReturnType & status2 )

Combines two return types.

If either return type is NOX::Abstract::Group::NotDefined, returns NotDefined. Otherwise if either is BadDependcy, returns BadDependency, if either is Failed, returns Failed, if either is NotConverged, returns NotConverged, and otherwise returns Ok.

References NOX::Abstract::Group::BadDependency, NOX::Abstract::Group::Failed, NOX::Abstract::Group::NotConverged, NOX::Abstract::Group::NotDefined, and NOX::Abstract::Group::Ok.

Referenced by combineAndCheckReturnTypes().

◆ getReturnTypeString()

◆ printWarning()

void LOCA::ErrorCheck::printWarning ( const std::string & callingFunction = "<Unknown Method>",
const std::string & message = "" )

Generic printing algorithm for sending warnings to the screen.

References globalData, and NOX::Utils::Warning.

Referenced by checkReturnType().

◆ throwError()

void LOCA::ErrorCheck::throwError ( const std::string & callingFunction = "<Unknown Method>",
const std::string & message = "",
const std::string & throwLabel = "LOCA Error" )

Member Data Documentation

◆ globalData

Teuchos::RCP<LOCA::GlobalData> LOCA::ErrorCheck::globalData
protected

Global data.

Referenced by ErrorCheck(), printWarning(), and throwError().


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