fokker_planck_calculus

moment_kinetics.fokker_planck_calculus.calculate_rosenbluth_integrals!Method

Function to carry out the integration of the revelant distribution functions to form the required coefficients for the full-F operator. We assume that the weights are precalculated. The function takes as arguments the arrays of coefficients (which we fill), the required distributions, the precomputed weights, the indicies of the `field' velocities, and the sizes of the primed vpa and vperp coordinates arrays.

source
moment_kinetics.fokker_planck_calculus.get_global_compound_indexMethod
get_global_compound_index(vpa,vperp,ielement_vpa,ielement_vperp,ivpa_local,ivperp_local)

For local (within the single element specified by ielement_vpa and ielement_vperp) indices ivpa_local and ivperp_local, get the global index in the 'linear-indexed' 2d space of size (vperp.n, vpa.n) (as returned by ic_func).

source
moment_kinetics.fokker_planck_calculus.ic_funcMethod
ic_func(ivpa::mk_int,ivperp::mk_int,nvpa::mk_int)

Get the 'linear index' corresponding to ivpa and ivperp. Defined so that the linear index corresponds to the underlying layout in memory of a 2d array indexed by [ivpa,ivperp], i.e. for a 2d array f2d:

  • size(f2d) == (vpa.n, vperp.n)
  • For a reference to f2d that is reshaped to a vector (a 1d array) f1d = vec(f2d) than for any ivpa and ivperp it is true that f1d[ic_func(ivpa,ivperp)] == f2d[ivpa,ivperp].
source
moment_kinetics.fokker_planck_calculus.interpolate_2D_vspace!Method

function to interpolate f(vpa,vperp) from one velocity grid to another, assuming that both grids are represented by vpa, vperp in normalised units, but have different normalisation factors defining the meaning of these grids in physical units.

E.g. vpai, vperpi = ci * vpa, ci * vperp vpae, vperpe = ce * vpa, ce * vperp

with ci = sqrt(Ti/mi), ce = sqrt(Te/mi)

scalefac = ci / ce is the ratio of the two reference speeds

source