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

Simulate particles using fixed time-step. More...

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <omp.h>
#include <math.h>
#include "../ascot5.h"
#include "../physlib.h"
#include "../simulate.h"
#include "../particle.h"
#include "../wall.h"
#include "../diag.h"
#include "../B_field.h"
#include "../E_field.h"
#include "../plasma.h"
#include "../endcond.h"
#include "../consts.h"
#include "../copytogpu.h"
#include "simulate_fo_fixed.h"
#include "step/step_fo_vpa.h"
#include "mccc/mccc.h"
#include "atomic.h"

Go to the source code of this file.

Functions

real simulate_fo_fixed_inidt (sim_data *sim, particle_simd_fo *p, int i)
 Calculates time step value.
 
void simulate_fo_fixed (particle_queue *pq, sim_data *sim, int mrk_array_size)
 Simulates particles using fixed time-step.
 

Detailed Description

Simulate particles using fixed time-step.

Definition in file simulate_fo_fixed.c.

Function Documentation

◆ simulate_fo_fixed_inidt()

real simulate_fo_fixed_inidt ( sim_data * sim,
particle_simd_fo * p,
int i )

Calculates time step value.

The time step is calculated as a user-defined fraction of gyro time, whose formula accounts for relativity, or an user defined value is used as is depending on simulation options.

Parameters
simpointer to simulation data struct
pSIMD array of markers
iindex of marker for which time step is assessed
Returns
Calculated time step

Definition at line 233 of file simulate_fo_fixed.c.

◆ simulate_fo_fixed()

void simulate_fo_fixed ( particle_queue * pq,
sim_data * sim,
int mrk_array_size )

Simulates particles using fixed time-step.

The simulation includes:

  • orbit-following with Volume-Preserving Algorithm
  • Coulomb collisions with Euler-Maruyama method

The simulation is carried until all markers have met some end condition or are aborted/rejected. The final state of the markers is stored in the given marker array. Other output is stored in the diagnostic array.

The time-step is user-defined: either a directly given fixed value or a given fraction of gyrotime.

Parameters
pqparticles to be simulated
simsimulation data struct
mrk_array_sizesize of particle arrays

Definition at line 50 of file simulate_fo_fixed.c.