ASCOT5
|
Guiding center integration with adaptive Cash Karp method. More...
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include "../../ascot5.h"
#include "../../B_field.h"
#include "../../consts.h"
#include "../../particle.h"
#include "../../error.h"
#include "step_gc_cashkarp.h"
#include "step_gceom.h"
#include "step_gceom_mhd.h"
Go to the source code of this file.
Functions | |
void | step_gc_cashkarp (particle_simd_gc *p, real *h, real *hnext, real tol, B_field_data *Bdata, E_field_data *Edata) |
Integrate a guiding center step for a struct of markers. | |
void | step_gc_cashkarp_mhd (particle_simd_gc *p, real *h, real *hnext, real tol, B_field_data *Bdata, E_field_data *Edata, boozer_data *boozer, mhd_data *mhd) |
Integrate a guiding center step for a struct of markers with MHD. | |
Guiding center integration with adaptive Cash Karp method.
Definition in file step_gc_cashkarp.c.
void step_gc_cashkarp | ( | particle_simd_gc * | p, |
real * | h, | ||
real * | hnext, | ||
real | tol, | ||
B_field_data * | Bdata, | ||
E_field_data * | Edata ) |
Integrate a guiding center step for a struct of markers.
This function calculates a guiding center step for a struct of NSIMD markers with Cash-Karp (adaptive RK5) simultaneously using SIMD instructions. All arrays in the function are of NSIMD length so vectorization can be performed directly without gather and scatter operations. Informs whther time step was accepted or rejected and provides a suggestion for the next time step.
p | marker struct that will be updated |
h | array containing time step lengths |
hnext | suggestion for the next time step. Negative sign indicates current step was rejected |
tol | error tolerance |
Bdata | pointer to magnetic field data |
Edata | pointer to electric field data |
Definition at line 35 of file step_gc_cashkarp.c.
void step_gc_cashkarp_mhd | ( | particle_simd_gc * | p, |
real * | h, | ||
real * | hnext, | ||
real | tol, | ||
B_field_data * | Bdata, | ||
E_field_data * | Edata, | ||
boozer_data * | boozer, | ||
mhd_data * | mhd ) |
Integrate a guiding center step for a struct of markers with MHD.
Rejected step has a negative suggestion for the next time-step. The negative sign is only used to indicate a rejected step and absolute value should be used for the next time-step.
p | marker struct that will be updated |
h | array containing time step lengths |
hnext | suggestion for the next time step. |
tol | error tolerance |
Bdata | pointer to magnetic field data |
Edata | pointer to electric field data |
boozer | pointer to Boozer data |
mhd | pointer to MHD data |
Definition at line 344 of file step_gc_cashkarp.c.