desc.integrals.Bounce1D.batch
- static Bounce1D.batch(fun, fun_data, desc_data, grid, num_pitch, surf_batch_size=1, simp=True, expand_out=False)Source
Compute function
funover phase space in batches.This is a utility method to compute some function of bounce integrals over the phase space efficiently. You may want to also JIT compile your code which calls this utility method.
Examples
desc/compute/_old.py::_epsilon_32_1Ddesc/compute/_old.py::_Gamma_c_1D
- Parameters:
fun (callable) – A function which takes a single argument
fun_dataand computes bounce integrals assumingfun_dataholds all required quantities to construct aBounce1Doperator with the flagis_reshaped=Trueas well as call its methods.fun_data (dict[str, jnp.ndarray]) – Data to reshape, interpolate, and pass to
fun. The structure of the data should match the structure returned by the registered compute functions indesc.compute. Note this dictionary will be modified.desc_data (dict[str, jnp.ndarray]) – Data dictionary with the same structure as the data returned by the functions in
desc.compute.grid (Grid) – Grid on which
fun_dataanddesc_datawere computed.num_pitch (int) – Number of pitch angles to add to
fun_datafor use in the computation.surf_batch_size (int) – Number of flux surfaces with which to compute simultaneously. Default is
1.simp (bool) – Whether the pitch angles should be chosen for use with open Simpson rule instead of uniform weights for quadrature over velocity coordinate. Default is True.
expand_out (bool) – Whether to expand output to full grid so that the first dimension has size
grid.num_nodesinstead ofgrid.num_rho. Default is False.
- Returns:
The output
fun(fun_data).