Load.curl#
- NablaManager.curl(v1: ndarray | None = None, v2: ndarray | None = None, v3: ndarray | None = None, x1slice: float | None = None, x2slice: float | None = None, x3slice: float | None = None, edge_order: int = 2) ndarray[source]
Calculate the curl of a specified vector field (v1, v2, v3).
Uses second-order accurate central differences via the NumPy gradient() function. Unlike in divergence(), all three vector components must be specified. The resulting array has its first index representing the 3 curl components, while the remaining indices correspond to the grid location. If ‘x1slice’, ‘x2slice’, or ‘x3slice’ are specified, the curl is only computed at the corresponding x1, x2, or x3 values.
- Parameters:
- - v1: np.ndarray | None
Field corresponding to the x1 vector component. Must have the same shape as self.rho.
- - v2: np.ndarray | None
Field corresponding to the x2 vector component. Must have the same shape as self.rho.
- - v3: np.ndarray | None
Field corresponding to the x3 vector component. Must have the same shape as self.rho.
- - x1slice: float | None
If not None, specifies the constant value for the x1 axis.
- - x2slice: float | None
If not None, specifies the constant value for the x2 axis.
- - x3slice: float | None
If not None, specifies the constant value for the x3 axis.
- - edge_order: int, default 2
The order of accuracy of derivatives at the domain boundaries.
- Returns:
- np.ndarray
Examples
Example #1: Calculate the curl of a vector field
>>> import pyPLUTO as pp >>> D = pp.Load() >>> D.curl(D.vx1, D.vx2, D.vx3)