Module vector¶
A module for the common differential operators of vector calculus
- class findiff.vector.Curl(**kwargs)¶
The curl operator.
Is only defined for 3D.
- Parameters
kwargs –
exactly one of h and coords must be specified
- h
list with the grid spacings of a 3-dimensional uniform grid
- coords
list of 1D arrays with the coordinate values along the 3 axes. This is used for non-uniform grids.
- acc
accuracy order, must be positive integer, default is 2
Constructor for the VectorOperator base class.
kwargs:¶
h list with the grid spacings of an N-dimensional uniform grid
- coords list of 1D arrays with the coordinate values along the N axes.
This is used for non-uniform grids.
Either specify “h” or “coords”, not both.
- class findiff.vector.Divergence(**kwargs)¶
The N-dimensional divergence.
- Parameters
kwargs –
exactly one of h and coords must be specified
- h
list with the grid spacings of an N-dimensional uniform grid
- coords
list of 1D arrays with the coordinate values along the N axes. This is used for non-uniform grids.
- acc
accuracy order, must be positive integer, default is 2
Constructor for the VectorOperator base class.
kwargs:¶
h list with the grid spacings of an N-dimensional uniform grid
- coords list of 1D arrays with the coordinate values along the N axes.
This is used for non-uniform grids.
Either specify “h” or “coords”, not both.
- class findiff.vector.Gradient(**kwargs)¶
The N-dimensional gradient.
- Parameters
kwargs –
exactly one of h and coords must be specified
- h
list with the grid spacings of an N-dimensional uniform grid
- coords
list of 1D arrays with the coordinate values along the N axes. This is used for non-uniform grids.
- acc
accuracy order, must be positive integer, default is 2
Constructor for the VectorOperator base class.
kwargs:¶
h list with the grid spacings of an N-dimensional uniform grid
- coords list of 1D arrays with the coordinate values along the N axes.
This is used for non-uniform grids.
Either specify “h” or “coords”, not both.
- class findiff.vector.Laplacian(h=[1.0], acc=2)¶
The N-dimensional Laplace operator.
- Parameters
kwargs –
exactly one of h and coords must be specified
- h
list with the grid spacings of an N-dimensional uniform grid
- coords
list of 1D arrays with the coordinate values along the N axes. This is used for non-uniform grids.
- acc
accuracy order, must be positive integer, default is 2
- class findiff.vector.VectorOperator(**kwargs)¶
Base class for all vector differential operators. Shall not be instantiated directly, but through the child classes.
Constructor for the VectorOperator base class.
kwargs:¶
h list with the grid spacings of an N-dimensional uniform grid
- coords list of 1D arrays with the coordinate values along the N axes.
This is used for non-uniform grids.
Either specify “h” or “coords”, not both.
- findiff.vector.wrap_in_ndarray(value)¶
Wraps the argument in a numpy.ndarray.
If value is a scalar, it is converted in a list first. If value is array-like, the shape is conserved.