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
17typedef unsigned long int a5err;
18
55
73
85DECLARE_TARGET_SIMD
86static 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
94void error_parse(a5err err, int* msg, int* line, int* file);
95
96void error_parse2str(a5err err, char* msg, char* line, char* file);
97
98#endif
void error_parse(a5err err, int *msg, int *line, int *file)
Retrieve stored data from the error flag.
Definition error.c:44
unsigned long int a5err
Simulation error flag.
Definition error.h:17
error_file
Enum type for indicating which file error originated from.
Definition error.h:25
@ EF_N0_1D
Definition error.h:33
@ EF_N0_3D
Definition error.h:34
@ EF_MCCC
Definition error.h:29
@ EF_ASIGMA_LOC
Definition error.h:52
@ EF_ASIGMA
Definition error.h:51
@ EF_N0_ST
Definition error.h:35
@ EF_PLASMA
Definition error.h:42
@ EF_B_2DS
Definition error.h:37
@ EF_MCCC_WIENER
Definition error.h:26
@ EF_BOOZER
Definition error.h:48
@ EF_B_GS
Definition error.h:39
@ EF_E_FIELD
Definition error.h:43
@ EF_STEP_GC_CASHKARP
Definition error.h:31
@ EF_B_3DS
Definition error.h:36
@ EF_SUZUKI
Definition error.h:53
@ EF_MCCC_COEFS
Definition error.h:28
@ EF_PLASMA_1DS
Definition error.h:41
@ EF_ATOMIC
Definition error.h:50
@ EF_B_FIELD
Definition error.h:46
@ EF_STEP_FO_VPA
Definition error.h:30
@ EF_STEP_GC_RK4
Definition error.h:32
@ EF_MCCC_PUSH
Definition error.h:27
@ EF_MHD
Definition error.h:49
@ EF_B_STS
Definition error.h:38
@ EF_E_1DS
Definition error.h:45
@ EF_NEUTRAL
Definition error.h:44
@ EF_PARTICLE
Definition error.h:47
@ EF_PLASMA_1D
Definition error.h:40
error_type
Enum type for indicating type of error.
Definition error.h:62
@ ERR_MARKER_UNPHYSICAL
Definition error.h:66
@ ERR_INVALID_TIMESTEP
Definition error.h:67
@ ERR_ATOMIC_EVALUATION
Definition error.h:71
@ ERR_INPUT_EVALUATION
Definition error.h:63
@ ERR_INTEGRATION
Definition error.h:69
@ ERR_UNKNOWN_INPUT
Definition error.h:64
@ ERR_WIENER_ARRAY
Definition error.h:68
@ ERR_INPUT_UNPHYSICAL
Definition error.h:65
void error_parse2str(a5err err, char *msg, char *line, char *file)
Convert error flag in string format.
Definition error.c:62
static DECLARE_TARGET_SIMD a5err error_raise(error_type type, int line, error_file file)
Raise a new error.
Definition error.h:86
Header file for math.c.