Load.find_fieldlines#

pyPLUTO.Load.find_fieldlines(self, var1: str | ndarray, var2: str | ndarray, x0: list | float | None = None, y0: list | float | None = None, text: bool = False, check: bool = True, **kwargs: Any) list[source]#

Find field lines using the vector field. The field lines are computed by interpolating the variables var1 and var2 at the footpoints x0 and y0. Different integration algorithms are available, based on the method solve_ivp of the scipy package.

Parameters:
- atol: float, default 1e-6

The absolute tolerance for the integration.

- close: bool, default True

If True, it checks if the line is closed on itself.

- ctol: float, default 1e-6

The absolute tolerance for line closing on itself.

- dense: bool, default False

If True, the grid is dense (dense=True) or sparse (dense=False).

- maxstep: float, default 100*step

The maximum step size for the integration.

- minstep: float, default 0.05*step

The minimum step size for the integration (only used if order is LSODA).

- numsteps: int, default 16384

The maximum number of steps for the integration.

- order: str, default ‘RK45’

The integration method. Available options are: ‘RK45’, ‘RK23’, ‘DOP853’, ‘Radau’, ‘BDF’, ‘LSODA’.

- rtol: float, default 1e-6

The relative tolerance for the integration.

- step: float, default abs(min((xend-xbeg)/self.nx1, (yend-ybeg)/self.nx2))

The initial step size for the integration.

- text: bool, default False

If True some additional information is printed.

- transpose: bool, default False

If True, the variables are transposed.

- var1 (not optional): str | NDArray

The first variable to be interpolated.

- var2 (not optional): str | NDArray

The second variable to be interpolated.

- x0: list

The x coordinates of the footpoints.

- x1: NDArray | list | None, default self.x1

The x coordinates of the grid.

- x2: NDArray | list | None, default self.x2

The y coordinates of the grid.

- y0: list

The y coordinates of the footpoints.

—-
Returns:
  • linelist: list

    A list of lists containing the coordinates of the field lines. The strcuture of the list is [[x1, y1], [x2, y2], …] where x1, y1, x2, y2 are numpy arrays representing the coordinates of the field lines.

Examples

  • Example #1: Find field lines using the vector field

    >>> find_fieldlines(var1, var2, x0, y0)
    
  • Example #2: Find field lines using two strings ‘Bx1’ and ‘Bx2’

    >>> find_fieldlines("Bx1", "Bx2", x0, y0)
    
  • Example #3: Find field lines using two variables and two footpoints

    >>> find_fieldlines(var1, var2, [x1, x2], [y1, y2])