fokker_planck_calculus
moment_kinetics.fokker_planck_calculus
— Modulemodule for functions used in calculating the integrals and doing the numerical differentiation for the implementation of the the Full-F Fokker-Planck Collision Operator moment_kinetics.fokker_planck
.
Parallelisation of the collision operator uses a special 'anyv' region type, see Collision operator and anyv
region.
moment_kinetics.fokker_planck_calculus.boundary_integration_weights_struct
— Typea struct to contain the integration weights for the boundary points in the (vpa,vperp) domain
moment_kinetics.fokker_planck_calculus.fokkerplanck_boundary_data_arrays_struct
— Typea struct used for calculating the integration weights for the boundary of the velocity space domain in (vpa,vperp) coordinates
moment_kinetics.fokker_planck_calculus.fokkerplanck_weakform_arrays_struct
— Typea struct of dummy arrays and precalculated coefficients for the weak-form Fokker-Planck collision operator
moment_kinetics.fokker_planck_calculus.calculate_rosenbluth_integrals!
— MethodFunction 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.
moment_kinetics.fokker_planck_calculus.enforce_vpavperp_BCs!
— Methodfunction to enforce boundary conditions on the collision operator result to be consistent with the boundary conditions imposed on the the pdf
moment_kinetics.fokker_planck_calculus.get_element_limit_indices
— Methodfunction for getting the indices used to choose the integration quadrature
moment_kinetics.fokker_planck_calculus.get_global_compound_index
— Methodget_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
).
moment_kinetics.fokker_planck_calculus.ic_func
— Methodic_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 anyivpa
andivperp
it is true thatf1d[ic_func(ivpa,ivperp)] == f2d[ivpa,ivperp]
.
moment_kinetics.fokker_planck_calculus.ielement_loopup
— Methodfunction to find the element in which x sits
moment_kinetics.fokker_planck_calculus.init_Rosenbluth_potential_boundary_integration_weights!
— Methodfunction that precomputes the required integration weights only along the velocity space boundaries
moment_kinetics.fokker_planck_calculus.init_Rosenbluth_potential_integration_weights!
— Methodfunction that precomputes the required integration weights
moment_kinetics.fokker_planck_calculus.interpolate_2D_vspace!
— Methodfunction 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
moment_kinetics.fokker_planck_calculus.ivpa_func
— Methodivpa_func(ic::mk_int,nvpa::mk_int)
Get the vpa
index ivpa
that corresponds to a 'linear index' ic
that spans a 2d velocity space.
Defined so that ivpa_func(inc_func(ivpa,ivperp,nvpa), nvpa) == ivpa
.
See also ic_func
, ivperp_func
.
moment_kinetics.fokker_planck_calculus.ivperp_func
— Methodivperp_func(ic::mk_int,nvpa::mk_int)
Get the vperp
index ivperp
that corresponds to a 'linear index' ic
that spans a 2d velocity space.
Defined so that ivperp_func(inc_func(ivpa,ivperp,nvpa), nvpa) == ivperp
.
moment_kinetics.fokker_planck_calculus.setup_basic_quadratures
— Methodfunction for getting the basic quadratures used for the numerical integration of the Lagrange polynomials and the Green's function.