calculus
moment_kinetics.calculus — Module
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
sourcemoment_kinetics.calculus.derivative! — Method
moment_kinetics.calculus.derivative! — Method
moment_kinetics.calculus.elements_to_full_grid_interior_pts! — Method
maps the derivative at points away from element boundaries from the grid/element representation to the full grid representation
sourcemoment_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.
sourcemoment_kinetics.calculus.elementwise_indefinite_integration! — Method
A function that takes the indefinite integral in each element of coord.grid, leaving the result (element-wise) in coord.scratch_2d.
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.
moment_kinetics.calculus.integral — Method
Computes the integral of the 3D integrand, using the input wgts
sourcemoment_kinetics.calculus.integral — Method
Computes the integral of the integrand multiplied by v^n, using the input wgts
sourcemoment_kinetics.calculus.integral — Method
Computes the integral of the 2D integrand, using the input wgts
sourcemoment_kinetics.calculus.integral — Method
Computes the integral of the integrand multiplied by v, using the input wgts
sourcemoment_kinetics.calculus.integral — Method
Computes the integral of the integrand, using the input wgts
sourcemoment_kinetics.calculus.integral — Method
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.
sourcemoment_kinetics.calculus.integral — Method
Compute the 1D integral ∫dv prefactor(v)*integrand
In this variant v should be a coordinate object.
moment_kinetics.calculus.integral — Method
Compute the 3D integral ∫dvzeta.dvr.dvz prefactor(vzeta,vr,vz)*integrand
In this variant vzeta, vr, and vz should be coordinate objects.
moment_kinetics.calculus.mass_matrix_solve! — Function
mass_matrix_solve!(f, b, spectral::weak_discretization_info)Solve
\[M.f = b\]
for $a$, where $M$ is the mass matrix of a weak-form finite element method and $b$ is an input.
sourcemoment_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