ASCOT5
Loading...
Searching...
No Matches
Functions
step_ml_cashkarp.c File Reference

Field line integrator implemented with Cash-Karp method. More...

#include <stdlib.h>
#include <float.h>
#include <math.h>
#include "../../ascot5.h"
#include "../../B_field.h"
#include "../../particle.h"
#include "../../boozer.h"
#include "../../mhd.h"
#include "step_ml_cashkarp.h"

Go to the source code of this file.

Functions

void step_ml_cashkarp (particle_simd_ml *p, real *h, real *hnext, real tol, B_field_data *Bdata)
 Integrate a magnetic field line step for a struct of markers.
 
void step_ml_cashkarp_mhd (particle_simd_ml *p, real *h, real *hnext, real tol, B_field_data *Bdata, boozer_data *boozerdata, mhd_data *mhddata)
 Integrate a magnetic field line step for a struct of markers.
 

Detailed Description

Field line integrator implemented with Cash-Karp method.

Definition in file step_ml_cashkarp.c.

Function Documentation

◆ step_ml_cashkarp()

void step_ml_cashkarp ( particle_simd_ml * p,
real * h,
real * hnext,
real tol,
B_field_data * Bdata )

Integrate a magnetic field line step for a struct of markers.

This function calculates a magnetic field line 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 whether time step was accepted or rejected and provides a suggestion for the next time step.

Parameters
pmarker struct that will be integrated
hNSIMD length array containing time step lengths
hnextsuggestion for the next time step. Negative if rejected.
tolerror tolerance
Bdatapointer to magnetic field data

Definition at line 32 of file step_ml_cashkarp.c.

◆ step_ml_cashkarp_mhd()

void step_ml_cashkarp_mhd ( particle_simd_ml * p,
real * h,
real * hnext,
real tol,
B_field_data * Bdata,
boozer_data * boozerdata,
mhd_data * mhddata )

Integrate a magnetic field line step for a struct of markers.

This function calculates a magnetic field line 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 whether time step was accepted or rejected and provides a suggestion for the next time step.

Parameters
pmarker struct that will be integrated
hNSIMD length array containing time step lengths
hnextsuggestion for the next time step. Negative if rejected.
tolerror tolerance
Bdatapointer to magnetic field data
boozerdatapointer to Boozer data
mhddatapointer to MHD data

Definition at line 265 of file step_ml_cashkarp.c.