ASCOT5
Loading...
Searching...
No Matches
error.h
Go to the documentation of this file.
1
7
#ifndef ERROR_H
8
#define ERROR_H
9
10
#include <
math.h
>
11
#include <stdio.h>
12
#include "offload_acc_omp.h"
13
17
typedef
unsigned
long
int
a5err
;
18
25
typedef
enum
error_file
{
26
EF_MCCC_WIENER
= 1,
27
EF_MCCC_PUSH
= 2,
28
EF_MCCC_COEFS
= 3,
29
EF_MCCC
= 4,
30
EF_STEP_FO_VPA
= 5,
31
EF_STEP_GC_CASHKARP
= 6,
32
EF_STEP_GC_RK4
= 7,
33
EF_N0_1D
= 8,
34
EF_N0_3D
= 9,
35
EF_N0_ST
= 10,
36
EF_B_3DS
= 11,
37
EF_B_2DS
= 12,
38
EF_B_STS
= 13,
39
EF_B_GS
= 14,
40
EF_PLASMA_1D
= 15,
41
EF_PLASMA_1DS
= 16,
42
EF_PLASMA
= 17,
43
EF_E_FIELD
= 18,
44
EF_NEUTRAL
= 19,
45
EF_E_1DS
= 20,
46
EF_B_FIELD
= 21,
47
EF_PARTICLE
= 22,
48
EF_BOOZER
= 23,
49
EF_MHD
= 24,
50
EF_ATOMIC
= 25,
51
EF_ASIGMA
= 26,
52
EF_ASIGMA_LOC
= 27,
53
EF_SUZUKI
= 28
54
}
error_file
;
55
62
typedef
enum
error_type
{
63
ERR_INPUT_EVALUATION
= 1,
64
ERR_UNKNOWN_INPUT
= 2,
65
ERR_INPUT_UNPHYSICAL
= 3,
66
ERR_MARKER_UNPHYSICAL
= 4,
67
ERR_INVALID_TIMESTEP
= 5,
68
ERR_WIENER_ARRAY
= 6,
69
ERR_INTEGRATION
= 7,
71
ERR_ATOMIC_EVALUATION
= 8
72
}
error_type
;
73
85
DECLARE_TARGET_SIMD
86
static
inline
a5err
error_raise
(
error_type
type,
int
line,
error_file
file) {
87
a5err
err = 0;
88
err += (
a5err
)(type);
89
err += (
a5err
)(line*256);
90
err += (
a5err
)(file*256*1024);
91
return
err;
92
}
93
94
void
error_parse
(
a5err
err,
int
* msg,
int
* line,
int
* file);
95
96
void
error_parse2str
(
a5err
err,
char
* msg,
char
* line,
char
* file);
97
98
#endif
error_parse
void error_parse(a5err err, int *msg, int *line, int *file)
Retrieve stored data from the error flag.
Definition
error.c:44
a5err
unsigned long int a5err
Simulation error flag.
Definition
error.h:17
error_file
error_file
Enum type for indicating which file error originated from.
Definition
error.h:25
EF_N0_1D
@ EF_N0_1D
Definition
error.h:33
EF_N0_3D
@ EF_N0_3D
Definition
error.h:34
EF_MCCC
@ EF_MCCC
Definition
error.h:29
EF_ASIGMA_LOC
@ EF_ASIGMA_LOC
Definition
error.h:52
EF_ASIGMA
@ EF_ASIGMA
Definition
error.h:51
EF_N0_ST
@ EF_N0_ST
Definition
error.h:35
EF_PLASMA
@ EF_PLASMA
Definition
error.h:42
EF_B_2DS
@ EF_B_2DS
Definition
error.h:37
EF_MCCC_WIENER
@ EF_MCCC_WIENER
Definition
error.h:26
EF_BOOZER
@ EF_BOOZER
Definition
error.h:48
EF_B_GS
@ EF_B_GS
Definition
error.h:39
EF_E_FIELD
@ EF_E_FIELD
Definition
error.h:43
EF_STEP_GC_CASHKARP
@ EF_STEP_GC_CASHKARP
Definition
error.h:31
EF_B_3DS
@ EF_B_3DS
Definition
error.h:36
EF_SUZUKI
@ EF_SUZUKI
Definition
error.h:53
EF_MCCC_COEFS
@ EF_MCCC_COEFS
Definition
error.h:28
EF_PLASMA_1DS
@ EF_PLASMA_1DS
Definition
error.h:41
EF_ATOMIC
@ EF_ATOMIC
Definition
error.h:50
EF_B_FIELD
@ EF_B_FIELD
Definition
error.h:46
EF_STEP_FO_VPA
@ EF_STEP_FO_VPA
Definition
error.h:30
EF_STEP_GC_RK4
@ EF_STEP_GC_RK4
Definition
error.h:32
EF_MCCC_PUSH
@ EF_MCCC_PUSH
Definition
error.h:27
EF_MHD
@ EF_MHD
Definition
error.h:49
EF_B_STS
@ EF_B_STS
Definition
error.h:38
EF_E_1DS
@ EF_E_1DS
Definition
error.h:45
EF_NEUTRAL
@ EF_NEUTRAL
Definition
error.h:44
EF_PARTICLE
@ EF_PARTICLE
Definition
error.h:47
EF_PLASMA_1D
@ EF_PLASMA_1D
Definition
error.h:40
error_type
error_type
Enum type for indicating type of error.
Definition
error.h:62
ERR_MARKER_UNPHYSICAL
@ ERR_MARKER_UNPHYSICAL
Definition
error.h:66
ERR_INVALID_TIMESTEP
@ ERR_INVALID_TIMESTEP
Definition
error.h:67
ERR_ATOMIC_EVALUATION
@ ERR_ATOMIC_EVALUATION
Definition
error.h:71
ERR_INPUT_EVALUATION
@ ERR_INPUT_EVALUATION
Definition
error.h:63
ERR_INTEGRATION
@ ERR_INTEGRATION
Definition
error.h:69
ERR_UNKNOWN_INPUT
@ ERR_UNKNOWN_INPUT
Definition
error.h:64
ERR_WIENER_ARRAY
@ ERR_WIENER_ARRAY
Definition
error.h:68
ERR_INPUT_UNPHYSICAL
@ ERR_INPUT_UNPHYSICAL
Definition
error.h:65
error_parse2str
void error_parse2str(a5err err, char *msg, char *line, char *file)
Convert error flag in string format.
Definition
error.c:62
error_raise
static DECLARE_TARGET_SIMD a5err error_raise(error_type type, int line, error_file file)
Raise a new error.
Definition
error.h:86
math.h
Header file for math.c.
Generated on Wed Oct 9 2024 17:13:57 for ASCOT5 by
1.10.0