calculus

moment_kinetics.calculus.assign_endpoint!Method

extension of the above function to distributed memory MPI function allows for arbitray array sizes ONLY IF the if statements doing the final endpoint assignments are updated to include each physical dimension required in the main code

source
moment_kinetics.calculus.elementwise_derivative!Function
elementwise_derivative!(coord, f, adv_fac, spectral)
elementwise_derivative!(coord, f, spectral)

Generic function for element-by-element derivatives

First signature, with adv_fac, calculates an upwind derivative, the second signature calculates a derivative without upwinding information.

Result is stored in coord.scratch_2d.

source
moment_kinetics.calculus.indefinite_integral!Method
indefinite_integral!(pf, f, coord, spectral)

Indefinite line integral.

This function is designed to work on local-in-memory data only, with distributed-memory MPI not implemented here. A function which integrates along a line which is distributed in memory exists in moment_kinetics.em_fields as calculate_phi_from_Epar!(). The distributed-memory functionality could be ported to a generic function, similiar to how the derivative! functions are generalised in moment_kinetics.derivatives.

source
moment_kinetics.calculus.integralMethod

Compute the 2D integral ∫d^2vperp.dvpa prefactor(vperp,vpa)*integrand

In this variant vperp and vpa should be coordinate objects.

Note that vperp_wgts contains the extra factor of vperp required for the Jacobian.

source
moment_kinetics.calculus.reconcile_element_boundaries_upwind!Method

if at the boundary point within the element, must carefully choose which value of df to use; this is because df is multi-valued at the overlapping point at the boundary between neighboring elements. here we choose to use the value of df from the upwind element.

source