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

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.
 

Detailed Description

Guiding center integration with adaptive Cash Karp method.

Definition in file step_gc_cashkarp.c.

Function Documentation

◆ step_gc_cashkarp()

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.

Parameters
pmarker struct that will be updated
harray containing time step lengths
hnextsuggestion for the next time step. Negative sign indicates current step was rejected
tolerror tolerance
Bdatapointer to magnetic field data
Edatapointer to electric field data

Definition at line 35 of file step_gc_cashkarp.c.

◆ step_gc_cashkarp_mhd()

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.

Parameters
pmarker struct that will be updated
harray containing time step lengths
hnextsuggestion for the next time step.
tolerror tolerance
Bdatapointer to magnetic field data
Edatapointer to electric field data
boozerpointer to Boozer data
mhdpointer to MHD data

Definition at line 344 of file step_gc_cashkarp.c.