4.2.2.1 pde.grids.coordinates.base module
- class CoordinatesBase[source]
Bases:
object
Base class for orthonormal coordinate systems
- basis_rotation(points)[source]
returns the basis vectors of the grid in Cartesian coordinates
- Parameters:
points (
ndarray
) – Coordinates of the point(s) where the basis determined- Returns:
- Arrays of vectors giving the direction of the grid
unit vectors in Cartesian coordinates. The returnd array has the shape (dim, dim) + points_shape, assuming points has the shape `points_shape + (dim,)
- Return type:
- distance(p1, p2)[source]
Calculate the distance between two points given in real coordinates
This takes periodic boundary conditions into account if necessary.
- Parameters:
p1 (
ndarray
) – First positionp2 (
ndarray
) – Second positioncoords (str) – The coordinate system in which the points are specified. Valid values are cartesian, cell, and grid; see
transform()
.
- Returns:
Distance between the two positions
- Return type:
- pos_diff(p1, p2)[source]
return Cartesian vector(s) pointing from p1 to p2
In case of periodic boundary conditions, the shortest vector is returned.
- exception DimensionError[source]
Bases:
ValueError
exception indicating that dimensions were inconsistent