VTK-m
2.0
vtkm
ErrorCode.h
Go to the documentation of this file.
1
//============================================================================
2
// Copyright (c) Kitware, Inc.
3
// All rights reserved.
4
// See LICENSE.txt for details.
5
//
6
// This software is distributed WITHOUT ANY WARRANTY; without even
7
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8
// PURPOSE. See the above copyright notice for more information.
9
//============================================================================
10
#ifndef vtk_m_exec_ErrorCode_h
11
#define vtk_m_exec_ErrorCode_h
12
13
#include <lcl/ErrorCode.h>
14
15
#include <
vtkm/internal/ExportMacros.h
>
16
namespace
vtkm
17
{
18
19
enum class
ErrorCode
20
{
21
Success
,
22
InvalidShapeId
,
23
InvalidNumberOfPoints
,
24
InvalidCellMetric
,
25
WrongShapeIdForTagType
,
26
InvalidPointId
,
27
InvalidEdgeId
,
28
InvalidFaceId
,
29
SolutionDidNotConverge
,
30
MatrixFactorizationFailed
,
31
DegenerateCellDetected
,
32
MalformedCellDetected
,
33
OperationOnEmptyCell
,
34
CellNotFound
,
35
36
UnknownError
37
};
38
39
VTKM_EXEC_CONT
40
inline
const
char
*
ErrorString
(
vtkm::ErrorCode
code) noexcept
41
{
42
switch
(code)
43
{
44
case
vtkm::ErrorCode::Success
:
45
return
"Success"
;
46
case
vtkm::ErrorCode::InvalidShapeId
:
47
return
"Invalid shape id"
;
48
case
vtkm::ErrorCode::InvalidNumberOfPoints
:
49
return
"Invalid number of points"
;
50
case
vtkm::ErrorCode::InvalidCellMetric
:
51
return
"Invalid cell metric"
;
52
case
vtkm::ErrorCode::WrongShapeIdForTagType
:
53
return
"Wrong shape id for tag type"
;
54
case
vtkm::ErrorCode::InvalidPointId
:
55
return
"Invalid point id"
;
56
case
vtkm::ErrorCode::InvalidEdgeId
:
57
return
"Invalid edge id"
;
58
case
vtkm::ErrorCode::InvalidFaceId
:
59
return
"Invalid face id"
;
60
case
vtkm::ErrorCode::SolutionDidNotConverge
:
61
return
"Solution did not converge"
;
62
case
vtkm::ErrorCode::MatrixFactorizationFailed
:
63
return
"Matrix factorization failed"
;
64
case
vtkm::ErrorCode::DegenerateCellDetected
:
65
return
"Degenerate cell detected"
;
66
case
vtkm::ErrorCode::MalformedCellDetected
:
67
return
"Malformed cell detected"
;
68
case
vtkm::ErrorCode::OperationOnEmptyCell
:
69
return
"Operation on empty cell"
;
70
case
vtkm::ErrorCode::CellNotFound
:
71
return
"Cell not found"
;
72
case
vtkm::ErrorCode::UnknownError
:
73
return
"Unknown error"
;
74
}
75
76
return
"Invalid error"
;
77
}
78
79
namespace
internal
80
{
81
82
VTKM_EXEC_CONT
inline
vtkm::ErrorCode
LclErrorToVtkmError(
lcl::ErrorCode
code) noexcept
83
{
84
switch
(code)
85
{
86
case
lcl::ErrorCode::SUCCESS:
87
return
vtkm::ErrorCode::Success
;
88
case
lcl::ErrorCode::INVALID_SHAPE_ID:
89
return
vtkm::ErrorCode::InvalidShapeId
;
90
case
lcl::ErrorCode::INVALID_NUMBER_OF_POINTS:
91
return
vtkm::ErrorCode::InvalidNumberOfPoints
;
92
case
lcl::ErrorCode::WRONG_SHAPE_ID_FOR_TAG_TYPE:
93
return
vtkm::ErrorCode::WrongShapeIdForTagType
;
94
case
lcl::ErrorCode::INVALID_POINT_ID:
95
return
vtkm::ErrorCode::InvalidPointId
;
96
case
lcl::ErrorCode::SOLUTION_DID_NOT_CONVERGE:
97
return
vtkm::ErrorCode::SolutionDidNotConverge
;
98
case
lcl::ErrorCode::MATRIX_LUP_FACTORIZATION_FAILED:
99
return
vtkm::ErrorCode::MatrixFactorizationFailed
;
100
case
lcl::ErrorCode::DEGENERATE_CELL_DETECTED:
101
return
vtkm::ErrorCode::DegenerateCellDetected
;
102
}
103
104
return
vtkm::ErrorCode::UnknownError
;
105
}
106
107
}
// namespace internal
108
109
}
// namespace vtkm
110
111
#define VTKM_RETURN_ON_ERROR(call) \
112
do \
113
{ \
114
auto status = (call); \
115
if (status != ::vtkm::ErrorCode::Success) \
116
{ \
117
return status; \
118
} \
119
} while (false)
120
121
#endif //vtk_m_exec_ErrorCode_h
vtkm::ErrorCode
ErrorCode
Definition:
ErrorCode.h:19
vtkm::ErrorCode::WrongShapeIdForTagType
@ WrongShapeIdForTagType
vtkm
Groups connected points that have the same field value.
Definition:
Atomic.h:19
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition:
ExportMacros.h:52
vtkm::ErrorCode::UnknownError
@ UnknownError
vtkm::ErrorCode::DegenerateCellDetected
@ DegenerateCellDetected
vtkm::ErrorCode::Success
@ Success
vtkm::ErrorCode::MatrixFactorizationFailed
@ MatrixFactorizationFailed
vtkm::ErrorCode::MalformedCellDetected
@ MalformedCellDetected
vtkm::ErrorCode::InvalidEdgeId
@ InvalidEdgeId
vtkm::ErrorCode::InvalidFaceId
@ InvalidFaceId
ExportMacros.h
vtkm::ErrorCode::InvalidCellMetric
@ InvalidCellMetric
vtkm::ErrorCode::InvalidPointId
@ InvalidPointId
vtkm::ErrorCode::CellNotFound
@ CellNotFound
vtkm::ErrorCode::OperationOnEmptyCell
@ OperationOnEmptyCell
vtkm::ErrorCode::SolutionDidNotConverge
@ SolutionDidNotConverge
vtkm::ErrorString
const VTKM_EXEC_CONT char * ErrorString(vtkm::ErrorCode code) noexcept
Definition:
ErrorCode.h:40
vtkm::ErrorCode::InvalidNumberOfPoints
@ InvalidNumberOfPoints
vtkm::ErrorCode::InvalidShapeId
@ InvalidShapeId
Generated by
1.8.17