ASCOT5
|
header file for mccc_wiener.c More...
Go to the source code of this file.
Data Structures | |
struct | mccc_wienarr |
Struct for storing Wiener processes. More... | |
Macros | |
#define | MCCC_NDIM 5 |
#define | MCCC_NSLOTS WIENERSLOTS |
Functions | |
DECLARE_TARGET_SIMD void | mccc_wiener_initialize (mccc_wienarr *w, real initime) |
Initializes a struct that stores generated Wiener processes. | |
DECLARE_TARGET_SIMD a5err | mccc_wiener_generate (mccc_wienarr *w, real t, int *windex, real *rand5) |
Generates a new Wiener process at a given time instant. | |
DECLARE_TARGET_SIMD a5err | mccc_wiener_clean (mccc_wienarr *w, real t) |
Removes Wiener processes from the array that are no longer required. | |
header file for mccc_wiener.c
Definition in file mccc_wiener.h.
#define MCCC_NDIM 5 |
Wiener process dimension. NDIM=5 because only guiding centers are simulated with adaptive time step
Definition at line 15 of file mccc_wiener.h.
#define MCCC_NSLOTS WIENERSLOTS |
Maximum slots in Wiener array which means this is the maximum number of time step reductions.
Definition at line 21 of file mccc_wiener.h.
DECLARE_TARGET_SIMD void mccc_wiener_initialize | ( | mccc_wienarr * | w, |
real | initime ) |
Initializes a struct that stores generated Wiener processes.
w | Wiener struct to be initialized |
initime | time when a Wiener process begins |
Definition at line 36 of file mccc_wiener.c.
DECLARE_TARGET_SIMD a5err mccc_wiener_generate | ( | mccc_wienarr * | w, |
real | t, | ||
int * | windex, | ||
real * | rand5 ) |
Generates a new Wiener process at a given time instant.
Generates a new Wiener process. The generated process is drawn from normal distribution unless there exists a Wiener process at future time-instance, in which case the process is created using the Brownian bridge.
w | array that stores the Wiener processes |
t | time for which the new process will be generated |
windex | index of the generated Wiener process in the Wiener array |
rand5 | array of 5 normal distributed random numbers |
Definition at line 66 of file mccc_wiener.c.
DECLARE_TARGET_SIMD a5err mccc_wiener_clean | ( | mccc_wienarr * | w, |
real | t ) |
Removes Wiener processes from the array that are no longer required.
Processes W(t') are redundant if t' < t, where t is the current simulation time. Note that W(t) should exist before W(t') are removed. This routine should be called each time when simulation time is advanced.
w | array that stores the Wiener processes |
t | time for which the new process will be generated |
Definition at line 173 of file mccc_wiener.c.