pencil.math.derivatives.div_grad_curl
Compute the divergence, gradient and curl.
Functions
|
div(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) |
|
curl(f, dx=None, dy=None, dz=None, x=None, y=None, run2D=False, coordinate_system="cartesian", grid=None) |
|
curl2(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) |
|
del2v(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system="cartesian", grid=None) |
|
curl3(f, dx, dy, dz, x=None, y=None, coordinate_system="cartesian") |
|
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 |
|
Module Contents
- pencil.math.derivatives.div_grad_curl.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.
- Parameters:
f (ndarray) – Pencil code vector array f.
grid (pencil.read.grids.Grid) – Pencil grid object. See pc.read.grid().
coordinate_system (string) – Coordinate system under which to take the divergence. Takes ‘cartesian’, ‘cylindrical’ and ‘spherical’.
compatibility) (Deprecated parameters (only for backwards)
--------------------------------------------------------
dx (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dy (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dz (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
x (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
y (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
- pencil.math.derivatives.div_grad_curl.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.
- Parameters:
f (ndarray) – Pencil code scalar array f.
grid (pencil.read.grids.Grid) – Pencil grid object. See pc.read.grid().
coordinate_system (string) – Coordinate system under which to take the divergence. Takes ‘cartesian’, ‘cylindrical’ and ‘spherical’.
compatibility) (Deprecated parameters (only for backwards)
--------------------------------------------------------
dx (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dy (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dz (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
x (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
y (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
- pencil.math.derivatives.div_grad_curl.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.
- Parameters:
f (ndarray) – Pencil code scalar array f.
grid (pencil.read.grids.Grid) – Pencil grid object. See pc.read.grid().
run2D (bool) – Deals with pure 2-D snapshots. !Only for Cartesian grids at the moment! Requires grid!=None.
coordinate_system (string) – Coordinate system under which to take the divergence. Takes ‘cartesian’, ‘cylindrical’ and ‘spherical’. !Does not work for 2d runs yet!
compatibility) (Deprecated parameters (only for backwards)
--------------------------------------------------------
dx (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dy (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dz (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
x (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
y (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
- pencil.math.derivatives.div_grad_curl.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.
- Parameters:
f (ndarray) – Pencil code vector array f.
grid (pencil.read.grids.Grid) – Pencil grid object. See pc.read.grid().
coordinate_system (string) – Coordinate system under which to take the divergence. Takes ‘cartesian’, ‘cylindrical’ and ‘spherical’.
compatibility) (Deprecated parameters (only for backwards)
--------------------------------------------------------
dx (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dy (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dz (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
x (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
y (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
- pencil.math.derivatives.div_grad_curl.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.
- Parameters:
f (ndarray) – Pencil code vector array f.
grid (pencil.read.grids.Grid) – Pencil grid object. See pc.read.grid().
coordinate_system (string) – Coordinate system under which to take the divergence. Takes ‘cartesian’, ‘cylindrical’ and ‘spherical’.
compatibility) (Deprecated parameters (only for backwards)
--------------------------------------------------------
dx (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dy (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dz (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
x (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
y (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
- pencil.math.derivatives.div_grad_curl.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.
- Parameters:
f (ndarray) – Pencil code vector array f.
grid (pencil.read.grids.Grid) – Pencil grid object. See pc.read.grid().
coordinate_system (string) – Coordinate system under which to take the divergence. Takes ‘cartesian’, ‘cylindrical’ and ‘spherical’.
compatibility) (Deprecated parameters (only for backwards)
--------------------------------------------------------
dx (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dy (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dz (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
x (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
y (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None
- pencil.math.derivatives.div_grad_curl.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.
- Parameters:
f (ndarray) – Pencil code vector array f.
dx (floats) – Grid spacing in the three dimensions.
dy (floats) – Grid spacing in the three dimensions.
dz (floats) – Grid spacing in the three dimensions.
x (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays.
y (ndarrays) – Radial (x) and polar (y) coordinates, 1d arrays.
coordinate_system (string) – Coordinate system under which to take the divergence. Takes ‘cartesian’ and ‘cylindrical’.
- pencil.math.derivatives.div_grad_curl.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.
- Parameters:
f (ndarray) – Pencil code scalar array f.
grid (pencil.read.grids.Grid) – Pencil grid object. See pc.read.grid().
compatibility) (Deprecated parameters (only for backwards)
--------------------------------------------------------
dx (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dy (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
dz (floats) – Grid spacing in the three dimensions. These will not have any effect if grid!=None
- pencil.math.derivatives.div_grad_curl.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.
- pencil.math.derivatives.div_grad_curl.traceless_strain(f, dx, dy, dz, x=None, y=None, z=None, coordinate_system='cartesian')