gbspy.grad module
Gradients and interpolation functions
Functions to evaluate the first and second derivatives and the corresponding interpolating function. They aim to replicate the finite difference stencils used by the routines implemented in GBS.
- gbspy.grad.arakw_2h(data, A, B)
- gbspy.grad.arakw_h(data, A, B)
- gbspy.grad.arakw_n2n(data, A, B)
Poisson brackets
- Parameters
data (gbspy.pp.Sim) – Simulation object
A (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
B (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
- Returns
The Poisson bracket \([A,B]\) as a 4D array.
- Return type
np.ndarray
- gbspy.grad.arakw_n2v(data, A, B)
Poisson brackets
- Parameters
data (gbspy.pp.Sim) – Simulation object
A (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
B (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
- Returns
The Poisson bracket \([A,B]\) interpolated to the v-grid as a 4D array.
- Return type
np.ndarray
- gbspy.grad.curv_n2n(data, f)
Return the curvature of f from n to n
- Parameters
data (gbspy.pp.Sim) – Simulation object from which f was loaded.
f (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
- Returns
4D array corresponding to the curvature of the input array.
- Return type
np.ndarray
- gbspy.grad.curv_n2v(data, f)
Return the curvature of f from n to v
- Parameters
data (gbspy.pp.Sim) – Simulation object from which f was loaded.
f (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
- Returns
4D array corresponding to the curvature of the input array (interpolated on the v-grid).
- Return type
np.ndarray
- gbspy.grad.curv_v2n(data, f)
Return the curvature of f from v to n
- Parameters
data (gbspy.pp.Sim) – Simulation object from which f was loaded.
f (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
- Returns
4D array corresponding to the curvature of the input array (interpolated on the n-grid).
- Return type
np.ndarray
- gbspy.grad.grad2par_n2n(data, f)
Parallel laplacian ngrid -> ngrid
- Parameters
data (gbspy.pp.Sim) – Simulation object
f (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
- Returns
Parallel laplacian of the input field as a 4D array, on the n-grid.
- Return type
np.ndarray
- gbspy.grad.gradpar_n2n(data, f)
Parallel gradient ngrid -> ngrid
- Parameters
data (gbspy.pp.Sim) – Simulation object
f (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
- Returns
Parallel gradient of the input field as a 4D array, on the n-grid.
- Return type
np.ndarray
- gbspy.grad.gradpar_n2v(data, f)
Parallel gradient ngrid -> vgrid
- Parameters
data (gbspy.pp.Sim) – Simulation object
f (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
- Returns
Parallel gradient of the input field as a 4D array, interpolated on the v-grid.
- Return type
np.ndarray
- gbspy.grad.gradpar_v2n(data, f)
Parallel gradient vgrid -> ngrid
- Parameters
data (gbspy.pp.Sim) – Simulation object
f (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
- Returns
Parallel gradient of the input field as a 4D array, interpolated on the n-grid.
- Return type
np.ndarray
- gbspy.grad.gradpar_v2v(data, f)
Parallel gradient vgrid -> vgrid
- Parameters
data (gbspy.pp.Sim) – Simulation object
f (np.ndarray) – 4D array loaded by
gbspy.pp.Sim.get_field()
- Returns
Parallel gradient of the input field as a 4D array, on the v-grid.
- Return type
np.ndarray
- gbspy.grad.gradx_n2n(data, f)
- gbspy.grad.gradxx_n2n(data, f)
- gbspy.grad.grady_n2n(data, f)
- gbspy.grad.grady_n2v(data, f)
- gbspy.grad.grady_v2n(data, f)
- gbspy.grad.gradyy_n2n(data, f)
- gbspy.grad.gradyy_n2v(data, f)
- gbspy.grad.gradyy_v2n(data, f)
- gbspy.grad.gradz_n2n(data, f)
- gbspy.grad.gradz_n2v(data, f)
- gbspy.grad.gradz_v2n(data, f)
- gbspy.grad.gradzz_n2n(data, f)
- gbspy.grad.interp_n2v(data, f)
- gbspy.grad.interp_v2n(data, f)