Chombo + EB + MF  3.2
Macros | Enumerations | Functions | Variables
PXStuff.H File Reference
#include "NamespaceHeader.H"
#include "NamespaceFooter.H"
Include dependency graph for PXStuff.H:

Go to the source code of this file.

Macros

#define _PXSTUFF_H_
 
#define unlikely(expr)   __builtin_expect((expr), 0)
 
#define likely(expr)   __builtin_expect((expr), 1)
 
#define PXError(v, X)
 
#define PXErrorBreak(X)
 
#define PXErrorReturn(X)
 
#define PXErrorReturnCode(X, Y)
 
#define PXErrorReturnSilent(X)
 
#define PX_NO_ERROR   0
 
#define PX_MEMORY_ERROR   -1
 
#define PX_BAD_INPUT   -2
 
#define PX_NON_PHYSICAL   -3
 
#define PX_READWRITE_ERROR   -4
 
#define PX_GRID_ERROR   -5
 
#define PX_SEARCH_NOT_FOUND   -6
 
#define PX_NO_UPDATE   -7
 
#define PX_PARALLEL_ERROR   -8
 
#define PX_CODE_FLOW_ERROR   -9
 
#define PX_SYSTEM_ERROR   -10
 
#define PX_DYNAMIC_LIBRARY_ERROR   -11
 
#define PX_NOT_CONVERGED   -12
 
#define PX_VIZ_ERROR   -13
 
#define PX_LAPACK_ERROR   -14
 
#define PX_HARD_EXIT   -15
 
#define PX_CGNS_ERROR   -16
 
#define AssertDblWithin(truth, actual, delta)   if (Abs((truth) - (actual)) > (delta)) PXErrorReturn(PX_CODE_FLOW_ERROR);
 
#define PXAssertDblEquals(truth, actual)   CuAssertDblEquals( private_test_struct, truth, actual, 1.0e-15)
 
#define PXAssertDblRelErrWithin(truth, actual, delta)   CuAssertDblRelErrWithin( private_test_struct, truth, actual, delta )
 
#define PXAssertIntWithin(truth, actual, delta)
 
#define AssertIntEquals(truth, actual)   if ((truth) != (actual)) PXErrorReturn(PX_CODE_FLOW_ERROR);
 
#define PXAssertPtrNotNull(ptr)   CuAssertPtrNotNull( private_test_struct, ptr )
 
#define PXAssertPtrEquals(truth, actual)   CuAssertPtrEquals( private_test_struct, truth, actual )
 
#define PXAssertStrEquals(truth, actual)   CuAssertStrEquals( private_test_struct, truth, actual )
 
#define AssertDblGreater(min, actual)   if ( !((actual) > (min)) ) PXErrorReturn(PX_CODE_FLOW_ERROR);
 
#define PXAssertIsNotNaN(value)
 
#define ErrorAssert(X)
 

Enumerations

enum  PXE_Boolean { PXE_False, PXE_True, PXE_BooleanLast }
 

Functions

void PXErrorReport (const char *file, int line, const char *call, int ierr)
 

Variables

const char * PXE_ErrorCodeName []
 

Macro Definition Documentation

◆ _PXSTUFF_H_

#define _PXSTUFF_H_

◆ unlikely

#define unlikely (   expr)    __builtin_expect((expr), 0)

◆ likely

#define likely (   expr)    __builtin_expect((expr), 1)

◆ PXError

