pencil.math.derivatives.div_grad_curl ===================================== .. py:module:: pencil.math.derivatives.div_grad_curl .. autoapi-nested-parse:: Compute the divergence, gradient and curl. Functions --------- .. autoapisummary:: pencil.math.derivatives.div_grad_curl.div pencil.math.derivatives.div_grad_curl.grad pencil.math.derivatives.div_grad_curl.curl pencil.math.derivatives.div_grad_curl.curl2 pencil.math.derivatives.div_grad_curl.del2 pencil.math.derivatives.div_grad_curl.del2v pencil.math.derivatives.div_grad_curl.curl3 pencil.math.derivatives.div_grad_curl.del6 pencil.math.derivatives.div_grad_curl.gij pencil.math.derivatives.div_grad_curl.traceless_strain Module Contents --------------- .. py:function:: div(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system='cartesian', grid=None) div(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system="cartesian", grid=None) Take divergence of pencil code vector array f in various coordinate systems. :param f: Pencil code vector array f. :type f: ndarray :param grid: Pencil grid object. See pc.read.grid(). :type grid: pencil.read.grids.Grid :param coordinate_system: Coordinate system under which to take the divergence. Takes 'cartesian', 'cylindrical' and 'spherical'. :type coordinate_system: string :param Deprecated parameters (only for backwards compatibility): :param --------------------------------------------------------: :param dx: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dx: floats :param dy: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dy: floats :param dz: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dz: floats :param x: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type x: ndarrays :param y: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type y: ndarrays .. py:function:: grad(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system='cartesian', grid=None) grad(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system="cartesian", grid=None) Take the gradient of a pencil code scalar array f in various coordinate systems. :param f: Pencil code scalar array f. :type f: ndarray :param grid: Pencil grid object. See pc.read.grid(). :type grid: pencil.read.grids.Grid :param coordinate_system: Coordinate system under which to take the divergence. Takes 'cartesian', 'cylindrical' and 'spherical'. :type coordinate_system: string :param Deprecated parameters (only for backwards compatibility): :param --------------------------------------------------------: :param dx: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dx: floats :param dy: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dy: floats :param dz: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dz: floats :param x: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type x: ndarrays :param y: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type y: ndarrays .. py:function:: curl(f, dx=None, dy=None, dz=None, x=None, y=None, run2D=False, coordinate_system='cartesian', grid=None) curl(f, dx=None, dy=None, dz=None, x=None, y=None, run2D=False, coordinate_system="cartesian", grid=None) Take the curl of a pencil code vector array f in various coordinate systems. :param f: Pencil code scalar array f. :type f: ndarray :param grid: Pencil grid object. See pc.read.grid(). :type grid: pencil.read.grids.Grid :param run2D: Deals with pure 2-D snapshots. !Only for Cartesian grids at the moment! Requires grid!=None. :type run2D: bool :param coordinate_system: Coordinate system under which to take the divergence. Takes 'cartesian', 'cylindrical' and 'spherical'. !Does not work for 2d runs yet! :type coordinate_system: string :param Deprecated parameters (only for backwards compatibility): :param --------------------------------------------------------: :param dx: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dx: floats :param dy: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dy: floats :param dz: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dz: floats :param x: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type x: ndarrays :param y: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type y: ndarrays .. py:function:: curl2(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system='cartesian', grid=None) curl2(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system="cartesian", grid=None) Take the double curl of a pencil code vector array f. :param f: Pencil code vector array f. :type f: ndarray :param grid: Pencil grid object. See pc.read.grid(). :type grid: pencil.read.grids.Grid :param coordinate_system: Coordinate system under which to take the divergence. Takes 'cartesian', 'cylindrical' and 'spherical'. :type coordinate_system: string :param Deprecated parameters (only for backwards compatibility): :param --------------------------------------------------------: :param dx: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dx: floats :param dy: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dy: floats :param dz: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dz: floats :param x: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type x: ndarrays :param y: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type y: ndarrays .. py:function:: del2(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system='cartesian', grid=None) del2(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system="cartesian", grid=None) Calculate del2, the Laplacian of a scalar field f. :param f: Pencil code vector array f. :type f: ndarray :param grid: Pencil grid object. See pc.read.grid(). :type grid: pencil.read.grids.Grid :param coordinate_system: Coordinate system under which to take the divergence. Takes 'cartesian', 'cylindrical' and 'spherical'. :type coordinate_system: string :param Deprecated parameters (only for backwards compatibility): :param --------------------------------------------------------: :param dx: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dx: floats :param dy: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dy: floats :param dz: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dz: floats :param x: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type x: ndarrays :param y: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type y: ndarrays .. py:function:: del2v(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system='cartesian', grid=None) del2v(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system="cartesian", grid=None) Calculate del2, the Laplacian of a vector field f. :param f: Pencil code vector array f. :type f: ndarray :param grid: Pencil grid object. See pc.read.grid(). :type grid: pencil.read.grids.Grid :param coordinate_system: Coordinate system under which to take the divergence. Takes 'cartesian', 'cylindrical' and 'spherical'. :type coordinate_system: string :param Deprecated parameters (only for backwards compatibility): :param --------------------------------------------------------: :param dx: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dx: floats :param dy: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dy: floats :param dz: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dz: floats :param x: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type x: ndarrays :param y: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type y: ndarrays .. py:function:: curl3(f, dx, dy, dz, x=None, y=None, coordinate_system='cartesian') curl3(f, dx, dy, dz, x=None, y=None, coordinate_system="cartesian") Take the triple curl of a pencil code vector array f. Supports only equidistant grids. :param f: Pencil code vector array f. :type f: ndarray :param dx: Grid spacing in the three dimensions. :type dx: floats :param dy: Grid spacing in the three dimensions. :type dy: floats :param dz: Grid spacing in the three dimensions. :type dz: floats :param x: Radial (x) and polar (y) coordinates, 1d arrays. :type x: ndarrays :param y: Radial (x) and polar (y) coordinates, 1d arrays. :type y: ndarrays :param coordinate_system: Coordinate system under which to take the divergence. Takes 'cartesian' and 'cylindrical'. :type coordinate_system: string .. py:function:: del6(f, dx=None, dy=None, dz=None, grid=None) del6(f, dx=None, dy=None, dz=None, grid=None) Calculate del6 (defined here as d^6/dx^6 + d^6/dy^6 + d^6/dz^6, rather than del2^3) of a scalar f for hyperdiffusion. :param f: Pencil code scalar array f. :type f: ndarray :param grid: Pencil grid object. See pc.read.grid(). :type grid: pencil.read.grids.Grid :param Deprecated parameters (only for backwards compatibility): :param --------------------------------------------------------: :param dx: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dx: floats :param dy: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dy: floats :param dz: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dz: floats .. py:function:: gij(f, dx, dy, dz, nder=6) Calculate del6 (defined here as d^6/dx^6 + d^6/dy^6 + d^6/dz^6, rather than del2^3) of a scalar f for hyperdiffusion. .. py:function:: traceless_strain(f, dx, dy, dz, x=None, y=None, z=None, coordinate_system='cartesian')