#define PXError (   v,
 
)
Value:
{ int _ier; _ier = (X); if (unlikely(_ier != PX_NO_ERROR)){ PXErrorRepo\
rt(__FILE__, __LINE__, #X, _ier); } (v) = _ier;}
#define PX_NO_ERROR
Definition: PXStuff.H:49
#define unlikely(expr)
Definition: PXStuff.H:20

◆ PXErrorBreak

#define PXErrorBreak (   X)
Value:
do{ int _ier; _ier = (X); if (unlikely(_ier != PX_NO_ERROR)){ PXErrorRepo\
rt(__FILE__, __LINE__, #X, _ier); exit(-1);} } while (0)
#define PX_NO_ERROR
Definition: PXStuff.H:49
#define unlikely(expr)
Definition: PXStuff.H:20

◆ PXErrorReturn

#define PXErrorReturn (   X)
Value:
do{ int _ier; _ier = (X); if (unlikely(_ier != PX_NO_ERROR)){ PXErrorRepo\
rt(__FILE__, __LINE__, #X, _ier); return _ier;} } while (0)
#define PX_NO_ERROR
Definition: PXStuff.H:49
#define unlikely(expr)
Definition: PXStuff.H:20

◆ PXErrorReturnCode

#define PXErrorReturnCode (   X,
 
)
Value:
do{ int _ier; _ier = (X); if (unlikely(_ier != PX_NO_ERROR)){ PXErrorRepo\
rt(__FILE__, __LINE__, #X, _ier); return ( Y);} } while (0)
#define PX_NO_ERROR
Definition: PXStuff.H:49
#define unlikely(expr)
Definition: PXStuff.H:20

◆ PXErrorReturnSilent

#define PXErrorReturnSilent (   X)
Value:
do{ int _ier; _ier = (X); if (unlikely(_ier != PX_NO_ERROR)){ return _ier\
;} } while (0)
#define PX_NO_ERROR
Definition: PXStuff.H:49
#define unlikely(expr)
Definition: PXStuff.H:20

◆ PX_NO_ERROR

#define PX_NO_ERROR   0

◆ PX_MEMORY_ERROR

#define PX_MEMORY_ERROR   -1

◆ PX_BAD_INPUT

#define PX_BAD_INPUT   -2

◆ PX_NON_PHYSICAL

#define PX_NON_PHYSICAL   -3

◆ PX_READWRITE_ERROR

#define PX_READWRITE_ERROR   -4

◆ PX_GRID_ERROR

#define PX_GRID_ERROR   -5

◆ PX_SEARCH_NOT_FOUND

#define PX_SEARCH_NOT_FOUND   -6

◆ PX_NO_UPDATE

#define PX_NO_UPDATE   -7

◆ PX_PARALLEL_ERROR

#define PX_PARALLEL_ERROR   -8

◆ PX_CODE_FLOW_ERROR

#define PX_CODE_FLOW_ERROR   -9

◆ PX_SYSTEM_ERROR

#define PX_SYSTEM_ERROR   -10

◆ PX_DYNAMIC_LIBRARY_ERROR

#define PX_DYNAMIC_LIBRARY_ERROR   -11

◆ PX_NOT_CONVERGED

#define PX_NOT_CONVERGED   -12

◆ PX_VIZ_ERROR

#define PX_VIZ_ERROR   -13

◆ PX_LAPACK_ERROR

#define PX_LAPACK_ERROR   -14

◆ PX_HARD_EXIT

#define PX_HARD_EXIT   -15

◆ PX_CGNS_ERROR

#define PX_CGNS_ERROR   -16

◆ AssertDblWithin

#define AssertDblWithin (   truth,
  actual,
  delta 
)    if (Abs((truth) - (actual)) > (delta)) PXErrorReturn(PX_CODE_FLOW_ERROR);

◆ PXAssertDblEquals

#define PXAssertDblEquals (   truth,
  actual 
)    CuAssertDblEquals( private_test_struct, truth, actual, 1.0e-15)

◆ PXAssertDblRelErrWithin

#define PXAssertDblRelErrWithin (   truth,
  actual,
  delta 
)    CuAssertDblRelErrWithin( private_test_struct, truth, actual, delta )

◆ PXAssertIntWithin

#define PXAssertIntWithin (   truth,
  actual,
  delta 
)
Value:
if ( abs(truth - actual) > delta){\
sprintf(private_test_message,"expected <%d> but was <%d>", truth, actual ); \
CuFail( private_test_struct, private_test_message); }

◆ AssertIntEquals

#define AssertIntEquals (   truth,
  actual 
)    if ((truth) != (actual)) PXErrorReturn(PX_CODE_FLOW_ERROR);

◆ PXAssertPtrNotNull

#define PXAssertPtrNotNull (   ptr)    CuAssertPtrNotNull( private_test_struct, ptr )

◆ PXAssertPtrEquals

#define PXAssertPtrEquals (   truth,
  actual 
)    CuAssertPtrEquals( private_test_struct, truth, actual )

◆ PXAssertStrEquals

#define PXAssertStrEquals (   truth,
  actual 
)    CuAssertStrEquals( private_test_struct, truth, actual )

◆ AssertDblGreater

#define AssertDblGreater (   min,
  actual 
)    if ( !((actual) > (min)) ) PXErrorReturn(PX_CODE_FLOW_ERROR);

◆ PXAssertIsNotNaN

#define PXAssertIsNotNaN (   value)
Value:
if ( !(value==value) ){ \
sprintf(private_test_message, \
"NaN encountered.\n"); \
CuFail( private_test_struct, private_test_message ); }

◆ ErrorAssert

#define ErrorAssert (   X)
Value:
do{ int _ier; _ier = (X); if (_ier != PX_NO_ERROR){ printf("Error %d (%s) has o\ccured.\n File : %s Line : %d\n Call : %s\n", _ier,PXE_ErrorCodeName[-_ier], __FILE__, __LINE__, #X); f\
flush(stdout); AssertIntEquals(PX_NO_ERROR, _ier);} } while (0)
#define PX_NO_ERROR
Definition: PXStuff.H:49
const char * PXE_ErrorCodeName[]
#define AssertIntEquals(truth, actual)
Definition: PXStuff.H:83

Enumeration Type Documentation

◆ PXE_Boolean

Enumerator
PXE_False 
PXE_True 
PXE_BooleanLast 

Function Documentation

◆ PXErrorReport()

void PXErrorReport ( const char *  file,
int  line,
const char *  call,
int  ierr 
)

Variable Documentation

◆ PXE_ErrorCodeName

const char* PXE_ErrorCodeName[]